|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.inet.html.css.Selector
public class Selector
Combines all Information about a selector and provides a comparator to compare separator priorities.
level 1: http://www.w3.org/TR/REC-CSS1
,
level 2: http://www.w3.org/TR/REC-CSS2
Field Summary | |
---|---|
static com.inet.html.css.Selector.Comparator |
COMPARATOR
|
Constructor Summary | |
---|---|
Selector(java.lang.String selectorString,
javax.swing.text.AttributeSet rule,
int index)
Creates a selector object from a single selector string |
Method Summary | |
---|---|
int |
compareTo(Selector o)
|
int |
getIndex()
Returns the index which was set in the constructor |
int |
getLevelTotal()
This value is the calculated weight of this selector in a base 256 numeric value |
HTML.Tag |
getMatchedTag()
Get the tag if this selector has only a single HTML tag |
HTML.Tag |
getPrimaryTag()
Returns the tag matched by the highest tag part of the selector. |
javax.swing.text.AttributeSet |
getRule()
Returns the rule referenced by this selector |
boolean |
isAbsolutByElement()
Returns true, if the match of this selector can be decided by only the toplevel element |
boolean |
isAbsolutByTag()
Returns true, if the match of this selector can be decided by only the tag of the toplevel element |
boolean |
isUnversalTagOnly()
Check if the selector is "*". |
boolean |
matches(javax.swing.text.Element targetElement)
Performes the selector matching. |
void |
setSourceClass(java.lang.Object className)
Modifies the class selector of the highest selector part to require a certain class as well. |
java.lang.String |
toExternal()
Creates a CSS conform string of this selector |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final com.inet.html.css.Selector.Comparator COMPARATOR
Constructor Detail |
---|
public Selector(java.lang.String selectorString, javax.swing.text.AttributeSet rule, int index)
selectorString
- input stringrule
- Attributes referenced by this selectorindex
- the index of this selector. The index has to be unique throughout the whole document!Method Detail |
---|
public int getLevelTotal()
public int getIndex()
public HTML.Tag getMatchedTag()
public boolean isUnversalTagOnly()
public boolean matches(javax.swing.text.Element targetElement)
targetElement
- the current Elment that should match
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toExternal()
public javax.swing.text.AttributeSet getRule()
public boolean isAbsolutByElement()
public boolean isAbsolutByTag()
public int compareTo(Selector o)
compareTo
in interface java.lang.Comparable<Selector>
public void setSourceClass(java.lang.Object className)
className
- the class namepublic HTML.Tag getPrimaryTag()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |