|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object![]()
![]()
![]()
javax.swing.text.AbstractDocument.AbstractElement
, AttributeSet
, Element
, MutableAttributeSet
, TreeNode

, AbstractDocument.LeafElement


public abstract class AbstractDocument.AbstractElement

, MutableAttributeSet
, Serializable
, TreeNode

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 XMLEncoder
.
| Nested Class Summary |
|---|
Nested classes/interfaces inherited from interface javax.swing.text.AttributeSet ![]() |
|---|
AttributeSet.CharacterAttribute |
| Field Summary |
|---|
Fields inherited from interface javax.swing.text.AttributeSet ![]() |
|---|
NameAttribute |
| Constructor Summary | |
|---|---|
AbstractDocument.AbstractElement
Creates a new AbstractElement. |
|
| Method Summary | |
|---|---|
void |
addAttribute
Adds an attribute to the element. |
void |
addAttributes
Adds a set of attributes to the element. |
abstract Enumeration |
children
Returns the children of the receiver as an Enumeration. |
boolean |
containsAttribute
Checks whether a given attribute name/value is defined. |
boolean |
containsAttributes
Checks whether the element contains all the attributes. |
AttributeSet |
copyAttributes
Copies a set of attributes. |
void |
dump
Dumps a debugging representation of the element hierarchy. |
abstract boolean |
getAllowsChildren
Returns true if the receiver allows children. |
Object |
getAttribute
Gets the value of an attribute. |
int |
getAttributeCount
Gets the number of attributes that are defined. |
Enumeration |
getAttributeNames
Gets the names of all attributes. |
AttributeSet |
getAttributes
Gets the attributes for the element. |
TreeNode |
getChildAt
Returns the child TreeNode at index
childIndex. |
int |
getChildCount
Returns the number of children TreeNode's
receiver contains. |
Document |
getDocument
Retrieves the underlying model. |
abstract Element |
getElement
Gets a child element. |
abstract int |
getElementCount
Gets the number of children for the element. |
abstract int |
getElementIndex
Gets the child element index closest to the given model offset. |
abstract int |
getEndOffset
Gets the ending offset in the model for the element. |
int |
getIndex
Returns the index of node in the receivers children. |
String |
getName
Gets the name of the element. |
TreeNode |
getParent
Returns the parent TreeNode of the receiver. |
Element |
getParentElement
Gets the parent of the element. |
AttributeSet |
getResolveParent
Gets the resolving parent. |
abstract int |
getStartOffset
Gets the starting offset in the model for the element. |
boolean |
isDefined
Checks whether a given attribute is defined. |
boolean |
isEqual
Checks whether two attribute sets are equal. |
abstract boolean |
isLeaf
Checks whether the element is a leaf. |
void |
removeAttribute
Removes an attribute from the set. |
void |
removeAttributes
Removes a set of attributes for the element. |
void |
removeAttributes
Removes a set of attributes for the element. |
void |
setResolveParent
Sets the resolving parent. |
Methods inherited from class java.lang.Object ![]() |
|---|
clone |
| Constructor Detail |
|---|

public AbstractDocument.AbstractElement(Element![]()
![]()
parent, AttributeSet
![]()
![]()
a)
parent - the parent elementa - the attributes for the element| Method Detail |
|---|

public void dump(PrintStream![]()
![]()
psOut, int indentAmount)
psOut - the output streamindentAmount - the indentation level >= 0

public int getAttributeCount()
getAttributeCount

in interface AttributeSet

AttributeSet.getAttributeCount()


public boolean isDefined(Object![]()
![]()
attrName)
isDefined

in interface AttributeSet

attrName - the non-null attribute name
AttributeSet.isDefined(java.lang.Object)


public boolean isEqual(AttributeSet![]()
![]()
attr)
isEqual

in interface AttributeSet

attr - the attribute set to check against
AttributeSet.isEqual(javax.swing.text.AttributeSet)


public AttributeSet![]()
![]()
copyAttributes()
copyAttributes

in interface AttributeSet

AttributeSet.copyAttributes()


public Object![]()
![]()
getAttribute(Object
![]()
![]()
attrName)
getAttribute

in interface AttributeSet

attrName - the non-null attribute name
AttributeSet.getAttribute(java.lang.Object)


public Enumeration![]()
![]()
<?> getAttributeNames()
getAttributeNames

in interface AttributeSet

AttributeSet.getAttributeNames()


public boolean containsAttribute(Object![]()
![]()
name, Object
![]()
![]()
value)
containsAttribute

in interface AttributeSet

name - the non-null attribute namevalue - the attribute value
AttributeSet.containsAttribute(java.lang.Object, java.lang.Object)


public boolean containsAttributes(AttributeSet![]()
![]()
attrs)
containsAttributes

in interface AttributeSet

attrs - the attributes to check
AttributeSet.containsAttributes(javax.swing.text.AttributeSet)


public AttributeSet![]()
![]()
getResolveParent()
getResolveParent

in interface