java.lang.Object
org.jhotdraw8.css.model.AbstractSelectorModel<javafx.css.Styleable>
org.jhotdraw8.css.model.StyleableSelectorModel
- All Implemented Interfaces:
SelectorModel<javafx.css.Styleable>
A
SelectorModel for objects that implement the Styleable
interface.- Author:
- Werner Randelshofer
-
Property Summary
Properties inherited from class org.jhotdraw8.css.model.AbstractSelectorModel
additionalPseudoClassStates -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanattributeValueContainsWord(@NonNull javafx.css.Styleable element, @Nullable String namespacePattern, @NonNull String attributeName, @NonNull String word) Returns true if the element has an attribute with the specified name and the value is a list of words which contains the specified word.getAttribute(@NonNull javafx.css.Styleable element, javafx.css.StyleOrigin origin, @Nullable String namespacePattern, @NonNull String attributeName) getAttributeAsString(@NonNull javafx.css.Styleable element, javafx.css.StyleOrigin origin, @Nullable String namespacePattern, @NonNull String name) getAttributeNames(@NonNull javafx.css.Styleable element) Returns all styleable attributes of the element.getComposedAttributeNames(@NonNull javafx.css.Styleable element) Returns all non-decomposed styleable attributes of the element.getDecomposedAttributeNames(@NonNull javafx.css.Styleable element) Returns all decomposed styleable attributes of the element.Returns the id of the element.javafx.css.StyleableGets the parent of the element.@Nullable javafx.css.StyleablegetPreviousSibling(@NonNull javafx.css.Styleable element) Gets the previous sibling of the element.getPseudoClasses(@NonNull javafx.css.Styleable element) Returns the pseudo classes of the element.getStyleClasses(@NonNull javafx.css.Styleable element) Returns the style classes of the element.Returns the style type of the element.booleanhasAttribute(@NonNull javafx.css.Styleable element, @Nullable String namespace, @NonNull String attributeName) Returns true if the element has the specified attribute.booleanReturns true if the element has the specified id.booleanhasPseudoClass(@NonNull javafx.css.Styleable element, @NonNull String pseudoClass) Returns true if the element has the specified pseudo class.booleanhasStyleClass(@NonNull javafx.css.Styleable element, @NonNull String clazz) Returns true if the element has the specified style class.booleanhasType(@NonNull javafx.css.Styleable element, @Nullable String namespacePattern, @NonNull String type) Returns true if the element has the specified type.voidreset(javafx.css.Styleable elem) Resets all values with non-StyleOrigin.USERorigin.voidsetAttribute(@NonNull javafx.css.Styleable elem, @NonNull javafx.css.StyleOrigin origin, @Nullable String namespace, @NonNull String name, @Nullable ReadOnlyList<CssToken> valueAsTokens) Sets an attribute value.Methods inherited from class org.jhotdraw8.css.model.AbstractSelectorModel
additionalPseudoClassStatesPropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jhotdraw8.css.model.SelectorModel
attributeValueContains, attributeValueEndsWith, attributeValueEquals, attributeValueStartsWith, getAttributeAsString
-
Constructor Details
-
StyleableSelectorModel
public StyleableSelectorModel()
-
-
Method Details
-
getAttributeAsString
-
hasId
Description copied from interface:SelectorModelReturns true if the element has the specified id.- Parameters:
element- An element of the documentid- an id- Returns:
- true if the element has the id
-
getId
Description copied from interface:SelectorModelReturns the id of the element.- Parameters:
element- the element- Returns:
- the id or null if the element does not have an id.
-
hasType
public boolean hasType(@NonNull javafx.css.Styleable element, @Nullable String namespacePattern, @NonNull String type) Description copied from interface:SelectorModelReturns true if the element has the specified type.- Parameters:
element- An element of the documentnamespacePattern- a namespace pattern ("*" means any namespace, null means no namespace)type- an id- Returns:
- true if the element has the id
-
reset
public void reset(javafx.css.Styleable elem) Description copied from interface:SelectorModelResets all values with non-StyleOrigin.USERorigin. -
getType
Description copied from interface:SelectorModelReturns the style type of the element.- Parameters:
element- the element- Returns:
- the style type of the element, return null if the element is not styleable by type.
-
hasStyleClass
Description copied from interface:SelectorModelReturns true if the element has the specified style class.- Parameters:
element- An element of the documentclazz- a style class- Returns:
- true if the element has the id
-
getStyleClasses
Description copied from interface:SelectorModelReturns the style classes of the element.- Parameters:
element- the element- Returns:
- the style classes or an empty set.
-
getPseudoClasses
Description copied from interface:SelectorModelReturns the pseudo classes of the element.- Parameters:
element- the element- Returns:
- the pseudo classes or an empty set.
-
hasPseudoClass
Description copied from interface:SelectorModelReturns true if the element has the specified pseudo class.- Parameters:
element- An element of the documentpseudoClass- a pseudo class- Returns:
- true if the element has the id
-
getParent
Description copied from interface:SelectorModelGets the parent of the element.- Parameters:
element- An element of the document- Returns:
- The parent element. Returns null if the element has no parent.
-
getPreviousSibling
Description copied from interface:SelectorModelGets the previous sibling of the element.- Parameters:
element- An element of the document- Returns:
- The previous sibling. Returns null if the element has no previous sibling.
-
hasAttribute
public boolean hasAttribute(@NonNull javafx.css.Styleable element, @Nullable String namespace, @NonNull String attributeName) Description copied from interface:SelectorModelReturns true if the element has the specified attribute.- Parameters:
element- An element of the documentnamespace- an optional namespace (null means any namespace , an empty String means no namespace)attributeName- an attribute name- Returns:
- true if the element has an attribute with the specified name
-
getAttribute
-
attributeValueContainsWord
public boolean attributeValueContainsWord(@NonNull javafx.css.Styleable element, @Nullable String namespacePattern, @NonNull String attributeName, @NonNull String word) Description copied from interface:SelectorModelReturns true if the element has an attribute with the specified name and the value is a list of words which contains the specified word.- Parameters:
element- An element of the documentnamespacePattern- an optional namespace ("*" means any namespace, null means no namespace)attributeName- an attribute nameword- the word- Returns:
- true if the element has an attribute with the specified name and the value contains the specified word.
-
getAttributeNames
Description copied from interface:SelectorModelReturns all styleable attributes of the element.- Parameters:
element- An element of the document- Returns:
- a set of styleable attributes.
-
getComposedAttributeNames
Description copied from interface:SelectorModelReturns all non-decomposed styleable attributes of the element.If an attribute can be decomposed, only the composite attribute is returned.
- Parameters:
element- An element of the document- Returns:
- a set of styleable attributes.
-
getDecomposedAttributeNames
public @NonNull Set<QualifiedName> getDecomposedAttributeNames(@NonNull javafx.css.Styleable element) Description copied from interface:SelectorModelReturns all decomposed styleable attributes of the element.If an attribute can be composed, only the decomposed attributes are returned.
- Parameters:
element- An element of the document- Returns:
- a set of styleable attributes.
-
setAttribute
public void setAttribute(@NonNull javafx.css.Styleable elem, @NonNull javafx.css.StyleOrigin origin, @Nullable String namespace, @NonNull String name, @Nullable ReadOnlyList<CssToken> valueAsTokens) Description copied from interface:SelectorModelSets an attribute value.- Parameters:
elem- The elementorigin- The style originnamespace- an optional namespace ("*" means any namespace, null means no namespace)name- The attribute namevalueAsTokens- The attribute value.nullremoves the attribute from the element. That is,nullhas the same effect like the keyword "unset".
-