< prev index next >

modules/javafx.controls/src/main/java/javafx/scene/control/Hyperlink.java

Print this page




  88     }
  89 
  90     private void initialize() {
  91         // Initialize the style class to be 'hyperlink'.
  92         getStyleClass().setAll(DEFAULT_STYLE_CLASS);
  93         setAccessibleRole(AccessibleRole.HYPERLINK);
  94         // cursor is styleable through css. Calling setCursor
  95         // makes it look to css like the user set the value and css will not
  96         // override. Initializing cursor by calling applyStyle with null
  97         // StyleOrigin ensures that css will be able to override the value.
  98         ((StyleableProperty<Cursor>)(WritableValue<Cursor>)cursorProperty()).applyStyle(null, Cursor.HAND);
  99     }
 100 
 101     /***************************************************************************
 102      *                                                                         *
 103      * Properties                                                              *
 104      *                                                                         *
 105      **************************************************************************/
 106     /**
 107      * Indicates whether this link has already been "visited".

 108      */
 109     public final BooleanProperty visitedProperty() {
 110         if (visited == null) {
 111             visited = new BooleanPropertyBase() {
 112                 @Override protected void invalidated() {
 113                     pseudoClassStateChanged(PSEUDO_CLASS_VISITED, get());
 114                 }
 115 
 116                 @Override
 117                 public Object getBean() {
 118                     return Hyperlink.this;
 119                 }
 120 
 121                 @Override
 122                 public String getName() {
 123                     return "visited";
 124                 }
 125             };
 126         }
 127         return visited;




  88     }
  89 
  90     private void initialize() {
  91         // Initialize the style class to be 'hyperlink'.
  92         getStyleClass().setAll(DEFAULT_STYLE_CLASS);
  93         setAccessibleRole(AccessibleRole.HYPERLINK);
  94         // cursor is styleable through css. Calling setCursor
  95         // makes it look to css like the user set the value and css will not
  96         // override. Initializing cursor by calling applyStyle with null
  97         // StyleOrigin ensures that css will be able to override the value.
  98         ((StyleableProperty<Cursor>)(WritableValue<Cursor>)cursorProperty()).applyStyle(null, Cursor.HAND);
  99     }
 100 
 101     /***************************************************************************
 102      *                                                                         *
 103      * Properties                                                              *
 104      *                                                                         *
 105      **************************************************************************/
 106     /**
 107      * Indicates whether this link has already been "visited".
 108      * @return true if this link has already been "visited"
 109      */
 110     public final BooleanProperty visitedProperty() {
 111         if (visited == null) {
 112             visited = new BooleanPropertyBase() {
 113                 @Override protected void invalidated() {
 114                     pseudoClassStateChanged(PSEUDO_CLASS_VISITED, get());
 115                 }
 116 
 117                 @Override
 118                 public Object getBean() {
 119                     return Hyperlink.this;
 120                 }
 121 
 122                 @Override
 123                 public String getName() {
 124                     return "visited";
 125                 }
 126             };
 127         }
 128         return visited;


< prev index next >