Interface Styleable

All Known Implementing Classes:
com.sun.javafx.scene.AbstractNode, Accordion, AmbientLight, AnchorPane, Arc, AreaChart, Axis, BarChart, BorderPane, Box, BubbleChart, Button, ButtonBar, ButtonBase, Camera, Canvas, CategoryAxis, Cell, Chart, CheckBox, CheckBoxListCell, CheckBoxTableCell, CheckBoxTreeCell, CheckBoxTreeTableCell, CheckMenuItem, ChoiceBox, ChoiceBoxListCell, ChoiceBoxTableCell, ChoiceBoxTreeCell, ChoiceBoxTreeTableCell, Circle, ColorPicker, ComboBox, ComboBoxBase, ComboBoxListCell, ComboBoxTableCell, ComboBoxTreeCell, ComboBoxTreeTableCell, ContextMenu, Control, CubicCurve, CustomMenuItem, Cylinder, DateCell, DatePicker, DialogPane, DirectionalLight, Ellipse, FlowPane, GridPane, Group, HBox, HTMLEditor, Hyperlink, ImageView, IndexedCell, Label, Labeled, LightBase, Line, LineChart, ListCell, ListView, MediaView, Menu, MenuBar, MenuButton, MenuItem, MeshView, NestedTableColumnHeader, Node, NumberAxis, Pagination, Pane, ParallelCamera, Parent, PasswordField, Path, PerspectiveCamera, PieChart, PointLight, Polygon, Polyline, PopupControl, PopupControl.CSSBridge, ProgressBar, ProgressBarTableCell, ProgressBarTreeTableCell, ProgressIndicator, QuadCurve, RadioButton, RadioMenuItem, Rectangle, Region, ScatterChart, ScrollBar, ScrollPane, Separator, SeparatorMenuItem, Shape, Shape3D, Slider, Sphere, Spinner, SplitMenuButton, SplitPane, SpotLight, StackedAreaChart, StackedBarChart, StackPane, SubScene, SVGPath, SwingNode, Tab, TableCell, TableColumn, TableColumnBase, TableColumnHeader, TableHeaderRow, TableRow, TableView, TabPane, Text, TextArea, TextField, TextFieldListCell, TextFieldTableCell, TextFieldTreeCell, TextFieldTreeTableCell, TextFlow, TextInputControl, TilePane, TitledPane, ToggleButton, ToolBar, Tooltip, TreeCell, TreeTableCell, TreeTableColumn, TreeTableRow, TreeTableView, TreeView, ValueAxis, VBox, VirtualFlow, WebView, XYChart

public interface Styleable
Styleable comprises the minimal interface required for an object to be styled by CSS.
Since:
JavaFX 8.0
See Also:
  • Method Details

    • getTypeSelector

      String getTypeSelector()
      The type of this Styleable that is to be used in selector matching. This is analogous to an "element" in HTML. (CSS Type Selector).
      Returns:
      the type of this Styleable
    • getId

      String getId()
      The id of this Styleable. This simple string identifier is useful for finding a specific Node within the scene graph. While the id of a Node should be unique within the scene graph, this uniqueness is not enforced. This is analogous to the "id" attribute on an HTML element (CSS ID Specification).

      For example, if a Node is given the id of "myId", then the lookup method can be used to find this node as follows: scene.lookup("#myId");.

      Returns:
      the id of this Styleable
    • getStyleClass

      ObservableList<String> getStyleClass()
      A list of String identifiers which can be used to logically group Nodes, specifically for an external style engine. This variable is analogous to the "class" attribute on an HTML element and, as such, each element of the list is a style class to which this Node belongs.
      Returns:
      a list of String identifiers which can be used to logically group Nodes, specifically for an external style engine
      See Also:
    • getStyle

      String getStyle()
      A string representation of the CSS style associated with this specific Node. This is analogous to the "style" attribute of an HTML element. Note that, like the HTML style attribute, this variable contains style properties and values and not the selector portion of a style rule.
      Returns:
      a string representation of the CSS style associated with this specific Node
    • getCssMetaData

      List<CssMetaData<? extends Styleable,?>> getCssMetaData()
      The CssMetaData of this Styleable. This may be returned as an unmodifiable list.
      Returns:
      the CssMetaData
    • getStyleableParent

      Styleable getStyleableParent()
      Return the parent of this Styleable, or null if there is no parent.
      Returns:
      the parent of this Styleable, or null if there is no parent
    • getPseudoClassStates

      ObservableSet<PseudoClass> getPseudoClassStates()
      Return the pseudo-class state of this Styleable. CSS assumes this set is read-only.
      Returns:
      the pseudo-class state
    • getStyleableNode

      default Node getStyleableNode()
      Returns the Node that represents this Styleable object. This method should be overridden in cases where the Styleable is not itself a Node, so that it may optionally return the relevant root node representation of itself. By default this method returns null, which can mean that either the Styleable itself is a Node, or if that is not the case, that the Styleable does not have a node representation available at the time of request.
      Returns:
      the Node that represents this Styleable object
      Since:
      9