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 |
A widget that represents a simple <a> element.
If you want use this anchor only for changing history states, use
Hyperlink
instead.
setDirectionEstimator(boolean)
or
passing a DirectionEstimator parameter to the constructor, and is off by
default.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.user.client.ui.UIObject
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DEFAULT_DIRECTION_ESTIMATOR |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.google.gwt.user.client.ui.HasHorizontalAlignment
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates an empty anchor.
| |||||||||||
Creates an anchor for scripting.
| |||||||||||
Creates an anchor for scripting.
| |||||||||||
Creates an anchor for scripting.
| |||||||||||
Creates an anchor for scripting.
| |||||||||||
Creates an anchor for scripting.
| |||||||||||
Creates an anchor for scripting.
| |||||||||||
Creates an anchor for scripting.
| |||||||||||
Creates an anchor with its html and href (target URL) specified.
| |||||||||||
Creates an anchor with its html and href (target URL) specified.
| |||||||||||
Creates an anchor with its html and href (target URL) specified.
| |||||||||||
Creates an anchor with its text and href (target URL) specified.
| |||||||||||
Creates an anchor with its text and href (target URL) specified.
| |||||||||||
Creates an anchor with its text and href (target URL) specified.
| |||||||||||
Creates an anchor with its text and href (target URL) specified.
| |||||||||||
Creates a source anchor (link to URI).
| |||||||||||
Creates a source anchor with a frame target.
| |||||||||||
Creates a source anchor (link to URI).
|
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This constructor may be used by subclasses to explicitly use an existing
element.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gets the directionality of the widget.
| |||||||||||
Returns the
DirectionEstimator object. | |||||||||||
Gets this object's contents as HTML.
| |||||||||||
Gets the horizontal alignment.
| |||||||||||
Gets the anchor's href (the url to which it links).
| |||||||||||
Gets the widget's name.
| |||||||||||
Gets the tab index.
| |||||||||||
Gets the anchor's target frame (the frame in which navigation will occur
when the link is selected).
| |||||||||||
Gets this object's text.
| |||||||||||
Gets the direction of this object's text.
| |||||||||||
Gets whether word-wrapping is enabled.
| |||||||||||
Sets the widget's 'access key'.
| |||||||||||
This method is deprecated.
Use
setDirectionEstimator(boolean) and / or pass explicit
direction to setText(String) , setHTML(SafeHtml) instead
| |||||||||||
Sets the
DirectionEstimator object.
Note: DirectionEstimator should be set before the widget has any content; it's highly recommended to set it using a constructor. | |||||||||||
Toggles on / off direction estimation.
See note at | |||||||||||
Explicitly focus/unfocus this widget.
| |||||||||||
Sets this object's contents via known-safe HTML.
| |||||||||||
Sets this object's contents via HTML.
| |||||||||||
Sets this object's html, also declaring its direction.
| |||||||||||
Sets the horizontal alignment.
| |||||||||||
Sets the anchor's href (the url to which it links).
| |||||||||||
Sets the widget's name.
| |||||||||||
Sets the widget's position in the tab index.
| |||||||||||
Sets the anchor's target frame (the frame in which navigation will occur
when the link is selected).
| |||||||||||
Sets this object's text.
| |||||||||||
Sets this object's text, also declaring its direction.
| |||||||||||
Sets whether word-wrapping is enabled.
| |||||||||||
Creates an Anchor widget that wraps an existing <a> element.
|
Creates an empty anchor.
Creates an anchor for scripting.
The anchor's href is set to javascript : ;
, based on the
expectation that listeners will be added to the anchor.
html | the anchor's html |
---|---|
dir | the html's direction |
Creates an anchor for scripting.
The anchor's href is set to javascript : ;
, based on the
expectation that listeners will be added to the anchor.
html | the anchor's html |
---|---|
directionEstimator | A DirectionEstimator object used for automatic
direction adjustment. For convenience,
DEFAULT_DIRECTION_ESTIMATOR can be used.
|
Creates an anchor for scripting.
The anchor's href is set to javascript:;
, based on the
expectation that listeners will be added to the anchor.
text | the anchor's text |
---|
Creates an anchor for scripting.
The anchor's href is set to javascript : ;
, based on the
expectation that listeners will be added to the anchor.
text | the anchor's text |
---|---|
dir | the text's direction |
Creates an anchor for scripting.
The anchor's href is set to javascript : ;
, based on the
expectation that listeners will be added to the anchor.
text | the anchor's text |
---|---|
directionEstimator | A DirectionEstimator object used for automatic
direction adjustment. For convenience,
DEFAULT_DIRECTION_ESTIMATOR can be used.
|
Creates an anchor for scripting.
The anchor's href is set to javascript:;
, based on the
expectation that listeners will be added to the anchor.
text | the anchor's text |
---|---|
asHtml | true to treat the specified text as html
|
Creates an anchor with its html and href (target URL) specified.
html | the anchor's html |
---|---|
href | the url to which it will link |
Creates an anchor with its html and href (target URL) specified.
html | the anchor's html |
---|---|
dir | the html's direction |
href | the url to which it will link |
Creates an anchor with its html and href (target URL) specified.
html | the anchor's html |
---|---|
directionEstimator | A DirectionEstimator object used for automatic
direction adjustment. For convenience,
DEFAULT_DIRECTION_ESTIMATOR can be used. |
href | the url to which it will link |
Creates an anchor with its text and href (target URL) specified.
text | the anchor's text |
---|---|
href | the url to which it will link |
Creates an anchor with its text and href (target URL) specified.
text | the anchor's text |
---|---|
dir | the text's direction |
href | the url to which it will link |
Creates an anchor with its text and href (target URL) specified.
text | the anchor's text |
---|---|
directionEstimator | A DirectionEstimator object used for automatic
direction adjustment. For convenience,
DEFAULT_DIRECTION_ESTIMATOR can be used. |
href | the url to which it will link |
Creates an anchor with its text and href (target URL) specified.
text | the anchor's text |
---|---|
asHTML | true to treat the specified text as html |
href | the url to which it will link |
Creates a source anchor (link to URI). That is, an anchor with an href attribute specifying the destination URI.
html | the anchor's html |
---|---|
href | the url to which it will link |
target | the target frame (e.g. "_blank" to open the link in a new window) |
Creates a source anchor with a frame target.
text | the anchor's text |
---|---|
href | the url to which it will link |
target | the target frame (e.g. "_blank" to open the link in a new window) |
Creates a source anchor (link to URI). That is, an anchor with an href attribute specifying the destination URI.
text | the anchor's text |
---|---|
asHtml | asHTML true to treat the specified text as html |
href | the url to which it will link |
target | the target frame (e.g. "_blank" to open the link in a new window) |
This constructor may be used by subclasses to explicitly use an existing element. This element must be an <a> element.
element | the element to be used |
---|
Gets the directionality of the widget.
RTL
if the directionality is right-to-left,
LTR
if the directionality is left-to-right, or
DEFAULT
if the directionality is not explicitly specified
Gets the horizontal alignment.
ALIGN_LEFT
,
ALIGN_CENTER
,
ALIGN_RIGHT
,
ALIGN_JUSTIFY
, or
null).
Gets the anchor's href (the url to which it links).
Gets the tab index.
Gets the anchor's target frame (the frame in which navigation will occur when the link is selected).
Gets the direction of this object's text.
Gets whether word-wrapping is enabled.
true
if word-wrapping is enabled.
Sets the widget's 'access key'. This key is used (in conjunction with a browser-specific modifier key) to automatically focus the widget.
key | the widget's access key |
---|
This method is deprecated.
Use setDirectionEstimator(boolean)
and / or pass explicit
direction to setText(String)
, setHTML(SafeHtml)
instead
Sets the directionality for a widget.
direction | RTL if the directionality should be set to right-to-left,
LTR if the directionality should be set to left-to-right
DEFAULT if the directionality should not be explicitly set
|
---|
Sets the DirectionEstimator
object.
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.
directionEstimator | The {code DirectionEstimator} to be set. null means turning off direction estimation.
|
---|
Toggles on / off direction estimation.
See note at setDirectionEstimator(DirectionEstimator)
.
enabled | Whether to enable direction estimation. If true ,
sets the DirectionEstimator object to a default
DirectionEstimator .
|
---|
Explicitly focus/unfocus this widget. Only one widget can have focus at a time, and the widget that does will receive all keyboard events.
focused | whether this widget should take focus or release it |
---|
Sets this object's contents via known-safe HTML.
The object will behave exactly the same as when a widget's
setHTML(String)
method is
invoked; however the SafeHtml
passed to this method observes the
contract that it can be used in an HTML context without causing unsafe
script execution. Thus, unlike
setHTML(String)
, using this
method cannot result in Cross-Site Scripting security vulnerabilities.
html | the object's new HTML, represented as a SafeHtml object
|
---|
Sets 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
using setText(String)
whenever possible.
html | the object's new HTML |
---|
Sets this object's html, also declaring its direction.
html | the object's new html |
---|---|
dir | the html's direction |
Sets the horizontal alignment.
Use null
to clear horizontal alignment, allowing it to be
determined by the standard HTML mechanisms such as inheritance and CSS
rules.
align | the horizontal alignment (
ALIGN_LEFT ,
ALIGN_CENTER ,
ALIGN_RIGHT ,
ALIGN_JUSTIFY ,
ALIGN_LOCALE_START , or
ALIGN_LOCALE_END ).
|
---|
Sets the anchor's href (the url to which it links).
href | the anchor's href |
---|
Sets 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 -1
will cause this widget to
be removed from the tab order.
index | the widget's tab index |
---|
Sets the anchor's target frame (the frame in which navigation will occur when the link is selected).
target | the target frame |
---|
Sets this object's text, also declaring its direction.
text | the object's new text |
---|---|
dir | the text's direction |
Sets whether word-wrapping is enabled.
wrap | true to enable word-wrapping.
|
---|
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 call
detachNow(Widget)
.
element | the element to be wrapped |
---|