|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WLink
public class WLink
A value class that defines a hyperlink target.
This class abstracts a link target. Depending on the context, it may
reference a URL, a dynamic resource, or (for certain
usages) an internal path.
WAnchor,
WImage,
WMediaPlayer,
WPopupMenuItem,
WPushButton| Nested Class Summary | |
|---|---|
static class |
WLink.Type
An enumeration for a link type. |
| Constructor Summary | |
|---|---|
WLink()
Default constructor. |
|
WLink(java.lang.String url)
Creates a link to a (static) URL. |
|
WLink(WLink.Type type,
java.lang.String value)
Creates a link to a (static) URL or an internal path. |
|
WLink(WResource resource)
Creates a link to a resource. |
|
| Method Summary | |
|---|---|
boolean |
equals(WLink other)
Indicates whether some other object is "equal to" this one. |
java.lang.String |
getInternalPath()
Returns the internal path. |
WResource |
getResource()
Returns the link resource. |
WLink.Type |
getType()
Returns the link type. |
java.lang.String |
getUrl()
Returns the link URL. |
boolean |
isNull()
Returns whether the link is unspecified. |
void |
setInternalPath(java.lang.String internalPath)
Sets the link internal path. |
void |
setResource(WResource resource)
Sets the link resource. |
void |
setUrl(java.lang.String url)
Sets the link URL. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WLink()
This constructs a null link.
public WLink(java.lang.String url)
setUrl(String url)
public WLink(WLink.Type type,
java.lang.String value)
Using this constructor, you can create a link to a static URL (
type == WLink.Type.Url) or an internal path (
type == WLink.Type.InternalPath). For an internal
path, the value will be interpreted as a UTF8 encoded
string.
setUrl(String url),
setInternalPath(String internalPath)public WLink(WResource resource)
setResource(WResource resource)| Method Detail |
|---|
public WLink.Type getType()
The type is implicitly set depending on the constructor or after calling
setUrl(),
setResource() or
setInternalPath().
The default type for a null link is WLink.Type.Url.
public boolean isNull()
A null link is a link created using the default constructor and points to nowhere.
WLink()public void setUrl(java.lang.String url)
This sets the type to WLink.Type.Url.
public java.lang.String getUrl()
The return value is the URL set by setUrl(), the resource URL of the resource set using
setResource(), or the
canonical URL of an internal path within the current application context.
public void setResource(WResource resource)
This sets the type to WLink.Type.Resource.
public WResource getResource()
This returns the resource previously set using
setResource(), or
null.
setResource(WResource resource)public void setInternalPath(java.lang.String internalPath)
This points the link to the given internal path.
public java.lang.String getInternalPath()
This returns the internal path perviously set using
setInternalPath(), or
an empty string otherwise.
setInternalPath(String internalPath)public boolean equals(WLink other)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||