Class HTMLDocument.RunElement
java.lang.Object
javax.swing.text.AbstractDocument.AbstractElement
javax.swing.text.AbstractDocument.LeafElement
javax.swing.text.html.HTMLDocument.RunElement
- All Implemented Interfaces:
Serializable, AttributeSet, Element, MutableAttributeSet, TreeNode
- Enclosing class:
HTMLDocument
public class HTMLDocument.RunElement extends AbstractDocument.LeafElement
An element that represents a chunk of text that has a set of HTML character level attributes assigned to it.
Nested Class Summary
Nested classes/interfaces declared in interface AttributeSet
AttributeSet.CharacterAttribute, AttributeSet.ColorAttribute, AttributeSet.FontAttribute, AttributeSet.ParagraphAttribute | Modifier and Type | Interface | Description |
|---|---|---|
static interface |
AttributeSet.CharacterAttribute |
This interface is the type signature that is expected to be present on any attribute key that contributes to character level presentation. |
static interface |
AttributeSet.ColorAttribute |
This interface is the type signature that is expected to be present on any attribute key that contributes to presentation of color. |
static interface |
AttributeSet.FontAttribute |
This interface is the type signature that is expected to be present on any attribute key that contributes to the determination of what font to use to render some text. |
static interface |
AttributeSet.ParagraphAttribute |
This interface is the type signature that is expected to be present on any attribute key that contributes to the paragraph level presentation. |
Field Summary
Fields declared in interface AttributeSet
NameAttribute, ResolveAttribute | Modifier and Type | Field | Description |
|---|---|---|
static final Object |
NameAttribute |
Attribute name used to name the collection of attributes. |
static final Object |
ResolveAttribute |
Attribute name used to identify the resolving parent set of attributes, if one is defined. |
Constructor Summary
| Constructor | Description |
|---|---|
RunElement |
Constructs an element that represents content within the document (has no children). |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
String |
getName() |
Gets the name of the element. |
AttributeSet |
getResolveParent() |
Gets the resolving parent. |
Methods declared in class AbstractDocument.LeafElement
children, getAllowsChildren, getElement, getElementCount, getElementIndex, getEndOffset, getStartOffset, isLeaf, toString | Modifier and Type | Method | Description |
|---|---|---|
Enumeration |
children() |
Returns the children of the receiver as an Enumeration. |
boolean |
getAllowsChildren() |
Returns true if the receiver allows children. |
Element |
getElement |
Gets a child element. |
int |
getElementCount() |
Returns the number of child elements. |
int |
getElementIndex |
Gets the child element index closest to the given model offset. |
int |
getEndOffset() |
Gets the ending offset in the model for the element. |
int |
getStartOffset() |
Gets the starting offset in the model for the element. |
boolean |
isLeaf() |
Checks whether the element is a leaf. |
String |
toString() |
Converts the element to a string. |
Methods declared in class AbstractDocument.AbstractElement
addAttribute, addAttributes, containsAttribute, containsAttributes, copyAttributes, dump, getAttribute, getAttributeCount, getAttributeNames, getAttributes, getChildAt, getChildCount, getDocument, getIndex, getParent, getParentElement, isDefined, isEqual, removeAttribute, removeAttributes, removeAttributes, setResolveParent | Modifier and Type | Method | Description |
|---|---|---|
void |
addAttribute |
Adds an attribute to the element. |
void |
addAttributes |
Adds a set of attributes to the element. |
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. |
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. |
int |
getIndex |
Returns the index of node in the receivers children. |
TreeNode |
getParent() |
Returns the parent TreeNode of the receiver. |
Element |
getParentElement() |
Gets the parent of the element. |
boolean |
isDefined |
Checks whether a given attribute is defined. |
boolean |
isEqual |
Checks whether two attribute sets are equal. |
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 declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | Modifier and Type | Method | Description |
|---|---|---|
protected Object |
clone() |
Creates and returns a copy of this object. |
boolean |
equals |
Indicates whether some other object is "equal to" this one. |
protected void |
finalize() |
Deprecated, for removal: This API element is subject to removal in a future version. Finalization is deprecated and subject to removal in a future release. |
final Class |
getClass() |
Returns the runtime class of this Object. |
int |
hashCode() |
Returns a hash code value for this object. |
final void |
notify() |
Wakes up a single thread that is waiting on this object's monitor. |
final void |
notifyAll() |
Wakes up all threads that are waiting on this object's monitor. |
final void |
wait() |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted. |
final void |
wait |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
final void |
wait |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
Constructor Details
RunElement
public RunElement(Element parent, AttributeSet a, int offs0, int offs1)
Constructs an element that represents content within the document (has no children).
- Parameters:
-
parent- the parent element -
a- the element attributes -
offs0- the start offset (must be at least 0) -
offs1- the end offset (must be at least offs0) - Since:
- 1.4
Method Details
getName
public String getName()
Gets the name of the element.
- Specified by:
-
getNamein interfaceElement - Overrides:
-
getNamein classAbstractDocument.LeafElement - Returns:
- the name, null if none
getResolveParent
public AttributeSet getResolveParent()
Gets the resolving parent. HTML attributes are not inherited at the model level so we override this to return null.
- Specified by:
-
getResolveParentin interfaceAttributeSet - Overrides:
-
getResolveParentin classAbstractDocument.AbstractElement - Returns:
- null, there are none
- See Also:
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.