|
GWT 2.0.3 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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
public class Anchor
A widget that represents a simple <a> element.
If you want use this anchor only for changing history states, use
Hyperlink
instead.
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.user.client.ui.HasHorizontalAlignment |
---|
HasHorizontalAlignment.HorizontalAlignmentConstant |
Nested classes/interfaces inherited from interface com.google.gwt.i18n.client.HasDirection |
---|
HasDirection.Direction |
Field Summary |
---|
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Fields inherited from interface com.google.gwt.user.client.ui.HasHorizontalAlignment |
---|
ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_LEFT, ALIGN_RIGHT |
Constructor Summary | |
---|---|
|
Anchor()
Creates an empty anchor. |
protected |
Anchor(Element element)
This constructor may be used by subclasses to explicitly use an existing element. |
|
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,
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 | |
---|---|
HasDirection.Direction |
getDirection()
Gets the directionality of the widget. |
HasHorizontalAlignment.HorizontalAlignmentConstant |
getHorizontalAlignment()
Gets the horizontal alignment. |
java.lang.String |
getHref()
Gets the anchor's href (the url to which it links). |
java.lang.String |
getHTML()
Gets this object's contents as HTML. |
java.lang.String |
getName()
Gets the widget's name. |
int |
getTabIndex()
Gets the tab index. |
java.lang.String |
getTarget()
Gets the anchor's target frame (the frame in which navigation will occur when the link is selected). |
java.lang.String |
getText()
Gets this object's text. |
boolean |
getWordWrap()
Gets whether word-wrapping is enabled. |
void |
setAccessKey(char key)
Sets the widget's 'access key'. |
void |
setDirection(HasDirection.Direction direction)
Sets the directionality for a widget. |
void |
setFocus(boolean focused)
Explicitly focus/unfocus this widget. |
void |
setHorizontalAlignment(HasHorizontalAlignment.HorizontalAlignmentConstant align)
Sets the horizontal alignment. |
void |
setHref(java.lang.String href)
Sets the anchor's href (the url to which it links). |
void |
setHTML(java.lang.String html)
Sets this object's contents via HTML. |
void |
setName(java.lang.String name)
Sets the widget's name. |
void |
setTabIndex(int index)
Sets the widget's position in the tab index. |
void |
setTarget(java.lang.String target)
Sets the anchor's target frame (the frame in which navigation will occur when the link is selected). |
void |
setText(java.lang.String text)
Sets this object's text. |
void |
setWordWrap(boolean wrap)
Sets whether word-wrapping is enabled. |
static Anchor |
wrap(Element element)
Creates an Anchor widget that wraps an existing <a> element. |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
addDomHandler, addHandler, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents |
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, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents |
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 |
---|
public Anchor()
public Anchor(java.lang.String text)
javascript:;
, based on the
expectation that listeners will be added to the anchor.
text
- the anchor's textpublic Anchor(java.lang.String text, boolean asHtml)
javascript:;
, based on the
expectation that listeners will be added to the anchor.
text
- the anchor's textasHtml
- true
to treat the specified text as htmlpublic Anchor(java.lang.String text, boolean asHTML, java.lang.String href)
text
- the anchor's textasHTML
- true
to treat the specified text as htmlhref
- the url to which it will linkpublic Anchor(java.lang.String text, boolean asHtml, java.lang.String href, java.lang.String target)
text
- the anchor's textasHtml
- asHTML true
to 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)public Anchor(java.lang.String text, java.lang.String href)
text
- the anchor's texthref
- the url to which it will linkpublic Anchor(java.lang.String text, java.lang.String href, java.lang.String target)
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)protected Anchor(Element element)
element
- the element to be usedMethod Detail |
---|
public static Anchor wrap(Element element)
RootPanel.detachNow(Widget)
.
element
- the element to be wrappedpublic HasDirection.Direction getDirection()
HasDirection
getDirection
in interface HasDirection
RTL
if the directionality is right-to-left,
LTR
if the directionality is left-to-right, or
DEFAULT
if the directionality is not explicitly specifiedpublic HasHorizontalAlignment.HorizontalAlignmentConstant getHorizontalAlignment()
HasHorizontalAlignment
getHorizontalAlignment
in interface HasHorizontalAlignment
public java.lang.String getHref()
public java.lang.String getHTML()
HasHTML
getHTML
in interface HasHTML
public java.lang.String getName()
HasName
getName
in interface HasName
public int getTabIndex()
FocusWidget
getTabIndex
in interface Focusable
getTabIndex
in class FocusWidget
public java.lang.String getTarget()
public java.lang.String getText()
HasText
getText
in interface HasText
public boolean getWordWrap()
HasWordWrap
getWordWrap
in interface HasWordWrap
true
if word-wrapping is enabled.public void setAccessKey(char key)
Focusable
setAccessKey
in interface Focusable
setAccessKey
in class FocusWidget
key
- the widget's access keypublic void setDirection(HasDirection.Direction direction)
HasDirection
setDirection
in interface HasDirection
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 setpublic void setFocus(boolean focused)
Focusable
setFocus
in interface Focusable
setFocus
in class FocusWidget
focused
- whether this widget should take focus or release itpublic void setHorizontalAlignment(HasHorizontalAlignment.HorizontalAlignmentConstant align)
HasHorizontalAlignment
setHorizontalAlignment
in interface HasHorizontalAlignment
align
- the horizontal alignment (
HasHorizontalAlignment.ALIGN_LEFT
,
HasHorizontalAlignment.ALIGN_CENTER
,
HasHorizontalAlignment.ALIGN_RIGHT
), or
HasHorizontalAlignment.ALIGN_DEFAULT
).public void setHref(java.lang.String href)
href
- the anchor's hrefpublic void setHTML(java.lang.String html)
HasHTML
HasText.setText(String)
whenever possible.
setHTML
in interface HasHTML
html
- the object's new HTMLpublic void setName(java.lang.String name)
HasName
setName
in interface HasName
name
- the widget's new namepublic void setTabIndex(int index)
Focusable
-1
will cause this widget to
be removed from the tab order.
setTabIndex
in interface Focusable
setTabIndex
in class FocusWidget
index
- the widget's tab indexpublic void setTarget(java.lang.String target)
target
- the target framepublic void setText(java.lang.String text)
HasText
setText
in interface HasText
text
- the object's new textpublic void setWordWrap(boolean wrap)
HasWordWrap
setWordWrap
in interface HasWordWrap
wrap
- true
to enable word-wrapping.
|
GWT 2.0.3 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |