|
||||||||||
| 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.Hyperlink
public class Hyperlink
A widget that serves as an "internal" hyperlink. That is, it is a link to
another state of the running application. When clicked, it will create a new
history frame using History.newItem(java.lang.String), but
without reloading the page.
If you want an HTML hyperlink (<a> tag) without interacting with the
history system, use Anchor instead.
Being a true hyperlink, it is also possible for the user to "right-click, open link in new window", which will cause the application to be loaded in a new window at the state specified by the hyperlink.
Anchor| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
| Field Summary |
|---|
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
Hyperlink()
Creates an empty hyperlink. |
|
Hyperlink(java.lang.String text,
boolean asHTML,
java.lang.String targetHistoryToken)
Creates a hyperlink with its text and target history token specified. |
|
Hyperlink(java.lang.String text,
java.lang.String targetHistoryToken)
Creates a hyperlink with its text and target history token specified. |
|
| Method Summary | |
|---|---|
HandlerRegistration |
addClickHandler(ClickHandler handler)
Deprecated. Use FocusWidget.addClickHandler(com.google.gwt.event.dom.client.ClickHandler) instead and call
History.newItem from the handler if you need to process the
click before the history token is set. |
void |
addClickListener(ClickListener listener)
Deprecated. Use FocusWidget.addClickHandler(com.google.gwt.event.dom.client.ClickHandler) instead and call
History.newItem from the handler if you need to process the
click before the history token is set. |
java.lang.String |
getHTML()
Gets this object's contents as HTML. |
java.lang.String |
getTargetHistoryToken()
Gets the history token referenced by this hyperlink. |
java.lang.String |
getText()
Gets this object's text. |
void |
onBrowserEvent(Event event)
Fired whenever a browser event is received. |
void |
removeClickListener(ClickListener listener)
Deprecated. Use the HandlerRegistration.removeHandler()
method on the object returned by an add*Handler method instead |
void |
setHTML(java.lang.String html)
Sets this object's contents via HTML. |
void |
setTargetHistoryToken(java.lang.String targetHistoryToken)
Sets the history token referenced by this hyperlink. |
void |
setText(java.lang.String text)
Sets this object's text. |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
fireEvent, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
|---|
fireEvent |
| Constructor Detail |
|---|
public Hyperlink()
public Hyperlink(java.lang.String text,
boolean asHTML,
java.lang.String targetHistoryToken)
text - the hyperlink's textasHTML - true to treat the specified text as htmltargetHistoryToken - the history token to which it will linksetTargetHistoryToken(java.lang.String)
public Hyperlink(java.lang.String text,
java.lang.String targetHistoryToken)
text - the hyperlink's texttargetHistoryToken - the history token to which it will link, which
may not be null (use Anchor instead if you don't need history
processing)| Method Detail |
|---|
@Deprecated public HandlerRegistration addClickHandler(ClickHandler handler)
FocusWidget.addClickHandler(com.google.gwt.event.dom.client.ClickHandler) instead and call
History.newItem from the handler if you need to process the
click before the history token is set.
HasClickHandlersClickEvent handler.
addClickHandler in interface HasClickHandlershandler - the click handler
HandlerRegistration used to remove this handler@Deprecated public void addClickListener(ClickListener listener)
FocusWidget.addClickHandler(com.google.gwt.event.dom.client.ClickHandler) instead and call
History.newItem from the handler if you need to process the
click before the history token is set.
SourcesClickEvents
addClickListener in interface SourcesClickEventslistener - the listener interface to addpublic java.lang.String getHTML()
HasHTML
getHTML in interface HasHTMLpublic java.lang.String getTargetHistoryToken()
setTargetHistoryToken(java.lang.String)public java.lang.String getText()
HasText
getText in interface HasTextpublic void onBrowserEvent(Event event)
EventListener
onBrowserEvent in interface EventListeneronBrowserEvent in class Widgetevent - the event received@Deprecated public void removeClickListener(ClickListener listener)
HandlerRegistration.removeHandler()
method on the object returned by an add*Handler method instead
SourcesClickEvents
removeClickListener in interface SourcesClickEventslistener - the listener interface to removepublic void setHTML(java.lang.String html)
HasHTMLHasText.setText(String) whenever possible.
setHTML in interface HasHTMLhtml - the object's new HTMLpublic void setTargetHistoryToken(java.lang.String targetHistoryToken)
History.newItem(java.lang.String) when this link is
clicked.
targetHistoryToken - the new history token, which may not be null (use
Anchor instead if you don't need history processing)public void setText(java.lang.String text)
HasText
setText in interface HasTexttext - the object's new text
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||