All Packages Class Hierarchy This Package Previous Next Index
Class java.awt.swing.text.AbstractDocument.AbstractElement
java.lang.Object
|
+----java.awt.swing.text.AbstractDocument.AbstractElement
- public abstract class AbstractDocument.AbstractElement
- extends Object
- implements Element, MutableAttributeSet, Serializable
Implements the abstract part of an element. By default elements
support attributes by having a field that represents the immutable
part of the current attribute set for the element. The element itself
implements MutableAttributeSet which can be used to modify the set
by fetching a new immutable set. The immutable sets are provided
by the AttributeContext associated with the document.
AbstractDocument.AbstractElement(AbstractDocument, Element, AttributeSet)
- Creates a new AbstractElement.
addAttribute(String, Object)
- Adds an attribute to the element.
addAttributes(AttributeSet)
- Adds a set of attributes to the element.
containsAttribute(String, Object)
- Checks whether a given attribute name/value is defined.
containsAttributes(AttributeSet)
- Checks whether the element contains all the attributes.
copyAttributes()
- Copies a set of attributes.
dump(PrintStream, int)
- Dumps a debugging representation of the element hierarchy.
finalize()
- Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
getAttribute(String)
- Gets the value of an attribute.
getAttributeCount()
- Gets the number of attributes that are defined.
getAttributeNames()
- Gets the names of all attributes.
getAttributes()
- Gets the attributes for the element.
getDocument()
- Retrieves the underlying model.
getElement(int)
- Gets a child element.
getElementCount()
- Gets the number of children for the element.
getElementIndex(int)
- Gets the child element index closest to the given model offset.
getEndOffset()
- Gets the ending offset in the model for the element.
getName()
- Gets the name of the element.
getParentElement()
- Gets the parent of the element.
getResolveParent()
- If not overriden, the resolving parent defaults to
the parent element.
getStartOffset()
- Gets the starting offset in the model for the element.
isDefined(String)
- Checks whether a given attribute is defined.
isEmpty()
- Checks whether any attributes have been defined.
isEqual(AttributeSet)
- Checks whether two attribute sets are equal.
isLeaf()
- Checks whether the element is a leaf.
removeAttribute(String)
- Removes an attribute from the set.
removeAttributes(AttributeSet)
- Removes a set of attributes for the element.
removeAttributes(Enumeration)
- Removes a set of attributes for the element.
setResolveParent(MutableAttributeSet)
- Sets the resolving parent.
AbstractDocument.AbstractElement
public AbstractDocument.AbstractElement(AbstractDocument this$0,
Element parent,
AttributeSet a)
- Creates a new AbstractElement.
- Parameters:
- parent - the parent element
- a - the attributes for the element
dump
public void dump(PrintStream out,
int indentAmount)
- Dumps a debugging representation of the element hierarchy.
- Parameters:
- out - the output stream
- indentAmount - the indentation level
finalize
protected void finalize() throws Throwable
- Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
- Overrides:
- finalize in class Object
isEmpty
public boolean isEmpty()
- Checks whether any attributes have been defined.
- Returns:
- true if the attribute list is empty
- See Also:
- isEmpty
getAttributeCount
public int getAttributeCount()
- Gets the number of attributes that are defined.
- Returns:
- the number of attributes
- See Also:
- getAttributeCount
isDefined
public boolean isDefined(String attrName)
- Checks whether a given attribute is defined.
- Parameters:
- attrName - the attribute name
- Returns:
- true if the attribute is defined
- See Also:
- isDefined
isEqual
public boolean isEqual(AttributeSet attr)
- Checks whether two attribute sets are equal.
- Parameters:
- attr - the attribute set to check against
- Returns:
- true if the same
- See Also:
- isEqual
copyAttributes
public AttributeSet copyAttributes()
- Copies a set of attributes.
- Returns:
- the copy
- See Also:
- copyAttributes
getAttribute
public Object getAttribute(String attrName)
- Gets the value of an attribute.
- Parameters:
- attrName - the attribute name
- Returns:
- the attribute value
- See Also:
- getAttribute
getAttributeNames
public Enumeration getAttributeNames()
- Gets the names of all attributes.
- Returns:
- the attribute names
- See Also:
- getAttributeNames
containsAttribute
public boolean containsAttribute(String name,
Object value)
- Checks whether a given attribute name/value is defined.
- Parameters:
- name - the attribute name
- value - the attribute value
- Returns:
- true if the name/value is defined
- See Also:
- containsAttribute
containsAttributes
public boolean containsAttributes(AttributeSet attrs)
- Checks whether the element contains all the attributes.
- Parameters:
- attrs - the attributes to check
- Returns:
- true if the element contains all the attributes
- See Also:
- containsAttributes
getResolveParent
public AttributeSet getResolveParent()
- If not overriden, the resolving parent defaults to
the parent element.
- Returns:
- the attributes from the parent
- See Also:
- getResolveParent
addAttribute
public void addAttribute(String name,
Object value)
- Adds an attribute to the element.
- Parameters:
- name - the attribute name
- value - the attribute value
- See Also:
- addAttribute
addAttributes
public void addAttributes(AttributeSet attr)
- Adds a set of attributes to the element.
- Parameters:
- attr - the attributes to add
- See Also:
- addAttribute
removeAttribute
public void removeAttribute(String name)
- Removes an attribute from the set.
- Parameters:
- name - the attribute name
- See Also:
- removeAttribute
removeAttributes
public void removeAttributes(Enumeration names)
- Removes a set of attributes for the element.
- Parameters:
- names - the attribute names
- See Also:
- removeAttributes
removeAttributes
public void removeAttributes(AttributeSet attrs)
- Removes a set of attributes for the element.
- Parameters:
- attrs - the attributes
- See Also:
- removeAttributes
setResolveParent
public void setResolveParent(MutableAttributeSet parent)
- Sets the resolving parent.
- Parameters:
- parent - the parent
- See Also:
- setResolveParent
getDocument
public Document getDocument()
- Retrieves the underlying model.
- Returns:
- the model
getParentElement
public Element getParentElement()
- Gets the parent of the element.
- Returns:
- the parent
getAttributes
public AttributeSet getAttributes()
- Gets the attributes for the element.
- Returns:
- the attribute set
getName
public String getName()
- Gets the name of the element.
- Returns:
- the name
getStartOffset
public abstract int getStartOffset()
- Gets the starting offset in the model for the element.
- Returns:
- the offset
getEndOffset
public abstract int getEndOffset()
- Gets the ending offset in the model for the element.
- Returns:
- the offset
getElement
public abstract Element getElement(int index)
- Gets a child element.
- Parameters:
- index - the child index
- Returns:
- the child element
getElementCount
public abstract int getElementCount()
- Gets the number of children for the element.
- Returns:
- the number of children
getElementIndex
public abstract int getElementIndex(int offset)
- Gets the child element index closest to the given model offset.
- Parameters:
- offset - the offset
- Returns:
- the element index
isLeaf
public abstract boolean isLeaf()
- Checks whether the element is a leaf.
- Returns:
- true if a leaf
All Packages Class Hierarchy This Package Previous Next Index
Submit a bug or feature