001package gwt.material.design.client.ui; 002 003/* 004 * #%L 005 * GwtMaterial 006 * %% 007 * Copyright (C) 2015 GwtMaterialDesign 008 * %% 009 * Licensed under the Apache License, Version 2.0 (the "License"); 010 * you may not use this file except in compliance with the License. 011 * You may obtain a copy of the License at 012 * 013 * http://www.apache.org/licenses/LICENSE-2.0 014 * 015 * Unless required by applicable law or agreed to in writing, software 016 * distributed under the License is distributed on an "AS IS" BASIS, 017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 018 * See the License for the specific language governing permissions and 019 * limitations under the License. 020 * #L% 021 */ 022 023import com.google.gwt.dom.client.Document; 024import com.google.gwt.dom.client.Element; 025import gwt.material.design.client.base.AbstractIconButton; 026import gwt.material.design.client.constants.ButtonType; 027 028//@formatter:off 029 030/** 031* There are 3 main button types described in material design. The raised 032* button is a standard button that signify actions and seek to give depth 033* to a mostly flat page. The floating circular action button is meant for 034* very important functions. Flat buttons are usually used within elements 035* that already have depth like cards or modals. 036* <h3>UiBinder Usage:</h3> 037* <pre> 038*{@code 039* //Raised (Default) Button 040* <m:MaterialButton text="Button" waves="LIGHT" backgroundColor="blue" /> 041* 042* // Adding icon 043* <m:MaterialButton text="Button" waves="LIGHT" backgroundColor="blue" iconType="CLOUD" iconPosition="LEFT"/> 044* 045* // FLOATING+ Button 046* <m:MaterialButton type="FLOATING" waves="LIGHT" size="LARGE" iconType="ADD"/> 047* 048* // FLAT Button 049* <m:MaterialButton text="Button" type="FLAT" waves="GREY" /> 050* 051* // LARGE Button 052* <m:MaterialButton size="LARGE" text="Button" waves="LIGHT" backgroundColor="blue" iconType="CLOUD" iconPosition="RIGHT"/>} 053* </pre> 054* 055* @author kevzlou7979 056* @see <a href="http://gwt-material-demo.herokuapp.com/#buttons">Material Button</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}