Package com.groiss.gui.component
Class Link
java.lang.Object
com.groiss.gui.AbstractComponent
com.groiss.gui.component.Link
- All Implemented Interfaces:
Component
,Serializable
,Cloneable
,Comparable<Object>
- Direct Known Subclasses:
SortableLink
A HTML link element (a).
Note: this class has a natural ordering that is inconsistent with equals,
There are cases where x.compareTo(y) is 0 and equals return false.
- See Also:
-
Field Summary
Fields inherited from class com.groiss.gui.AbstractComponent
ACTIVE, browserMode, DEFAULT, ID, IE, INVISIBLE, isSensitive, label, NS, ON_BLUR, ON_CHANGE, ON_CLICK, ON_DBLCLICK, ON_FOCUS, ON_KEY_DOWN, ON_KEY_PRESS, ON_KEY_UP, ON_LOAD, ON_MOUSE_DOWN, ON_MOUSE_MOVE, ON_MOUSE_OUT, ON_MOUSE_UP, ON_RESET, ON_SELECT, ON_SUBMIT, ON_UNLOAD, parent, parentElem, READONLY, root, viewMode
Fields inherited from interface com.groiss.gui.Component
LABELLEDBY
-
Constructor Summary
ConstructorDescriptionLink()
Constructs a new empty link.Deprecated.Constructor with text, url and target.Constructor with text, url, target, and style.Constructor with text, url, target, style, and id. -
Method Summary
Modifier and TypeMethodDescriptionaddContent
(Object... contents) int
Set the href attribute.getHref()
getText()
void
setContent
(Object o) Set the href attribute.void
sets the link urlvoid
sets the target where the link will openvoid
void
sets the textMethods inherited from class com.groiss.gui.AbstractComponent
addClass, clone, create, getAttribute, getBrowserMode, getId, getLabel, getName, getParent, getParentElement, getRoot, getRootName, getStyle, getViewMode, init, init, init, removeAttribute, removeClass, setActionListener, setAttribute, setBrowserMode, setClass, setEncoding, setExpandEmptyElements, setId, setIndenting, setLabel, setName, setNewLines, setParent, setParentElement, setRootName, setStyle, setViewMode, show, show, toggleClass, toString
-
Field Details
-
text
-
-
Constructor Details
-
Link
public Link()Constructs a new empty link. -
Link
-
Link
Deprecated.useLink(String)
.addContent(Object...)
instead- Parameters:
href
-contents
-
-
Link
-
Link
-
Link
-
Link
Constructor with text, url and target.- Parameters:
href
- the url of the linktext
- the description of the linktarget
- the target where the link will open
-
Link
Constructor with text, url, target, and style.- Parameters:
href
- the url of the linktext
- the description of the linktarget
- the target where the link will openstyleClass
- the name of a CSS class
-
Link
-
Link
Constructor with text, url, target, style, and id.- Parameters:
href
- the url of the linktext
- the description of the linktarget
- the target where the link will openstyleClass
- the name of a CSS classid
- the uniqe element id
-
-
Method Details
-
addContent
-
setHref
sets the link url- Parameters:
href
- the url
-
getHref
-
setText
sets the text- Parameters:
text
- - the text String
-
setText
-
getText
-
setTarget
sets the target where the link will open- Parameters:
target
- - the target
-
getTarget
-
setContent
Set the href attribute.- Specified by:
setContent
in interfaceComponent
- Overrides:
setContent
in classAbstractComponent
- Parameters:
o
- - any object where the string representation is used for rendering
-
getContent
Set the href attribute.- Specified by:
getContent
in interfaceComponent
- Overrides:
getContent
in classAbstractComponent
- Returns:
- the href attribute
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Object>
-
Link(String)
.addContent(Object...)
instead