|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.text.AbstractDocument.AbstractElement
javax.swing.text.AbstractDocument.BranchElement
public class AbstractDocument.BranchElement
An implementation of Element to represent composite
Elements that contain other Elements.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface javax.swing.text.AttributeSet |
|---|
AttributeSet.CharacterAttribute, AttributeSet.ColorAttribute, AttributeSet.FontAttribute, AttributeSet.ParagraphAttribute |
| Field Summary |
|---|
| Fields inherited from interface javax.swing.text.AttributeSet |
|---|
NameAttribute, ResolveAttribute |
| Constructor Summary | |
|---|---|
AbstractDocument.BranchElement(Element parent,
AttributeSet attributes)
Creates a new BranchElement with the specified
parent and attributes. |
|
| Method Summary | |
|---|---|
Enumeration |
children()
Returns the children of this BranchElement. |
boolean |
getAllowsChildren()
Returns true since BranchElements allow
child elements. |
Element |
getElement(int index)
Returns the child element at the specified index. |
int |
getElementCount()
Returns the number of child elements of this element. |
int |
getElementIndex(int offset)
Returns the index of the child element that spans the specified offset in the document model. |
int |
getEndOffset()
Returns the offset inside the document model that is after the last character of this element. |
String |
getName()
Returns the name of this element. |
int |
getStartOffset()
Returns the start offset of this element inside the document model. |
boolean |
isLeaf()
Returns false since BranchElement are no
leafes. |
Element |
positionToElement(int position)
Returns the Element at the specified Document
offset. |
void |
replace(int offset,
int length,
Element[] elements)
Replaces a set of child elements with a new set of child elemens. |
String |
toString()
Returns a string representation of this element. |
| Methods inherited from class javax.swing.text.AbstractDocument.AbstractElement |
|---|
addAttribute, addAttributes, containsAttribute, containsAttributes, copyAttributes, dump, getAttribute, getAttributeCount, getAttributeNames, getAttributes, getChildAt, getChildCount, getDocument, getIndex, getParent, getParentElement, getResolveParent, isDefined, isEqual, removeAttribute, removeAttributes, removeAttributes, setResolveParent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractDocument.BranchElement(Element parent,
AttributeSet attributes)
BranchElement with the specified
parent and attributes.
parent - the parent element of this BranchElementattributes - the attributes to set on this
BranchElement| Method Detail |
|---|
public Enumeration children()
BranchElement.
children in interface TreeNodechildren in class AbstractDocument.AbstractElementBranchElementpublic boolean getAllowsChildren()
true since BranchElements allow
child elements.
getAllowsChildren in interface TreeNodegetAllowsChildren in class AbstractDocument.AbstractElementtrue since BranchElements allow
child elementspublic Element getElement(int index)
index.
getElement in interface ElementgetElement in class AbstractDocument.AbstractElementindex - the index of the requested child element
public int getElementCount()
getElementCount in interface ElementgetElementCount in class AbstractDocument.AbstractElementpublic int getElementIndex(int offset)
getElementIndex in interface ElementgetElementIndex in class AbstractDocument.AbstractElementoffset - the offset for which the responsible element is searched
public int getEndOffset()
NullPointerException.
getEndOffset in interface ElementgetEndOffset in class AbstractDocument.AbstractElementNullPointerException - if this branch element has no childrenpublic String getName()
AbstractDocument.ParagraphElementName
in this case.
getName in interface ElementgetName in class AbstractDocument.AbstractElementpublic int getStartOffset()
NullPointerException.
getStartOffset in interface ElementgetStartOffset in class AbstractDocument.AbstractElementNullPointerException - if this branch element has no children and
no startOffset value has been cachedpublic boolean isLeaf()
false since BranchElement are no
leafes.
isLeaf in interface ElementisLeaf in interface TreeNodeisLeaf in class AbstractDocument.AbstractElementfalse since BranchElement are no
leafespublic Element positionToElement(int position)
Element at the specified Document
offset.
Element at the specified Document
offsetgetElementIndex(int)
public void replace(int offset,
int length,
Element[] elements)
offset - the start index of the elements to be removedlength - the number of elements to be removedelements - the new elements to be insertedpublic String toString()
toString in class ObjectObject.getClass(),
Object.hashCode(),
Class.getName(),
Integer.toHexString(int)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||