Spec-Zone .ru
спецификации, руководства, описания, API
001/*
002 * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004 *
005 * This code is free software; you can redistribute it and/or modify it
006 * under the terms of the GNU General Public License version 2 only, as
007 * published by the Free Software Foundation.  Oracle designates this
008 * particular file as subject to the "Classpath" exception as provided
009 * by Oracle in the LICENSE file that accompanied this code.
010 *
011 * This code is distributed in the hope that it will be useful, but WITHOUT
012 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014 * version 2 for more details (a copy is included in the LICENSE file that
015 * accompanied this code).
016 *
017 * You should have received a copy of the GNU General Public License version
018 * 2 along with this work; if not, write to the Free Software Foundation,
019 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020 *
021 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
022 * or visit www.oracle.com if you need additional information or have any
023 * questions.
024 */
025
026package javafx.css;
027
028import java.util.List;
029
030import javafx.collections.ObservableList;
031import javafx.collections.ObservableSet;
032
033/** 
034 * Styleable comprises the minimal interface required for an object to be 
035 * styled by CSS.
036 */
037public interface Styleable { 
038
039    /** 
040     * The type of this {@code Styleable} that is to be used in selector matching. 
041     * This is analogous to an "element" in HTML. 
042     * (<a href="http://www.w3.org/TR/CSS2/selector.html#type-selectors">CSS Type Selector</a>). 
043     */ 
044    String getTypeSelector(); 
045
046    /** 
047     * The id of this {@code Styleable}. This simple string identifier is useful for 
048     * finding a specific Node within the scene graph. While the id of a Node 
049     * should be unique within the scene graph, this uniqueness is not enforced. 
050     * This is analogous to the "id" attribute on an HTML element 
051     * (<a href="http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier">CSS ID Specification</a>). 
052     * <p> 
053     * For example, if a Node is given the id of "myId", then the lookup method can 
054     * be used to find this node as follows: <code>scene.lookup("#myId");</code>. 
055     * </p> 
056     */ 
057    String getId(); 
058
059    /** 
060     * A list of String identifiers which can be used to logically group 
061     * Nodes, specifically for an external style engine. This variable is 
062     * analogous to the "class" attribute on an HTML element and, as such, 
063     * each element of the list is a style class to which this Node belongs. 
064     * 
065     * @see <a href="http://www.w3.org/TR/css3-selectors/#class-html">CSS3 class selectors</a> 
066     */ 
067   ObservableList<String> getStyleClass(); 
068
069    /** 
070     * A string representation of the CSS style associated with this 
071     * specific {@code Node}. This is analogous to the "style" attribute of an 
072     * HTML element. Note that, like the HTML style attribute, this 
073     * variable contains style properties and values and not the 
074     * selector portion of a style rule. 
075     */ 
076   String getStyle(); 
077     
078    /**
079     * The CssMetaData of this Styleable. This may be returned as
080     * an unmodifiable list.
081     *
082     */
083     
084    List<CssMetaData<? extends Styleable, ?>> getCssMetaData(); 
085            
086    /** 
087     * Return the parent of this Styleable, or null if there is no parent. 
088     */ 
089    Styleable getStyleableParent();
090
091    /**
092     * Return the pseudo-class state of this Styleable. CSS assumes this set is read-only.
093     */
094    ObservableSet<PseudoClass> getPseudoClassStates();
095     
096}