|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.inet.html.css.NewStyleResolver
public class NewStyleResolver
The style resolver will handle all read operations on the current style sheets. It will fill the
temporary styles into the elements attribute sets and handle the access to these style informations.
NOTE: This class does not supervise it's internal style sheet objects! You are free to change them at any time,
but keep in mind that changing the stylesheets will not update the documents model.
Constructor Summary | |
---|---|
NewStyleResolver()
|
Method Summary | ||
---|---|---|
void |
clearStyles()
Clears the currently set styles table |
|
void |
fillAttributesNonLocked(javax.swing.text.Element root)
The same as fillAttributes but does not set a write lock |
|
static
|
getAttributeValue(javax.swing.text.Element elem,
com.inet.html.finder.AttributeFinder<T> finder)
Searches the correct style for the requested attribute. |
|
java.util.Enumeration<?> |
getStyleNames()
Fetches a list of the currently used styles. |
|
Styles |
getStyles()
Returns the current styles table |
|
Styles |
getStyleSheet(java.lang.String nm)
Returns the style with the given name. |
|
void |
handleNewCSSEntry(Selector selector)
Notifies the listener if a selector was added |
|
static boolean |
hasRelevantInlineStyles(javax.swing.text.Element element)
Checks whether this element has any (inline) attribute attached, which distinguishes it from it's parent. |
|
static boolean |
matchesAttributes(javax.swing.text.Element element,
javax.swing.text.AttributeSet requirements)
Checks, whether the given element matches the defined attributes. |
|
static void |
setAttribute(javax.swing.text.AttributeSet attrs,
java.lang.Object name,
java.lang.Object value)
Adds the value to the attribute set if the value is not null. |
|
void |
setStyles(Styles styles)
Sets the current styles table. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NewStyleResolver()
Method Detail |
---|
public static <T> T getAttributeValue(javax.swing.text.Element elem, com.inet.html.finder.AttributeFinder<T> finder)
T
- Class type of the requested attributeelem
- the current HTML nodefinder
- Finder for the requested type of attribute
public static boolean matchesAttributes(javax.swing.text.Element element, javax.swing.text.AttributeSet requirements)
element
matches the defined attributes. It will be tested,
if any attribute defined in requirements
is set with the same value at the element.
This comparison will check for inherited values as well!
element
- The element to checkrequirements
- The required attribute settings
element
fulfills the requirementspublic void fillAttributesNonLocked(javax.swing.text.Element root)
root
- the element to fillpublic static void setAttribute(javax.swing.text.AttributeSet attrs, java.lang.Object name, java.lang.Object value)
attrs
- The attribute set to modifyname
- The name of the attributevalue
- The value of the attributepublic Styles getStyles()
public void setStyles(Styles styles)
styles
- the new stylespublic void clearStyles()
public java.util.Enumeration<?> getStyleNames()
public Styles getStyleSheet(java.lang.String nm)
nm
- the name to find
public void handleNewCSSEntry(Selector selector)
handleNewCSSEntry
in interface CSSChangeListener
selector
- the new selectorpublic static boolean hasRelevantInlineStyles(javax.swing.text.Element element)
element
might
have styles by stylesheet rules.
element
- The element to check
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |