java.lang.Object | |
↳ | javax.swing.text.AbstractDocument.AbstractElement |
![]() |
![]() |
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
.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new AbstractElement.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds an attribute to the element.
| |||||||||||
Adds a set of attributes to the element.
| |||||||||||
Returns the children of the receiver as an
Enumeration . | |||||||||||
Checks whether a given attribute name/value is defined.
| |||||||||||
Checks whether the element contains all the attributes.
| |||||||||||
Copies a set of attributes.
| |||||||||||
Dumps a debugging representation of the element hierarchy.
| |||||||||||
Returns true if the receiver allows children.
| |||||||||||
Gets the value of an attribute.
| |||||||||||
Gets the number of attributes that are defined.
| |||||||||||
Gets the names of all attributes.
| |||||||||||
Gets the attributes for the element.
| |||||||||||
Returns the child
TreeNode at index
childIndex . | |||||||||||
Returns the number of children
TreeNode 's
receiver contains. | |||||||||||
Retrieves the underlying model.
| |||||||||||
Gets a child element.
| |||||||||||
Gets the number of children for the element.
| |||||||||||
Gets the child element index closest to the given model offset.
| |||||||||||
Gets the ending offset in the model for the element.
| |||||||||||
Returns the index of
node in the receivers children. | |||||||||||
Gets the name of the element.
| |||||||||||
Returns the parent
TreeNode of the receiver. | |||||||||||
Gets the parent of the element.
| |||||||||||
Gets the resolving parent.
| |||||||||||
Gets the starting offset in the model for the element.
| |||||||||||
Checks whether a given attribute is defined.
| |||||||||||
Checks whether two attribute sets are equal.
| |||||||||||
Checks whether the element is a leaf.
| |||||||||||
Removes an attribute from the set.
| |||||||||||
Removes a set of attributes for the element.
| |||||||||||
Removes a set of attributes for the element.
| |||||||||||
Sets the resolving parent.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Creates a new AbstractElement.
parent | the parent element |
---|---|
a | the attributes for the element |
Adds an attribute to the element.
name | the non-null attribute name |
---|---|
value | the attribute value |
Adds a set of attributes to the element.
attr | the attributes to add |
---|
Returns the children of the receiver as an
Enumeration
.
Enumeration
Checks whether a given attribute name/value is defined.
name | the non-null attribute name |
---|---|
value | the attribute value |
Checks whether the element contains all the attributes.
attrs | the attributes to check |
---|
Dumps a debugging representation of the element hierarchy.
psOut | the output stream |
---|---|
indentAmount | the indentation level >= 0 |
Returns true if the receiver allows children.
Gets the value of an attribute.
attrName | the non-null attribute name |
---|
Gets the number of attributes that are defined.
Gets the names of all attributes.
Returns the number of children TreeNode
's
receiver contains.
TreeNodews
's
receiver contains
Gets a child element.
index | the child index, >= 0 && < getElementCount() |
---|
Gets the number of children for the element.
Gets the child element index closest to the given model offset.
offset | the offset >= 0 |
---|
Gets the ending offset in the model for the element.
Returns the index of node
in the receivers children.
If the receiver does not contain node
, -1 will be
returned.
node | the location of interest |
---|
node
in the receiver's
children, or -1 if absent
Returns the parent TreeNode
of the receiver.
TreeNode
of the receiver
Gets the resolving parent. If not overridden, the resolving parent defaults to the parent element.
null
if noneGets the starting offset in the model for the element.
Checks whether a given attribute is defined.
attrName | the non-null attribute name |
---|
Checks whether two attribute sets are equal.
attr | the attribute set to check against |
---|
Checks whether the element is a leaf.
Removes an attribute from the set.
name | the non-null attribute name |
---|
Removes a set of attributes for the element.
attrs | the attributes |
---|
Removes a set of attributes for the element.
names | the attribute names |
---|
Sets the resolving parent.
parent | the parent, null if none |
---|