Home » openjdk-7 » javax » swing » text » [javadoc | source]
javax.swing.text
abstract public class: AbstractDocument.AbstractElement [javadoc | source]
java.lang.Object
   javax.swing.text.AbstractDocument$AbstractElement

All Implemented Interfaces:
    MutableAttributeSet, TreeNode, Serializable, Element

Direct Known Subclasses:
    BidiRootElement, BidiElement, BranchElement, LeafElement

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.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder .
Constructor:
 public AbstractElement(Element parent,
    AttributeSet a) 
    Creates a new AbstractElement.
    Parameters:
    parent - the parent element
    a - the attributes for the element
    since: 1.4 -
Method from javax.swing.text.AbstractDocument$AbstractElement Summary:
addAttribute,   addAttributes,   children,   containsAttribute,   containsAttributes,   copyAttributes,   dump,   getAllowsChildren,   getAttribute,   getAttributeCount,   getAttributeNames,   getAttributes,   getChildAt,   getChildCount,   getDocument,   getElement,   getElementCount,   getElementIndex,   getEndOffset,   getIndex,   getName,   getParent,   getParentElement,   getResolveParent,   getStartOffset,   isDefined,   isEqual,   isLeaf,   removeAttribute,   removeAttributes,   removeAttributes,   setResolveParent
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.text.AbstractDocument$AbstractElement Detail:
 public  void addAttribute(Object name,
    Object value) 
    Adds an attribute to the element.
 public  void addAttributes(AttributeSet attr) 
    Adds a set of attributes to the element.
 abstract public Enumeration children()
    Returns the children of the receiver as an Enumeration.
 public boolean containsAttribute(Object name,
    Object value) 
    Checks whether a given attribute name/value is defined.
 public boolean containsAttributes(AttributeSet attrs) 
    Checks whether the element contains all the attributes.
 public AttributeSet copyAttributes() 
    Copies a set of attributes.
 public  void dump(PrintStream psOut,
    int indentAmount) 
    Dumps a debugging representation of the element hierarchy.
 abstract public boolean getAllowsChildren()
    Returns true if the receiver allows children.
 public Object getAttribute(Object attrName) 
    Gets the value of an attribute.
 public int getAttributeCount() 
    Gets the number of attributes that are defined.
 public Enumeration<?> getAttributeNames() 
    Gets the names of all attributes.
 public AttributeSet getAttributes() 
    Gets the attributes for the element.
 public TreeNode getChildAt(int childIndex) 
    Returns the child TreeNode at index childIndex.
 public int getChildCount() 
    Returns the number of children TreeNode's receiver contains.
 public Document getDocument() 
    Retrieves the underlying model.
 abstract public Element getElement(int index)
    Gets a child element.
 abstract public int getElementCount()
    Gets the number of children for the element.
 abstract public int getElementIndex(int offset)
    Gets the child element index closest to the given model offset.
 abstract public int getEndOffset()
    Gets the ending offset in the model for the element.
 public int getIndex(TreeNode node) 
    Returns the index of node in the receivers children. If the receiver does not contain node, -1 will be returned.
 public String getName() 
    Gets the name of the element.
 public TreeNode getParent() 
    Returns the parent TreeNode of the receiver.
 public Element getParentElement() 
    Gets the parent of the element.
 public AttributeSet getResolveParent() 
    Gets the resolving parent. If not overridden, the resolving parent defaults to the parent element.
 abstract public int getStartOffset()
    Gets the starting offset in the model for the element.
 public boolean isDefined(Object attrName) 
    Checks whether a given attribute is defined.
 public boolean isEqual(AttributeSet attr) 
    Checks whether two attribute sets are equal.
 abstract public boolean isLeaf()
    Checks whether the element is a leaf.
 public  void removeAttribute(Object name) 
    Removes an attribute from the set.
 public  void removeAttributes(Enumeration<?> names) 
    Removes a set of attributes for the element.
 public  void removeAttributes(AttributeSet attrs) 
    Removes a set of attributes for the element.
 public  void setResolveParent(AttributeSet parent) 
    Sets the resolving parent.