Package org.jdesktop.swingx.hyperlink
Class LinkModel
java.lang.Object
org.jdesktop.swingx.hyperlink.LinkModel
- All Implemented Interfaces:
Comparable
An bean which represents an URL link.
Text, URL and visited are bound properties. Compares by Text.
- Author:
- Mark Davidson, Jeanette Winzenburg
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
int
boolean
protected void
firePropertyChange
(String property, boolean oldValue, boolean newValue) protected void
firePropertyChange
(String property, Object oldValue, Object newValue) Return the target for the URL.getText()
getURL()
boolean
int
hashCode()
void
void
Set the target that the URL should load into.void
Set the display text.void
Set the url and resets the visited flag.void
setURLString
(String howToURLString) void
setVisited
(boolean visited) Sets a flag to indicate if the link has been visited.toString()
-
Field Details
-
VISITED_PROPERTY
- See Also:
-
-
Constructor Details
-
LinkModel
- Parameters:
text
-target
-url
-
-
LinkModel
public LinkModel() -
LinkModel
-
LinkModel
- Parameters:
text
- text to that a renderer would displaytarget
- the target that a URL should load into.template
- a string that represents a URL with &{N} place holders for string substitutionargs
- an array of strings which will be used for substitition
-
-
Method Details
-
setText
Set the display text. -
getText
-
setURLString
-
setURL
Set the url and resets the visited flag. Think: keep list of visited urls here? -
getURL
-
setTarget
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
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() -
addPropertyChangeListener
-
removePropertyChangeListener
-
firePropertyChange
-
firePropertyChange
-
compareTo
- Specified by:
compareTo
in interfaceComparable
-
equals
-
hashCode
public int hashCode() -
toString
-