Class Anchor
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.google.gwt.user.client.ui.FocusWidget
-
- com.google.gwt.user.client.ui.Anchor
-
- All Implemented Interfaces:
HasAllDragAndDropHandlers,HasAllFocusHandlers,HasAllGestureHandlers,HasAllKeyHandlers,HasAllMouseHandlers,HasAllTouchHandlers,HasBlurHandlers,HasClickHandlers,HasDoubleClickHandlers,HasDragEndHandlers,HasDragEnterHandlers,HasDragHandlers,HasDragLeaveHandlers,HasDragOverHandlers,HasDragStartHandlers,HasDropHandlers,HasFocusHandlers,HasGestureChangeHandlers,HasGestureEndHandlers,HasGestureStartHandlers,HasKeyDownHandlers,HasKeyPressHandlers,HasKeyUpHandlers,HasMouseDownHandlers,HasMouseMoveHandlers,HasMouseOutHandlers,HasMouseOverHandlers,HasMouseUpHandlers,HasMouseWheelHandlers,HasTouchCancelHandlers,HasTouchEndHandlers,HasTouchMoveHandlers,HasTouchStartHandlers,HasAttachHandlers,HasHandlers,HasDirection,HasDirectionEstimator,HasSafeHtml,EventListener,Focusable,HasDirectionalSafeHtml,HasDirectionalText,HasEnabled,HasFocus,HasHorizontalAlignment,HasHTML,HasName,HasText,HasVisibility,HasWordWrap,IsWidget,SourcesClickEvents,SourcesFocusEvents,SourcesKeyboardEvents,SourcesMouseEvents
public class Anchor extends FocusWidget implements HasHorizontalAlignment, HasName, HasHTML, HasWordWrap, HasDirection, HasDirectionEstimator, HasDirectionalSafeHtml
A widget that represents a simple <a> element.If you want use this anchor only for changing history states, use
Hyperlinkinstead.Built-in Bidi Text Support
This widget is capable of automatically adjusting its direction according to its content. This feature is controlled bysetDirectionEstimator(boolean)or passing a DirectionEstimator parameter to the constructor, and is off by default.CSS Style Rules
- .gwt-Anchor { }
- See Also:
Hyperlink
-
-
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.i18n.client.HasDirection
HasDirection.Direction
-
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasHorizontalAlignment
HasHorizontalAlignment.AutoHorizontalAlignmentConstant, HasHorizontalAlignment.HorizontalAlignmentConstant
-
-
Field Summary
Fields Modifier and Type Field Description static DirectionEstimatorDEFAULT_DIRECTION_ESTIMATOR-
Fields inherited from class com.google.gwt.user.client.ui.Widget
eventsToSink
-
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX, MISSING_ELEMENT_ERROR, SETELEMENT_TWICE_ERROR
-
Fields inherited from interface com.google.gwt.user.client.ui.HasHorizontalAlignment
ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_JUSTIFY, ALIGN_LEFT, ALIGN_LOCALE_END, ALIGN_LOCALE_START, ALIGN_RIGHT
-
-
Constructor Summary
Constructors Modifier Constructor Description Anchor()Creates an empty anchor.Anchor(boolean useDefaultHref)Creates an anchor.protectedAnchor(Element element)This constructor may be used by subclasses to explicitly use an existing element.Anchor(SafeHtml html)Creates an anchor for scripting.Anchor(SafeHtml html, HasDirection.Direction dir)Creates an anchor for scripting.Anchor(SafeHtml html, HasDirection.Direction dir, SafeUri href)Creates an anchor with its html and href (target URL) specified.Anchor(SafeHtml html, HasDirection.Direction dir, java.lang.String href)Creates an anchor with its html and href (target URL) specified.Anchor(SafeHtml html, DirectionEstimator directionEstimator)Creates an anchor for scripting.Anchor(SafeHtml html, DirectionEstimator directionEstimator, SafeUri href)Creates an anchor with its html and href (target URL) specified.Anchor(SafeHtml html, DirectionEstimator directionEstimator, java.lang.String href)Creates an anchor with its html and href (target URL) specified.Anchor(SafeHtml html, SafeUri href)Creates an anchor with its html and href (target URL) specified.Anchor(SafeHtml html, SafeUri href, java.lang.String target)Creates a source anchor (link to URI).Anchor(SafeHtml html, java.lang.String href)Creates an anchor with its html and href (target URL) specified.Anchor(SafeHtml html, java.lang.String href, java.lang.String target)Creates a source anchor (link to URI).Anchor(java.lang.String text)Creates an anchor for scripting.Anchor(java.lang.String text, boolean asHtml)Creates an anchor for scripting.Anchor(java.lang.String text, boolean asHTML, java.lang.String href)Creates an anchor with its text and href (target URL) specified.Anchor(java.lang.String text, boolean asHtml, java.lang.String href, java.lang.String target)Creates a source anchor (link to URI).Anchor(java.lang.String text, HasDirection.Direction dir)Creates an anchor for scripting.Anchor(java.lang.String text, HasDirection.Direction dir, java.lang.String href)Creates an anchor with its text and href (target URL) specified.Anchor(java.lang.String text, DirectionEstimator directionEstimator)Creates an anchor for scripting.Anchor(java.lang.String text, DirectionEstimator directionEstimator, java.lang.String href)Creates an anchor with its text and href (target URL) specified.Anchor(java.lang.String text, java.lang.String href)Creates an anchor with its text and href (target URL) specified.Anchor(java.lang.String text, java.lang.String href, java.lang.String target)Creates a source anchor with a frame target.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description HasDirection.DirectiongetDirection()Gets the directionality of the widget.DirectionEstimatorgetDirectionEstimator()Returns theDirectionEstimatorobject.HasHorizontalAlignment.HorizontalAlignmentConstantgetHorizontalAlignment()Gets the horizontal alignment.java.lang.StringgetHref()Gets the anchor's href (the url to which it links).java.lang.StringgetHTML()Gets this object's contents as HTML.java.lang.StringgetName()Gets the widget's name.intgetTabIndex()Gets the tab index.java.lang.StringgetTarget()Gets the anchor's target frame (the frame in which navigation will occur when the link is selected).java.lang.StringgetText()Gets this object's text.HasDirection.DirectiongetTextDirection()Gets the direction of this object's text.booleangetWordWrap()Gets whether word-wrapping is enabled.voidsetAccessKey(char key)Sets the widget's 'access key'.voidsetDirection(HasDirection.Direction direction)Deprecated.UsesetDirectionEstimator(boolean)and / or pass explicit direction tosetText(java.lang.String),setHTML(com.google.gwt.safehtml.shared.SafeHtml)insteadvoidsetDirectionEstimator(boolean enabled)Toggles on / off direction estimation.voidsetDirectionEstimator(DirectionEstimator directionEstimator)Sets theDirectionEstimatorobject.voidsetFocus(boolean focused)Explicitly focus/unfocus this widget.voidsetHorizontalAlignment(HasHorizontalAlignment.HorizontalAlignmentConstant align)Sets the horizontal alignment.voidsetHref(SafeUri href)Sets the anchor's href (the url to which it links).voidsetHref(java.lang.String href)Sets the anchor's href (the url to which it links).voidsetHTML(SafeHtml html)Sets this object's contents via known-safe HTML.voidsetHTML(SafeHtml html, HasDirection.Direction dir)Sets this object's html, also declaring its direction.voidsetHTML(java.lang.String html)Sets this object's contents via HTML.voidsetName(java.lang.String name)Sets the widget's name.voidsetTabIndex(int index)Sets the widget's position in the tab index.voidsetTarget(java.lang.String target)Sets the anchor's target frame (the frame in which navigation will occur when the link is selected).voidsetText(java.lang.String text)Sets this object's text.voidsetText(java.lang.String text, HasDirection.Direction dir)Sets this object's text, also declaring its direction.voidsetWordWrap(boolean wrap)Sets whether word-wrapping is enabled.static Anchorwrap(Element element)Creates an Anchor widget that wraps an existing <a> element.-
Methods inherited from class com.google.gwt.user.client.ui.FocusWidget
addBlurHandler, addClickHandler, addClickListener, addDoubleClickHandler, addDragEndHandler, addDragEnterHandler, addDragHandler, addDragLeaveHandler, addDragOverHandler, addDragStartHandler, addDropHandler, addFocusHandler, addFocusListener, addGestureChangeHandler, addGestureEndHandler, addGestureStartHandler, addKeyboardListener, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addMouseDownHandler, addMouseListener, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, addMouseWheelListener, addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler, getFocusImpl, isEnabled, onAttach, removeClickListener, removeFocusListener, removeKeyboardListener, removeMouseListener, removeMouseWheelListener, setEnabled
-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, ensureHandlers, fireEvent, getHandlerCount, getHandlerManager, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, replaceElement, setLayoutData, setParent, 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
-
-
-
-
Field Detail
-
DEFAULT_DIRECTION_ESTIMATOR
public static final DirectionEstimator DEFAULT_DIRECTION_ESTIMATOR
-
-
Constructor Detail
-
Anchor
public Anchor()
Creates an empty anchor.The anchor's href is not set, which means that the widget will not not be styled with the browser's native link styles (such as underline and font color). Use
Anchor(boolean)to add a default no-op href that does not open a link but ensures the native link styles are applied.- See Also:
Anchor(boolean)
-
Anchor
public Anchor(boolean useDefaultHref)
Creates an anchor. The anchor's href is optionally set tojavascript:;, based on the expectation that listeners will be added to the anchor.- Parameters:
useDefaultHref- true to set the default href tojavascript:;, false to leave it blank
-
Anchor
public Anchor(SafeHtml html)
Creates an anchor for scripting.- Parameters:
html- the anchor's html
-
Anchor
public Anchor(SafeHtml html, HasDirection.Direction dir)
Creates an anchor for scripting. The anchor's href is set tojavascript : ;, based on the expectation that listeners will be added to the anchor.- Parameters:
html- the anchor's htmldir- the html's direction
-
Anchor
public Anchor(SafeHtml html, DirectionEstimator directionEstimator)
Creates an anchor for scripting. The anchor's href is set tojavascript : ;, based on the expectation that listeners will be added to the anchor.- Parameters:
html- the anchor's htmldirectionEstimator- A DirectionEstimator object used for automatic direction adjustment. For convenience,DEFAULT_DIRECTION_ESTIMATORcan be used.
-
Anchor
public Anchor(java.lang.String text)
Creates an anchor for scripting. The anchor's href is set tojavascript:;, based on the expectation that listeners will be added to the anchor.- Parameters:
text- the anchor's text
-
Anchor
public Anchor(java.lang.String text, HasDirection.Direction dir)Creates an anchor for scripting. The anchor's href is set tojavascript : ;, based on the expectation that listeners will be added to the anchor.- Parameters:
text- the anchor's textdir- the text's direction
-
Anchor
public Anchor(java.lang.String text, DirectionEstimator directionEstimator)Creates an anchor for scripting. The anchor's href is set tojavascript : ;, based on the expectation that listeners will be added to the anchor.- Parameters:
text- the anchor's textdirectionEstimator- A DirectionEstimator object used for automatic direction adjustment. For convenience,DEFAULT_DIRECTION_ESTIMATORcan be used.
-
Anchor
public Anchor(java.lang.String text, boolean asHtml)Creates an anchor for scripting. The anchor's href is set tojavascript:;, based on the expectation that listeners will be added to the anchor.- Parameters:
text- the anchor's textasHtml-trueto treat the specified text as html
-
Anchor
public Anchor(SafeHtml html, java.lang.String href)
Creates an anchor with its html and href (target URL) specified.- Parameters:
html- the anchor's htmlhref- the url to which it will link
-
Anchor
public Anchor(SafeHtml html, SafeUri href)
Creates an anchor with its html and href (target URL) specified.- Parameters:
html- the anchor's htmlhref- the url to which it will link
-
Anchor
public Anchor(SafeHtml html, HasDirection.Direction dir, java.lang.String href)
Creates an anchor with its html and href (target URL) specified.- Parameters:
html- the anchor's htmldir- the html's directionhref- the url to which it will link
-
Anchor
public Anchor(SafeHtml html, HasDirection.Direction dir, SafeUri href)
Creates an anchor with its html and href (target URL) specified.- Parameters:
html- the anchor's htmldir- the html's directionhref- the url to which it will link
-
Anchor
public Anchor(SafeHtml html, DirectionEstimator directionEstimator, java.lang.String href)
Creates an anchor with its html and href (target URL) specified.- Parameters:
html- the anchor's htmldirectionEstimator- A DirectionEstimator object used for automatic direction adjustment. For convenience,DEFAULT_DIRECTION_ESTIMATORcan be used.href- the url to which it will link
-
Anchor
public Anchor(SafeHtml html, DirectionEstimator directionEstimator, SafeUri href)
Creates an anchor with its html and href (target URL) specified.- Parameters:
html- the anchor's htmldirectionEstimator- A DirectionEstimator object used for automatic direction adjustment. For convenience,DEFAULT_DIRECTION_ESTIMATORcan be used.href- the url to which it will link
-
Anchor
public Anchor(java.lang.String text, java.lang.String href)Creates an anchor with its text and href (target URL) specified.- Parameters:
text- the anchor's texthref- the url to which it will link
-
Anchor
public Anchor(java.lang.String text, HasDirection.Direction dir, java.lang.String href)Creates an anchor with its text and href (target URL) specified.- Parameters:
text- the anchor's textdir- the text's directionhref- the url to which it will link
-
Anchor
public Anchor(java.lang.String text, DirectionEstimator directionEstimator, java.lang.String href)Creates an anchor with its text and href (target URL) specified.- Parameters:
text- the anchor's textdirectionEstimator- A DirectionEstimator object used for automatic direction adjustment. For convenience,DEFAULT_DIRECTION_ESTIMATORcan be used.href- the url to which it will link
-
Anchor
public Anchor(java.lang.String text, boolean asHTML, java.lang.String href)Creates an anchor with its text and href (target URL) specified.- Parameters:
text- the anchor's textasHTML-trueto treat the specified text as htmlhref- the url to which it will link
-
Anchor
public Anchor(SafeHtml html, java.lang.String href, java.lang.String target)
Creates a source anchor (link to URI). That is, an anchor with an href attribute specifying the destination URI.- Parameters:
html- the anchor's htmlhref- the url to which it will linktarget- the target frame (e.g. "_blank" to open the link in a new window)
-
Anchor
public Anchor(SafeHtml html, SafeUri href, java.lang.String target)
Creates a source anchor (link to URI). That is, an anchor with an href attribute specifying the destination URI.- Parameters:
html- the anchor's htmlhref- the url to which it will linktarget- the target frame (e.g. "_blank" to open the link in a new window)
-
Anchor
public Anchor(java.lang.String text, java.lang.String href, java.lang.String target)Creates a source anchor with a frame target.- Parameters:
text- the anchor's texthref- the url to which it will linktarget- the target frame (e.g. "_blank" to open the link in a new window)
-
Anchor
public Anchor(java.lang.String text, boolean asHtml, java.lang.String href, java.lang.String target)Creates a source anchor (link to URI). That is, an anchor with an href attribute specifying the destination URI.- Parameters:
text- the anchor's textasHtml- asHTMLtrueto treat the specified text as htmlhref- the url to which it will linktarget- the target frame (e.g. "_blank" to open the link in a new window)
-
Anchor
protected Anchor(Element element)
This constructor may be used by subclasses to explicitly use an existing element. This element must be an <a> element.- Parameters:
element- the element to be used
-
-
Method Detail
-
wrap
public static Anchor wrap(Element element)
Creates an Anchor widget that wraps an existing <a> element. This element must already be attached to the document. If the element is removed from the document, you must callRootPanel.detachNow(Widget).- Parameters:
element- the element to be wrapped
-
getDirection
public HasDirection.Direction getDirection()
Description copied from interface:HasDirectionGets the directionality of the widget.- Specified by:
getDirectionin interfaceHasDirection- Returns:
RTLif the directionality is right-to-left,LTRif the directionality is left-to-right, orDEFAULTif the directionality is not explicitly specified
-
getDirectionEstimator
public DirectionEstimator getDirectionEstimator()
Description copied from interface:HasDirectionEstimatorReturns theDirectionEstimatorobject.- Specified by:
getDirectionEstimatorin interfaceHasDirectionEstimator
-
getHorizontalAlignment
public HasHorizontalAlignment.HorizontalAlignmentConstant getHorizontalAlignment()
Description copied from interface:HasHorizontalAlignmentGets the horizontal alignment.- Specified by:
getHorizontalAlignmentin interfaceHasHorizontalAlignment- Returns:
- the current horizontal alignment (
HasHorizontalAlignment.ALIGN_LEFT,HasHorizontalAlignment.ALIGN_CENTER,HasHorizontalAlignment.ALIGN_RIGHT,HasHorizontalAlignment.ALIGN_JUSTIFY, or null).
-
getHref
public java.lang.String getHref()
Gets the anchor's href (the url to which it links).- Returns:
- the anchor's href
-
getHTML
public java.lang.String getHTML()
Description copied from interface:HasHTMLGets this object's contents as HTML.
-
getName
public java.lang.String getName()
Description copied from interface:HasNameGets the widget's name.
-
getTabIndex
public int getTabIndex()
Description copied from class:FocusWidgetGets the tab index.- Specified by:
getTabIndexin interfaceFocusable- Overrides:
getTabIndexin classFocusWidget- Returns:
- the tab index
-
getTarget
public java.lang.String getTarget()
Gets the anchor's target frame (the frame in which navigation will occur when the link is selected).- Returns:
- the target frame
-
getText
public java.lang.String getText()
Description copied from interface:HasTextGets this object's text.
-
getTextDirection
public HasDirection.Direction getTextDirection()
Description copied from interface:HasDirectionalTextGets the direction of this object's text.- Specified by:
getTextDirectionin interfaceHasDirectionalText- Returns:
- the direction of this object's text
-
getWordWrap
public boolean getWordWrap()
Description copied from interface:HasWordWrapGets whether word-wrapping is enabled.- Specified by:
getWordWrapin interfaceHasWordWrap- Returns:
trueif word-wrapping is enabled.
-
setAccessKey
public void setAccessKey(char key)
Description copied from interface:FocusableSets the widget's 'access key'. This key is used (in conjunction with a browser-specific modifier key) to automatically focus the widget.- Specified by:
setAccessKeyin interfaceFocusable- Overrides:
setAccessKeyin classFocusWidget- Parameters:
key- the widget's access key
-
setDirection
@Deprecated public void setDirection(HasDirection.Direction direction)
Deprecated.UsesetDirectionEstimator(boolean)and / or pass explicit direction tosetText(java.lang.String),setHTML(com.google.gwt.safehtml.shared.SafeHtml)insteadDescription copied from interface:HasDirectionSets the directionality for a widget.- Specified by:
setDirectionin interfaceHasDirection- Parameters:
direction-RTLif the directionality should be set to right-to-left,LTRif the directionality should be set to left-to-rightDEFAULTif the directionality should not be explicitly set
-
setDirectionEstimator
public void setDirectionEstimator(boolean enabled)
Toggles on / off direction estimation.See note at
setDirectionEstimator(DirectionEstimator).- Specified by:
setDirectionEstimatorin interfaceHasDirectionEstimator- Parameters:
enabled- Whether to enable direction estimation. Iftrue, sets theDirectionEstimatorobject to a defaultDirectionEstimator.
-
setDirectionEstimator
public void setDirectionEstimator(DirectionEstimator directionEstimator)
Sets theDirectionEstimatorobject.Note: DirectionEstimator should be set before the widget has any content; it's highly recommended to set it using a constructor. Reason: if the widget already has non-empty content, this will update its direction according to the new estimator's result. This may cause flicker, and thus should be avoided.
- Specified by:
setDirectionEstimatorin interfaceHasDirectionEstimator- Parameters:
directionEstimator- TheDirectionEstimatorto be set.nullmeans turning off direction estimation.
-
setFocus
public void setFocus(boolean focused)
Description copied from interface:FocusableExplicitly focus/unfocus this widget. Only one widget can have focus at a time, and the widget that does will receive all keyboard events. NOTE: Most browsers fire FocusEvents asynchronously. Especially within GWT tests, you'll need to make your test asynchronous to properly do verifications. SeeGWTTestCase#delayTestFinishfor more information on how to do this.- Specified by:
setFocusin interfaceFocusable- Overrides:
setFocusin classFocusWidget- Parameters:
focused- whether this widget should take focus or release it
-
setHorizontalAlignment
public void setHorizontalAlignment(HasHorizontalAlignment.HorizontalAlignmentConstant align)
Description copied from interface:HasHorizontalAlignmentSets the horizontal alignment.Use
nullto clear horizontal alignment, allowing it to be determined by the standard HTML mechanisms such as inheritance and CSS rules.- Specified by:
setHorizontalAlignmentin interfaceHasHorizontalAlignment- Parameters:
align- the horizontal alignment (HasHorizontalAlignment.ALIGN_LEFT,HasHorizontalAlignment.ALIGN_CENTER,HasHorizontalAlignment.ALIGN_RIGHT,HasHorizontalAlignment.ALIGN_JUSTIFY,HasHorizontalAlignment.ALIGN_LOCALE_START, orHasHorizontalAlignment.ALIGN_LOCALE_END).
-
setHref
public void setHref(SafeUri href)
Sets the anchor's href (the url to which it links).- Parameters:
href- the anchor's href
-
setHref
public void setHref(java.lang.String href)
Sets the anchor's href (the url to which it links).- Parameters:
href- the anchor's href
-
setHTML
public void setHTML(SafeHtml html)
Description copied from interface:HasSafeHtmlSets this object's contents via known-safe HTML.The object will behave exactly the same as when a widget's
HasHTML.setHTML(String)method is invoked; however theSafeHtmlpassed to this method observes the contract that it can be used in an HTML context without causing unsafe script execution. Thus, unlikeHasHTML.setHTML(String), using this method cannot result in Cross-Site Scripting security vulnerabilities.- Specified by:
setHTMLin interfaceHasSafeHtml- Parameters:
html- the object's new HTML, represented as aSafeHtmlobject
-
setHTML
public void setHTML(java.lang.String html)
Description copied from interface:HasHTMLSets this object's contents via HTML. Use care when setting an object's HTML; it is an easy way to expose script-based security problems. Consider usingHasText.setText(String)whenever possible.
-
setHTML
public void setHTML(SafeHtml html, HasDirection.Direction dir)
Description copied from interface:HasDirectionalSafeHtmlSets this object's html, also declaring its direction.- Specified by:
setHTMLin interfaceHasDirectionalSafeHtml- Parameters:
html- the object's new htmldir- the html's direction
-
setName
public void setName(java.lang.String name)
Description copied from interface:HasNameSets the widget's name.
-
setTabIndex
public void setTabIndex(int index)
Description copied from interface:FocusableSets the widget's position in the tab index. If more than one widget has the same tab index, each such widget will receive focus in an arbitrary order. Setting the tab index to-1will cause this widget to be removed from the tab order.- Specified by:
setTabIndexin interfaceFocusable- Overrides:
setTabIndexin classFocusWidget- Parameters:
index- the widget's tab index
-
setTarget
public void setTarget(java.lang.String target)
Sets the anchor's target frame (the frame in which navigation will occur when the link is selected).- Parameters:
target- the target frame
-
setText
public void setText(java.lang.String text)
Description copied from interface:HasTextSets this object's text.
-
setText
public void setText(java.lang.String text, HasDirection.Direction dir)Description copied from interface:HasDirectionalTextSets this object's text, also declaring its direction.- Specified by:
setTextin interfaceHasDirectionalText- Parameters:
text- the object's new textdir- the text's direction
-
setWordWrap
public void setWordWrap(boolean wrap)
Description copied from interface:HasWordWrapSets whether word-wrapping is enabled.- Specified by:
setWordWrapin interfaceHasWordWrap- Parameters:
wrap-trueto enable word-wrapping.
-
-