GWT Tk 0.2.3

asquare.gwt.tk.client.ui
Class ExternalHyperLink

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by asquare.gwt.tk.client.ui.ExternalHyperLink
All Implemented Interfaces:
EventListener, HasHTML, HasText

public class ExternalHyperLink
extends Widget
implements HasText, HasHTML

An anchor linking to a page (or resource) external to the application. Clicking the hyperlink will result in the GWT application being unloaded unless you specify a target frame, window or "_blank".

Example usage

   new ExternalHyperLink("Google", "http://www.google.com");
   new ExternalHyperLink("Go to <b>Google</b>", true, "http://www.google.com", "contentFrame");
   new ExternalHyperLink("More info", false, "moreInfo.html", ExternalHyperLink.TARGET_BLANK);
   new ExternalHyperLink("Email us for more info", "mailto:sales@example.com");
 

CSS Style Rules


Field Summary
static String TARGET_BLANK
          Specify this target to open the linked location in a new window.
static String TARGET_PARENT
          Specify this target to open the linked location in this frame's parent frame.
static String TARGET_SELF
          Specify this target to open the linked location in this frame.
static String TARGET_TOP
          Specify this target to open the linked location in the root frame.
 
Constructor Summary
ExternalHyperLink(String text, boolean asHtml, String url, String target)
          Constructs a new ExternalHyperLink
ExternalHyperLink(String text, String url)
          Constructs a new ExternalHyperLink
 
Method Summary
 String getHTML()
           
 String getTarget()
          Get the target frame or window in which the link will open.
 String getText()
           
 String getUrl()
          Get the url which the link will open.
 void setHTML(String html)
           
 void setTarget(String target)
          Set the target frame or window in which the link will open.
 void setText(String text)
           
 void setUrl(String url)
          Set the url which the link will open.
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
getParent, isAttached, onAttach, onBrowserEvent, onDetach, onLoad, removeFromParent
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleName, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, getTitle, isVisible, isVisible, removeStyleName, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TARGET_BLANK

public static final String TARGET_BLANK
Specify this target to open the linked location in a new window.

See Also:
Constant Field Values

TARGET_PARENT

public static final String TARGET_PARENT
Specify this target to open the linked location in this frame's parent frame.

See Also:
Constant Field Values

TARGET_SELF

public static final String TARGET_SELF
Specify this target to open the linked location in this frame.

See Also:
Constant Field Values

TARGET_TOP

public static final String TARGET_TOP
Specify this target to open the linked location in the root frame.

See Also:
Constant Field Values
Constructor Detail

ExternalHyperLink

public ExternalHyperLink(String text,
                         String url)
Constructs a new ExternalHyperLink

Parameters:
text - a String to display in the link
url - the url the link will open

ExternalHyperLink

public ExternalHyperLink(String text,
                         boolean asHtml,
                         String url,
                         String target)
Constructs a new ExternalHyperLink

Parameters:
text - a String to display in the link
asHtml - true to treat text as HTML, false to treat text as plain text
url - the url the link will open
target - the case-sensitive name of a target frame or window, or one of the reserved target constants
Method Detail

getUrl

public String getUrl()
Get the url which the link will open.


setUrl

public void setUrl(String url)
Set the url which the link will open.


getTarget

public String getTarget()
Get the target frame or window in which the link will open.


setTarget

public void setTarget(String target)
Set the target frame or window in which the link will open.

Parameters:
target - the case-sensitive name of a target frame or window, or one of the reserved target constants

getText

public String getText()
Specified by:
getText in interface HasText

setText

public void setText(String text)
Specified by:
setText in interface HasText

getHTML

public String getHTML()
Specified by:
getHTML in interface HasHTML

setHTML

public void setHTML(String html)
Specified by:
setHTML in interface HasHTML

GWT Tk 0.2.3

© 2007 Mat Gessel