public class LinkModel extends Object implements Comparable
Modifier and Type | Field and Description |
---|---|
private static URL |
defaultURL |
private static String |
defaultURLString |
private static Logger |
LOG |
private PropertyChangeSupport |
propertyChangeSupport |
private String |
target |
private String |
text |
private URL |
url |
private boolean |
visited |
static String |
VISITED_PROPERTY |
Constructor and Description |
---|
LinkModel() |
LinkModel(String text) |
LinkModel(String text,
String target,
String template,
String[] args) |
LinkModel(String text,
String target,
URL url) |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener l) |
int |
compareTo(Object obj) |
private URL |
createURL(String template,
String[] args)
Create a URL from a template string that has place holders and an array
of strings which will be substituted into the place holders.
|
boolean |
equals(Object obj) |
protected void |
firePropertyChange(String property,
boolean oldValue,
boolean newValue) |
protected void |
firePropertyChange(String property,
Object oldValue,
Object newValue) |
private URL |
getDefaultURL() |
private PropertyChangeSupport |
getPropertyChangeSupport() |
String |
getTarget()
Return the target for the URL.
|
String |
getText() |
URL |
getURL() |
boolean |
getVisited() |
int |
hashCode() |
void |
removePropertyChangeListener(PropertyChangeListener l) |
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 and resets the visited flag.
|
void |
setURLString(String howToURLString) |
void |
setVisited(boolean visited)
Sets a flag to indicate if the link has been visited.
|
String |
toString() |
private boolean visited
private PropertyChangeSupport propertyChangeSupport
public static final String VISITED_PROPERTY
private static String defaultURLString
private static URL defaultURL
public LinkModel()
public LinkModel(String text, String target, String template, String[] args)
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 substititionpublic void setURLString(String howToURLString)
private URL getDefaultURL()
public void setURL(URL url)
private URL createURL(String template, String[] args)
template
- a url string that contains the placeholdersargs
- an array of strings that will be substitutedpublic void setTarget(String target)
public String getTarget()
public void setVisited(boolean visited)
public boolean getVisited()
public void addPropertyChangeListener(PropertyChangeListener l)
public void removePropertyChangeListener(PropertyChangeListener l)
protected void firePropertyChange(String property, Object oldValue, Object newValue)
protected void firePropertyChange(String property, boolean oldValue, boolean newValue)
private PropertyChangeSupport getPropertyChangeSupport()
public int compareTo(Object obj)
compareTo
in interface Comparable
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses