org.jdesktop.swing.data
Class Link

java.lang.Object
  extended byorg.jdesktop.swing.data.Link
All Implemented Interfaces:
Comparable

public class Link
extends Object
implements Comparable

An object which represents an URL link in a table cell, tree cell or list item.


Constructor Summary
Link(String text, String target, String template, String[] args)
           
Link(String text, String target, URL url)
           
 
Method Summary
 int compareTo(Object obj)
           
 boolean equals(Object obj)
           
 String getTarget()
          Return the target for the URL.
 String getText()
           
 URL getURL()
           
 boolean getVisited()
           
 int hashCode()
           
 void setTarget(String target)
          Set the target that the URL should load into.
 void setText(String text)
          Set the display text.
 void setURL(URL url)
          Set the url.
 void setVisited(boolean visited)
          Sets a flag to indicate if the link has been visited.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Link

public Link(String text,
            String target,
            URL url)

Link

public Link(String text,
            String target,
            String template,
            String[] args)
Parameters:
text - text to that a renderer would display
target - the target that a URL should load into.
template - a string that represents a URL with @{N} place holders for string substitution
args - an array of strings which will be used for substitition
Method Detail

setText

public void setText(String text)
Set the display text.


getText

public String getText()

setURL

public void setURL(URL url)
Set the url.


getURL

public URL getURL()

setTarget

public void setTarget(String target)
Set the target that the URL should load into. This can be a uri representing another control or the name of a window or special targets. See: http://www.w3c.org/TR/html401/present/frames.html#adef-target


getTarget

public String getTarget()
Return the target for the URL.

Returns:
value of the target. If null then "_blank" will be returned.

setVisited

public void setVisited(boolean visited)
Sets a flag to indicate if the link has been visited. The state of this flag can be used to render the color of the link.


getVisited

public boolean getVisited()

compareTo

public int compareTo(Object obj)
Specified by:
compareTo in interface Comparable

equals

public boolean equals(Object obj)

hashCode

public int hashCode()

toString

public String toString()


Copyright 2004 by Sun Microsystems, Inc. All Rights Reserved.