/* * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package javafx.css; import java.util.List; import javafx.collections.ObservableList; import javafx.collections.ObservableSet; /** * Styleable comprises the minimal interface required for an object to be styled by CSS. * @see CSS Reference Guide. * @since JavaFX 8.0 */ public interface Styleable { /** * The type of this {@code Styleable} that is to be used in selector matching. * This is analogous to an "element" in HTML. * (CSS Type Selector). */ String getTypeSelector(); /** * The id of this {@code 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");. *

*/ String getId(); /** * 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. * * @see CSS3 class selectors */ ObservableList getStyleClass(); /** * A string representation of the CSS style associated with this * specific {@code 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. */ String getStyle(); /** * The CssMetaData of this Styleable. This may be returned as * an unmodifiable list. * */ List> getCssMetaData(); /** * Return the parent of this Styleable, or null if there is no parent. */ Styleable getStyleableParent(); /** * Return the pseudo-class state of this Styleable. CSS assumes this set is read-only. */ ObservableSet getPseudoClassStates(); }