org.gwtbootstrap3.client.ui
Class Anchor

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Panel
              extended by com.google.gwt.user.client.ui.ComplexPanel
                  extended by org.gwtbootstrap3.client.ui.base.ComplexWidget
                      extended by org.gwtbootstrap3.client.ui.Anchor
All Implemented Interfaces:
HasClickHandlers, HasDoubleClickHandlers, HasAttachHandlers, HasHandlers, EventListener, Focusable, HasEnabled, HasHTML, HasText, HasVisibility, HasWidgets, HasWidgets.ForIsWidget, IndexedPanel, IndexedPanel.ForIsWidget, IsWidget, Iterable<Widget>, HasDataParent, HasDataTarget, HasDataToggle, HasHref, HasIcon, HasIconPosition, HasId, HasInlineStyle, HasPull, HasResponsiveness, HasTarget, HasTargetHistoryToken
Direct Known Subclasses:
ImageAnchor, NavbarBrand, NavbarLink

public class Anchor
extends ComplexWidget
implements HasEnabled, HasClickHandlers, HasDoubleClickHandlers, HasHref, HasDataToggle, HasDataParent, HasTargetHistoryToken, HasHTML, HasIcon, HasIconPosition, Focusable, HasDataTarget, HasTarget, HasPull

Anchor <a> element with text and optional icon.

Author:
Sven Jacobs, Joshua Godi, Grant Slender

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.IndexedPanel
IndexedPanel.ForIsWidget
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
HasWidgets.ForIsWidget
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Fields inherited from interface org.gwtbootstrap3.client.ui.base.HasHref
EMPTY_HREF, HREF
 
Fields inherited from interface org.gwtbootstrap3.client.ui.base.HasTarget
BLANK
 
Constructor Summary
Anchor()
          Creates a default anchor with a default href
Anchor(String href)
          Creates an anchor widget with the desired HREF
Anchor(String text, String href)
          Creates an achor widget with the desired HREF and text
 
Method Summary
 HandlerRegistration addClickHandler(ClickHandler handler)
          
 HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler)
          
 String getDataParent()
          
 String getDataTarget()
          Gets the data target of the widget
 Toggle getDataToggle()
          Gets the data-toggle attribute on the widget
 String getHref()
          Get the HREF of the widget
 String getHTML()
          
 IconType getIcon()
          
 IconFlip getIconFlip()
          
 IconPosition getIconPosition()
          
 IconRotate getIconRotate()
          
 IconSize getIconSize()
          
 Pull getPull()
          
 int getTabIndex()
          
 String getTarget()
          Get the target attribute of the object
 String getTargetHistoryToken()
          Get the target history token for the widget
 String getText()
          
 boolean isEnabled()
          
 boolean isIconBordered()
          
 boolean isIconFixedWidth()
          
 boolean isIconLight()
          
 boolean isIconMuted()
          
 boolean isIconSpin()
          
protected  void onAttach()
          
 void onBrowserEvent(Event event)
          We override this because the tag doesn't support the disabled property.
 void setAccessKey(char key)
          
 void setDataParent(String dataParent)
          
 void setDataTarget(String dataTarget)
          Sets the data target for the widget
 void setDataTargetWidget(Widget widget)
           
 void setDataTargetWidgets(List<Widget> widgets)
           
 void setDataToggle(Toggle toggle)
          Sets the attribute data-toggle on the widget
 void setEnabled(boolean enabled)
          
 void setFocus(boolean focused)
          
 void setHref(String href)
          Set's the HREF of the widget
 void setHTML(String html)
          
 void setIcon(IconType iconType)
          
 void setIconBordered(boolean iconBordered)
          
 void setIconFixedWidth(boolean iconFixedWidth)
          
 void setIconFlip(IconFlip iconFlip)
          
 void setIconLight(boolean iconLight)
          
 void setIconMuted(boolean iconMuted)
          
 void setIconPosition(IconPosition iconPosition)
          
 void setIconRotate(IconRotate iconRotate)
          
 void setIconSize(IconSize iconSize)
          
 void setIconSpin(boolean iconSpin)
          
 void setPull(Pull pull)
          
 void setTabIndex(int index)
          
 void setTarget(String target)
          Set the target attribute of the object
 void setTargetHistoryToken(String targetHistoryToken)
          Set the target history token for the widget
 void setText(String text)
          
 
Methods inherited from class org.gwtbootstrap3.client.ui.base.ComplexWidget
add, getId, insert, setColor, setHiddenOn, setId, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setVisibleOn
 
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel
add, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

Anchor

public Anchor(String href)
Creates an anchor widget with the desired HREF

Parameters:
href - href for the anchor

Anchor

public Anchor(String text,
              String href)
Creates an achor widget with the desired HREF and text

Parameters:
text - text for the anchor
href - href for the anchor

Anchor

public Anchor()
Creates a default anchor with a default href

Method Detail

addClickHandler

public HandlerRegistration addClickHandler(ClickHandler handler)

Specified by:
addClickHandler in interface HasClickHandlers

addDoubleClickHandler

public HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler)

Specified by:
addDoubleClickHandler in interface HasDoubleClickHandlers

setText

public void setText(String text)

Specified by:
setText in interface HasText

getText

public String getText()

Specified by:
getText in interface HasText

setIcon

public void setIcon(IconType iconType)

Specified by:
setIcon in interface HasIcon

getIcon

public IconType getIcon()

Specified by:
getIcon in interface HasIcon

setIconPosition

public void setIconPosition(IconPosition iconPosition)

Specified by:
setIconPosition in interface HasIconPosition

getIconPosition

public IconPosition getIconPosition()

Specified by:
getIconPosition in interface HasIconPosition

setIconSize

public void setIconSize(IconSize iconSize)

Specified by:
setIconSize in interface HasIcon

getIconSize

public IconSize getIconSize()

Specified by:
getIconSize in interface HasIcon

setIconFlip

public void setIconFlip(IconFlip iconFlip)

Specified by:
setIconFlip in interface HasIcon

getIconFlip

public IconFlip getIconFlip()

Specified by:
getIconFlip in interface HasIcon

setIconRotate

public void setIconRotate(IconRotate iconRotate)

Specified by:
setIconRotate in interface HasIcon

getIconRotate

public IconRotate getIconRotate()

Specified by:
getIconRotate in interface HasIcon

setIconBordered

public void setIconBordered(boolean iconBordered)

Specified by:
setIconBordered in interface HasIcon

isIconBordered

public boolean isIconBordered()

Specified by:
isIconBordered in interface HasIcon

setIconMuted

public void setIconMuted(boolean iconMuted)

Specified by:
setIconMuted in interface HasIcon

isIconMuted

public boolean isIconMuted()

Specified by:
isIconMuted in interface HasIcon

setIconLight

public void setIconLight(boolean iconLight)

Specified by:
setIconLight in interface HasIcon

isIconLight

public boolean isIconLight()

Specified by:
isIconLight in interface HasIcon

setIconSpin

public void setIconSpin(boolean iconSpin)

Specified by:
setIconSpin in interface HasIcon

isIconSpin

public boolean isIconSpin()

Specified by:
isIconSpin in interface HasIcon

setIconFixedWidth

public void setIconFixedWidth(boolean iconFixedWidth)

Specified by:
setIconFixedWidth in interface HasIcon

isIconFixedWidth

public boolean isIconFixedWidth()

Specified by:
isIconFixedWidth in interface HasIcon

setHref

public void setHref(String href)
Set's the HREF of the widget

Specified by:
setHref in interface HasHref
Parameters:
href - String href

getHref

public String getHref()
Get the HREF of the widget

Specified by:
getHref in interface HasHref
Returns:
String href

setTargetHistoryToken

public void setTargetHistoryToken(String targetHistoryToken)
Set the target history token for the widget

Specified by:
setTargetHistoryToken in interface HasTargetHistoryToken
Parameters:
targetHistoryToken - String target history token of the widget

getTargetHistoryToken

public String getTargetHistoryToken()
Get the target history token for the widget

Specified by:
getTargetHistoryToken in interface HasTargetHistoryToken
Returns:
String the widget's target history token

setDataParent

public void setDataParent(String dataParent)

Specified by:
setDataParent in interface HasDataParent

getDataParent

public String getDataParent()

Specified by:
getDataParent in interface HasDataParent

setDataToggle

public void setDataToggle(Toggle toggle)
Sets the attribute data-toggle on the widget

Specified by:
setDataToggle in interface HasDataToggle
Parameters:
toggle - Toggle toggle attribute

getDataToggle

public Toggle getDataToggle()
Gets the data-toggle attribute on the widget

Specified by:
getDataToggle in interface HasDataToggle
Returns:
Toggle data-toggle attribute

getTabIndex

public int getTabIndex()

Specified by:
getTabIndex in interface Focusable

setTabIndex

public void setTabIndex(int index)

Specified by:
setTabIndex in interface Focusable

setAccessKey

public void setAccessKey(char key)

Specified by:
setAccessKey in interface Focusable

setFocus

public void setFocus(boolean focused)

Specified by:
setFocus in interface Focusable

getHTML

public String getHTML()

Specified by:
getHTML in interface HasHTML

setHTML

public void setHTML(String html)

Specified by:
setHTML in interface HasHTML

setDataTargetWidgets

public void setDataTargetWidgets(List<Widget> widgets)
Specified by:
setDataTargetWidgets in interface HasDataTarget

setDataTargetWidget

public void setDataTargetWidget(Widget widget)
Specified by:
setDataTargetWidget in interface HasDataTarget

setDataTarget

public void setDataTarget(String dataTarget)
Sets the data target for the widget

Specified by:
setDataTarget in interface HasDataTarget
Parameters:
dataTarget - data target string

getDataTarget

public String getDataTarget()
Gets the data target of the widget

Specified by:
getDataTarget in interface HasDataTarget
Returns:
data target

setTarget

public void setTarget(String target)
Set the target attribute of the object

Specified by:
setTarget in interface HasTarget
Parameters:
target - target attribute

getTarget

public String getTarget()
Get the target attribute of the object

Specified by:
getTarget in interface HasTarget
Returns:
target attribute

setPull

public void setPull(Pull pull)

Specified by:
setPull in interface HasPull
Overrides:
setPull in class ComplexWidget

getPull

public Pull getPull()

Specified by:
getPull in interface HasPull
Overrides:
getPull in class ComplexWidget

isEnabled

public boolean isEnabled()

Specified by:
isEnabled in interface HasEnabled

setEnabled

public void setEnabled(boolean enabled)

Specified by:
setEnabled in interface HasEnabled

onAttach

protected void onAttach()

Overrides:
onAttach in class Widget

onBrowserEvent

public void onBrowserEvent(Event event)
We override this because the tag doesn't support the disabled property. So on clicks and focus, if disabled then ignore

Specified by:
onBrowserEvent in interface EventListener
Overrides:
onBrowserEvent in class Widget
Parameters:
event - dom event


Copyright © 2015. All rights reserved.