public class IconAnchor extends ComplexWidget implements com.google.gwt.user.client.ui.HasText, HasIcon, HasHref, com.google.gwt.event.dom.client.HasClickHandlers, com.google.gwt.user.client.ui.HasEnabled, com.google.gwt.user.client.ui.Focusable, com.google.gwt.user.client.ui.HasName, com.google.gwt.event.dom.client.HasMouseDownHandlers
It uses a HTML <a> tag and can contain text and child widgets. But
not both at the same time.
<b:IconAnchor icon="plane" href="www.twitter.com">Some Text</b:IconAnchor>
Here we add a second Icon:
<b:IconAnchor icon="STAR" text="There is a widget so the text goes here">
<b:Icon type="STAR" />
</b:IconAnchor>
All parameter are optional. All setters can be used as parameters.
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled| Constructor and Description |
|---|
IconAnchor()
Creates the widget and sets the
href property to
javascript:; in order to avoid problems when clicking on it. |
| Modifier and Type | Method and Description |
|---|---|
com.google.gwt.event.shared.HandlerRegistration |
addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addMouseDownHandler(com.google.gwt.event.dom.client.MouseDownHandler handler) |
protected com.google.gwt.dom.client.AnchorElement |
getAnchorElement() |
String |
getHref()
Gets the URL of the website, the link is pointing to.
|
String |
getName() |
int |
getTabIndex() |
String |
getTarget()
Get target attribute value
|
String |
getTargetHistoryToken()
Gets the history token this link points to
|
String |
getText() |
boolean |
isActive()
Has the active css style name?
|
boolean |
isEnabled() |
protected void |
onAttach() |
void |
onBrowserEvent(com.google.gwt.user.client.Event event) |
void |
setAccessKey(char key) |
void |
setActive(boolean active)
Set active style name.
|
void |
setBaseIcon(BaseIconType type)
Sets the BaseType of the Icon.
|
void |
setCaret(boolean visible)
Shows or hides the caret.
|
void |
setCustomIconStyle(String customIconStyle)
Set custom icon style.
|
void |
setEmptyHref()
Sets the
hrefproperty of this element to "javascript:;" in
order to get another cursor (hand). |
void |
setEnabled(boolean enabled) |
void |
setFocus(boolean focused) |
void |
setHref(String href)
Sets the
href property of the anchor tag. |
void |
setIcon(IconType type)
Sets the Type of the Icon.
|
void |
setIconPosition(IconPosition position)
Set icon position , left or right
|
void |
setIconSize(IconSize size)
Sets the size of the icon.
|
void |
setName(String name) |
void |
setTabIndex(int index) |
void |
setTarget(String target)
Set target attribute
|
void |
setTargetHistoryToken(String targetHistoryToken)
Sets the
href property of the anchor tag to
"#" + targetHistoryToken. |
void |
setText(String text) |
add, addStyle, insert, removeStyle, setHideOn, setShowOn, setStyleadd, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, removeadd, adopt, adopt, clear, disown, doAttachChildren, doDetachChildren, orphan, removeaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, setParent, sinkEventsaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEventsprotected Icon icon
public IconAnchor()
href property to
javascript:; in order to avoid problems when clicking on it.public void setIconPosition(IconPosition position)
setIconPosition in interface HasIconposition - icon's positionpublic void setIcon(IconType type)
public void setBaseIcon(BaseIconType type)
setBaseIcon in interface HasIconpublic void setIconSize(IconSize size)
Default is DEFAULT.
setIconSize in interface HasIconsize - the new size.public void setText(String text)
setText in interface com.google.gwt.user.client.ui.HasTextpublic String getText()
getText in interface com.google.gwt.user.client.ui.HasTextpublic void setHref(String href)
href property of the anchor tag.
Use it only to set links to another page. Links on the same page or GWT
tokens should be set with #setTargetHistoryToken(String)
public String getHref()
public void setCaret(boolean visible)
visible - true if the caret should be shown.public void setTargetHistoryToken(String targetHistoryToken)
href property of the anchor tag to
"#" + targetHistoryToken.setTargetHistoryToken in interface HasHreftargetHistoryToken - the history tokenpublic String getTargetHistoryToken()
getTargetHistoryToken in interface HasHrefpublic void setEmptyHref()
hrefproperty of this element to "javascript:;" in
order to get another cursor (hand).public com.google.gwt.event.shared.HandlerRegistration addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
addClickHandler in interface com.google.gwt.event.dom.client.HasClickHandlerspublic com.google.gwt.event.shared.HandlerRegistration addMouseDownHandler(com.google.gwt.event.dom.client.MouseDownHandler handler)
addMouseDownHandler in interface com.google.gwt.event.dom.client.HasMouseDownHandlerspublic boolean isEnabled()
isEnabled in interface com.google.gwt.user.client.ui.HasEnabledpublic void setEnabled(boolean enabled)
setEnabled in interface com.google.gwt.user.client.ui.HasEnabledpublic void onBrowserEvent(com.google.gwt.user.client.Event event)
onBrowserEvent in interface com.google.gwt.user.client.EventListeneronBrowserEvent in class com.google.gwt.user.client.ui.Widgetpublic int getTabIndex()
getTabIndex in interface com.google.gwt.user.client.ui.Focusablepublic void setAccessKey(char key)
setAccessKey in interface com.google.gwt.user.client.ui.Focusablepublic void setFocus(boolean focused)
setFocus in interface com.google.gwt.user.client.ui.Focusablepublic void setTabIndex(int index)
setTabIndex in interface com.google.gwt.user.client.ui.Focusableprotected void onAttach()
onAttach in class com.google.gwt.user.client.ui.Widgetpublic void setActive(boolean active)
active - true : set active false : unset activepublic boolean isActive()
true: has false : none.public void setName(String name)
setName in interface com.google.gwt.user.client.ui.HasNamepublic String getName()
getName in interface com.google.gwt.user.client.ui.HasNamepublic void setTarget(String target)
target - target namepublic String getTarget()
protected com.google.gwt.dom.client.AnchorElement getAnchorElement()
public void setCustomIconStyle(String customIconStyle)
It sets css class name to <i> tag. You can set any icons style.
setCustomIconStyle in interface HasIconCopyright © 2016. All rights reserved.