public class Hyperlink extends ButtonBase
An HTML like label which can be a graphic and/or text which responds to rollovers and clicks.
When a hyperlink is clicked/pressed isVisited()
becomes true
. A Hyperlink behaves
just like a Button
. When a hyperlink is pressed and released
a ActionEvent
is sent, and your application can perform some action based on this event.
Example:
Hyperlink link = new Hyperlink("www.oracle.com");
Type | Property and Description |
---|---|
BooleanProperty |
visited
Indicates whether this link has already been "visited".
|
armedProperty, onActionProperty
alignmentProperty, contentDisplayProperty, ellipsisStringProperty, fontProperty, graphicProperty, graphicTextGapProperty, labelPaddingProperty, lineSpacingProperty, mnemonicParsingProperty, textAlignmentProperty, textFillProperty, textOverrunProperty, textProperty, underlineProperty, wrapTextProperty
contextMenuProperty, skinClassNameProperty, skinProperty, tooltipProperty
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
DEFAULT_STYLE_CLASS
*
Stylesheet Handling *
*
|
private static PseudoClass |
PSEUDO_CLASS_VISITED |
private BooleanProperty |
visited |
Constructor and Description |
---|
Hyperlink()
Creates a hyperlink with no label.
|
Hyperlink(java.lang.String text)
Create a hyperlink with the specified text as its label.
|
Hyperlink(java.lang.String text,
Node graphic)
Create a hyperlink with the specified text and graphic as its label.
|
Modifier and Type | Method and Description |
---|---|
protected Skin<?> |
createDefaultSkin()
Create a new instance of the default skin for this control.
|
void |
fire()
Implemented to invoke the
ActionEvent if one is defined. |
protected Cursor |
getInitialCursor()
Returns the initial cursor state of this control, for use
by the JavaFX CSS engine to correctly set its initial value.
|
private void |
initialize() |
boolean |
isVisited()
Gets the value of the property visited.
|
java.lang.Object |
queryAccessibleAttribute(AccessibleAttribute attribute,
java.lang.Object... parameters) |
void |
setVisited(boolean value)
Sets the value of the property visited.
|
BooleanProperty |
visitedProperty()
Indicates whether this link has already been "visited".
|
arm, armedProperty, disarm, executeAccessibleAction, getOnAction, isArmed, onActionProperty, setOnAction
alignmentProperty, contentDisplayProperty, ellipsisStringProperty, fontProperty, getAlignment, getClassCssMetaData, getContentBias, getContentDisplay, getControlCssMetaData, getEllipsisString, getFont, getGraphic, getGraphicTextGap, getInitialAlignment, getLabelPadding, getLineSpacing, getText, getTextAlignment, getTextFill, getTextOverrun, graphicProperty, graphicTextGapProperty, isMnemonicParsing, isUnderline, isWrapText, labelPaddingProperty, lineSpacingProperty, mnemonicParsingProperty, setAlignment, setContentDisplay, setEllipsisString, setFont, setGraphic, setGraphicTextGap, setLineSpacing, setMnemonicParsing, setText, setTextAlignment, setTextFill, setTextOverrun, setUnderline, setWrapText, textAlignmentProperty, textFillProperty, textOverrunProperty, textProperty, toString, underlineProperty, wrapTextProperty
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, getBaselineOffset, getContextMenu, getControlChildren, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, layoutChildren, loadSkinClass, setContextMenu, setSkin, setTooltip, skinClassNameProperty, skinProperty, tooltipProperty
public final BooleanProperty visitedProperty
isVisited()
,
setVisited(boolean)
private BooleanProperty visited
private static final java.lang.String DEFAULT_STYLE_CLASS
private static final PseudoClass PSEUDO_CLASS_VISITED
public Hyperlink()
public Hyperlink(java.lang.String text)
text
- A text string for its label.public Hyperlink(java.lang.String text, Node graphic)
text
- A text string for its label.graphic
- A graphic for its labelprivate void initialize()
public final BooleanProperty visitedProperty()
isVisited()
,
setVisited(boolean)
public final void setVisited(boolean value)
public final boolean isVisited()
public void fire()
ActionEvent
if one is defined. This
function will also setVisited(boolean)
to true.fire
in class ButtonBase
protected Skin<?> createDefaultSkin()
-fx-skin
or set explicitly in a sub-class with setSkin(...)
.createDefaultSkin
in class Control
protected Cursor getInitialCursor()
public java.lang.Object queryAccessibleAttribute(AccessibleAttribute attribute, java.lang.Object... parameters)
queryAccessibleAttribute
in class Control