public class StateSelector extends java.lang.Object implements Selector
Equivalent to pseudo-class (eg. :active
) selector in CSS. Its specificity is (0,0,1,0).
Widget.isInState(int)
,
SelectorHelper
Constructor and Description |
---|
StateSelector(int state)
Creates a state selector with one state.
|
Modifier and Type | Method and Description |
---|---|
boolean |
appliesToWidget(Widget widget)
Checks whether or not this selector applies to the given widget.
|
boolean |
equals(java.lang.Object obj) |
int |
getSpecificity()
Returns the specificity of this selector.
|
int |
hashCode() |
public StateSelector(int state)
state
- the state.public boolean appliesToWidget(Widget widget)
Selector
appliesToWidget
in interface Selector
widget
- the widget to test.true
if this selectors applies to the given widget, false
otherwise.public int getSpecificity()
Selector
The specificity allows to determine in which order the rules of a stylesheet should be applied.
A specificity is composed of four numbers (defined by CSS2 specification):
SelectorHelper
provides a method to
compute the specificity of a selector.getSpecificity
in interface Selector
public boolean equals(@Nullable java.lang.Object obj)
public int hashCode()
hashCode
in class java.lang.Object