001/* 002 * #%L 003 * GwtMaterial 004 * %% 005 * Copyright (C) 2015 - 2017 GwtMaterialDesign 006 * %% 007 * Licensed under the Apache License, Version 2.0 (the "License"); 008 * you may not use this file except in compliance with the License. 009 * You may obtain a copy of the License at 010 * 011 * http://www.apache.org/licenses/LICENSE-2.0 012 * 013 * Unless required by applicable law or agreed to in writing, software 014 * distributed under the License is distributed on an "AS IS" BASIS, 015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 016 * See the License for the specific language governing permissions and 017 * limitations under the License. 018 * #L% 019 */ 020package gwt.material.design.client.ui; 021 022import com.google.gwt.dom.client.Document; 023import com.google.gwt.dom.client.Element; 024import gwt.material.design.client.base.AbstractIconButton; 025import gwt.material.design.client.constants.ButtonType; 026 027//@formatter:off 028 029/** 030 * There are 3 main button types described in material design. The raised 031 * button is a standard button that signify actions and seek to give depth 032 * to a mostly flat page. The floating circular action button is meant for 033 * very important functions. Flat buttons are usually used within elements 034 * that already have depth like cards or modals. 035 * <h3>UiBinder Usage:</h3> 036 * <pre> 037 * {@code 038 * //Raised (Default) Button 039 * <m:MaterialButton text="Button" waves="LIGHT" backgroundColor="BLUE" /> 040 * 041 * // Adding icon 042 * <m:MaterialButton text="Button" waves="LIGHT" backgroundColor="BLUE" iconType="CLOUD" iconPosition="LEFT"/> 043 * 044 * // FLOATING Button 045 * <m:MaterialButton type="FLOATING" waves="LIGHT" size="LARGE" iconType="ADD"/> 046 * 047 * // FLAT Button 048 * <m:MaterialButton text="Button" type="FLAT" waves="GREY" /> 049 * 050 * // LARGE Button 051 * <m:MaterialButton size="LARGE" text="Button" waves="LIGHT" backgroundColor="BLUE" iconType="CLOUD" iconPosition="RIGHT"/>} 052 * </pre> 053 * 054 * @author kevzlou7979 055 * @see <a href="http://gwtmaterialdesign.github.io/gwt-material-demo/#buttons">Material Button</a> 056 * @see <a href="https://material.io/guidelines/components/buttons.html">Material Design Specification</a> 057 */ 058//@formatter:on 059public class MaterialAnchorButton extends AbstractIconButton { 060 061 public MaterialAnchorButton(ButtonType type, String text, MaterialIcon icon) { 062 super(type, text, icon); 063 } 064 065 public MaterialAnchorButton(String text, MaterialIcon icon) { 066 super(ButtonType.RAISED, text, icon); 067 } 068 069 public MaterialAnchorButton(String text) { 070 super(ButtonType.RAISED, text); 071 } 072 073 public MaterialAnchorButton(ButtonType type) { 074 super(type); 075 } 076 077 public MaterialAnchorButton() { 078 super(ButtonType.RAISED); 079 } 080 081 @Override 082 protected Element createElement() { 083 return Document.get().createAnchorElement(); 084 } 085}