public class Anchor extends Widget
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabledDEBUG_ID_PREFIX| Constructor and Description |
|---|
Anchor()
Create an empty <a tag.
|
Anchor(String href,
String text)
Create a new <a tag, with properly escaped contents.
|
Anchor(String href,
String text,
String target)
Create a new <a tag, with properly escaped contents.
|
Anchor(String href,
String text,
String target,
boolean forceProtocol)
Create a new <a tag, with properly escaped contents.
|
| Modifier and Type | Method and Description |
|---|---|
void |
setFrameTarget(String target)
Sets the frame target for this anchor.
|
void |
setHref(String href)
Set the href location.
|
void |
setHTML(String html)
Sets this anchor's text as raw HTML.
|
void |
setText(String text)
Set the inner text.
|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, fireEvent, getLayoutData, getParent, isAttached, onBrowserEvent, removeFromParent, setLayoutData, sinkEventsaddStyleDependentName, 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, sinkBitlessEvent, toString, unsinkEventspublic Anchor(String href, String text, String target, boolean forceProtocol)
href - the href attribute for the tag.text - the inner text of this tag. It will have all of its HTML entities escaped
automatically.target - the frame target of the anchor.forceProtocol - If true, http:// will be prepended if not already existing.
This also has the effect of killing malicious "javascript:" links. It's a good idea to
make this 'true' when displaying user specified URLs.public Anchor(String href, String text, String target)
href - the href attribute for the tag.text - the inner text of this tag. It will have all of its HTML entities escaped
automatically.target - the frame target of the anchor.public Anchor(String href, String text)
href - the href attribute for the tag.text - the inner text of this tag. It will have all of its HTML entities escaped
automatically.public Anchor()
public void setHref(String href)
public void setText(String text)
public void setHTML(String html)
public void setFrameTarget(String target)
Copyright © 2013. All Rights Reserved.