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.Element; 024import com.google.gwt.user.client.DOM; 025import gwt.material.design.client.base.AbstractIconButton; 026import gwt.material.design.client.constants.ButtonType; 027import gwt.material.design.client.constants.IconType; 028 029//@formatter:off 030 031/** 032 * 033 * Using Material Link you can easily add href functionality into your app for navigation 034 * <h3>UiBinder Usage:</h3> 035 * <pre> 036 * {@code 037 * Links 038 * <m:MaterialLink href="#normal" text="Normal Link" textColor="red" iconType="POLYMER" iconPosition="LEFT"/> 039 * 040 * <m:MaterialLink href="#material" text="Link with Href" textColor="red" iconType="POLYMER" iconPosition="LEFT"/> 041 * 042 * <m:MaterialLink href="#design" text="Link with Different Icon color" textColor="black" iconType="POLYMER" iconPosition="LEFT" iconColor="red"/>} 043 * </pre> 044 * 045 * @author kevzlou7979 046 * @author Ben Dol 047 * @see <a href="http://gwt-material-demo.herokuapp.com/#buttons">Material Link</a> 048 */ 049//@formatter:on 050public class MaterialLink extends AbstractIconButton { 051 052 public MaterialLink(ButtonType type, String text, MaterialIcon icon) { 053 super(type, text, icon); 054 } 055 056 public MaterialLink(String text, MaterialIcon icon) { 057 super(ButtonType.LINK, text, icon); 058 } 059 060 public MaterialLink(IconType iconType) { 061 super(iconType); 062 } 063 064 public MaterialLink(String text) { 065 super(ButtonType.LINK, text); 066 } 067 068 public MaterialLink() { 069 super(ButtonType.LINK); 070 } 071 072 @Override 073 protected Element createElement() { 074 return DOM.createAnchor(); 075 } 076}