站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

BaseElement (Editor Library) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.editor.lib/1 1.14.0 3

org.netbeans.editor
Class BaseElement

java.lang.Object
  extended by org.netbeans.editor.BaseElement
All Implemented Interfaces:
Element
Direct Known Subclasses:
LeafElement

public abstract class BaseElement
extends Object
implements Element

Element implementation. It serves as parent class for both leaf and branch elements.


Field Summary
protected  AttributeSet attrs
          Atributes of this element
protected  BaseDocument doc
          Reference to document this element is part of
static String ElementNameAttribute
          Element name attribute
protected  BaseElement parent
          Parent element
 
Constructor Summary
BaseElement(BaseDocument doc, BaseElement parent, AttributeSet attrs)
           
 
Method Summary
 AttributeSet getAttributes()
          Get attributes of this element
 Document getDocument()
          Get document this element is part of
abstract  Element getElement(int index)
          Get child of this element at specified index
abstract  int getElementCount()
          Get number of children of this element
abstract  int getElementIndex(int offset)
          Gets the child element index closest to the given offset.
abstract  Mark getEndMark()
          Get end mark of this element
abstract  int getEndOffset()
          Get end offset of this element
 String getName()
          Get element name if defined
 Element getParentElement()
          Get parent element
abstract  Mark getStartMark()
          Get start mark of this element
abstract  int getStartOffset()
          Get start offset of this element
abstract  boolean isLeaf()
          Does this element have any children?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ElementNameAttribute

public static final String ElementNameAttribute
Element name attribute

See Also:
Constant Field Values

doc

protected BaseDocument doc
Reference to document this element is part of


parent

protected BaseElement parent
Parent element


attrs

protected AttributeSet attrs
Atributes of this element

Constructor Detail

BaseElement

public BaseElement(BaseDocument doc,
                   BaseElement parent,
                   AttributeSet attrs)
Method Detail

getDocument

public Document getDocument()
Get document this element is part of

Specified by:
getDocument in interface Element

getParentElement

public Element getParentElement()
Get parent element

Specified by:
getParentElement in interface Element

getName

public String getName()
Get element name if defined

Specified by:
getName in interface Element

getAttributes

public AttributeSet getAttributes()
Get attributes of this element

Specified by:
getAttributes in interface Element

getStartOffset

public abstract int getStartOffset()
Get start offset of this element

Specified by:
getStartOffset in interface Element

getStartMark

public abstract Mark getStartMark()
Get start mark of this element


getEndOffset

public abstract int getEndOffset()
Get end offset of this element

Specified by:
getEndOffset in interface Element

getEndMark

public abstract Mark getEndMark()
Get end mark of this element


getElement

public abstract Element getElement(int index)
Get child of this element at specified index

Specified by:
getElement in interface Element

getElementIndex

public abstract int getElementIndex(int offset)
Gets the child element index closest to the given offset.

Specified by:
getElementIndex in interface Element

getElementCount

public abstract int getElementCount()
Get number of children of this element

Specified by:
getElementCount in interface Element

isLeaf

public abstract boolean isLeaf()
Does this element have any children?

Specified by:
isLeaf in interface Element

org.netbeans.modules.editor.lib/1 1.14.0 3

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.