public abstract class AbstractDocument.AbstractElement extends Object implements Element, MutableAttributeSet, Serializable, TreeNode
警告:序列化该类的对象与以后的Swing版本不兼容。当前的序列化支持适用于短期贮藏或RMI运行相同Swing版本的应用程序之间。为1.4,为所有JavaBeans™长期存储的支持已被添加到java.beans
包。请看XMLEncoder
。
AttributeSet.CharacterAttribute, AttributeSet.ColorAttribute, AttributeSet.FontAttribute, AttributeSet.ParagraphAttribute
NameAttribute, ResolveAttribute
Constructor and Description |
---|
AbstractElement(Element parent, AttributeSet a)
创建一个新的”单元。
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(Object name, Object value)
向元素添加一个属性。
|
void |
addAttributes(AttributeSet attr)
向元素添加一组属性。
|
abstract Enumeration |
children()
作为一个
Enumeration 返回接收的孩子。
|
boolean |
containsAttribute(Object name, Object value)
检查一个给定的属性名称/值是否被定义。
|
boolean |
containsAttributes(AttributeSet attrs)
检查元素是否包含所有的属性。
|
AttributeSet |
copyAttributes()
复制一组属性。
|
void |
dump(PrintStream psOut, int indentAmount)
转储元素层次结构的调试表示。
|
abstract boolean |
getAllowsChildren()
如果接收器允许孩子返回真的。
|
Object |
getAttribute(Object attrName)
获取属性的值。
|
int |
getAttributeCount()
获取定义的属性的数目。
|
Enumeration<?> |
getAttributeNames()
获取所有属性的名称。
|
AttributeSet |
getAttributes()
获取元素的属性。
|
TreeNode |
getChildAt(int childIndex)
返回指数
childIndex 孩子
TreeNode 。
|
int |
getChildCount()
返回的孩子
TreeNode 的接收机数量包含。
|
Document |
getDocument()
检索底层模型。
|
abstract Element |
getElement(int index)
获取子元素。
|
abstract int |
getElementCount()
获取元素的儿童数量。
|
abstract int |
getElementIndex(int offset)
获取与给定模型偏移量最接近的子元素索引。
|
abstract int |
getEndOffset()
获取元素的模型中的结束偏移量。
|
int |
getIndex(TreeNode node)
返回
node 指数在接收机的孩子。
|
String |
getName()
获取元素的名称。
|
TreeNode |
getParent()
返回父
TreeNode 接收机。
|
Element |
getParentElement()
获取元素的父元素。
|
AttributeSet |
getResolveParent()
获取解决父。
|
abstract int |
getStartOffset()
获取元素的模型中的起始偏移量。
|
boolean |
isDefined(Object attrName)
检查一个给定的属性是否被定义。
|
boolean |
isEqual(AttributeSet attr)
检查两个属性集是否相等。
|
abstract boolean |
isLeaf()
检查元素是否是一个叶子。
|
void |
removeAttribute(Object name)
从集合中移除一个属性。
|
void |
removeAttributes(AttributeSet attrs)
移除元素的一组属性。
|
void |
removeAttributes(Enumeration<?> names)
移除元素的一组属性。
|
void |
setResolveParent(AttributeSet parent)
设置解决父。
|
public AbstractElement(Element parent, AttributeSet a)
parent
-父元素
a
-该元素的属性
public void dump(PrintStream psOut, int indentAmount)
psOut
-输出流
indentAmount
的缩进级别> = 0
public int getAttributeCount()
getAttributeCount
接口
AttributeSet
AttributeSet.getAttributeCount()
public boolean isDefined(Object attrName)
isDefined
接口
AttributeSet
attrName
-非空属性名称
AttributeSet.isDefined(java.lang.Object)
public boolean isEqual(AttributeSet attr)
isEqual
接口
AttributeSet
attr
-属性设置为对照
AttributeSet.isEqual(javax.swing.text.AttributeSet)
public AttributeSet copyAttributes()
copyAttributes
接口
AttributeSet
AttributeSet.copyAttributes()
public Object getAttribute(Object attrName)
getAttribute
接口
AttributeSet
attrName
-非空属性名称
AttributeSet.getAttribute(java.lang.Object)
public Enumeration<?> getAttributeNames()
getAttributeNames
接口
AttributeSet
AttributeSet.getAttributeNames()
public boolean containsAttribute(Object name, Object value)
containsAttribute
接口
AttributeSet
name
-非空属性名称
value
-属性值
AttributeSet.containsAttribute(java.lang.Object, java.lang.Object)
public boolean containsAttributes(AttributeSet attrs)
containsAttributes
接口
AttributeSet
attrs
-查看属性
AttributeSet.containsAttributes(javax.swing.text.AttributeSet)
public AttributeSet getResolveParent()
getResolveParent
接口
AttributeSet
null
AttributeSet.getResolveParent()
public void addAttribute(Object name, Object value)
addAttribute
接口
MutableAttributeSet
name
-非空属性名称
value
-属性值
MutableAttributeSet.addAttribute(java.lang.Object, java.lang.Object)
public void addAttributes(AttributeSet attr)
addAttributes
接口
MutableAttributeSet
attr
-添加属性
MutableAttributeSet.addAttribute(java.lang.Object, java.lang.Object)
public void removeAttribute(Object name)
removeAttribute
接口
MutableAttributeSet
name
-非空属性名称
MutableAttributeSet.removeAttribute(java.lang.Object)
public void removeAttributes(Enumeration<?> names)
removeAttributes
接口
MutableAttributeSet
names
-属性名称
MutableAttributeSet.removeAttributes(java.util.Enumeration<?>)
public void removeAttributes(AttributeSet attrs)
removeAttributes
接口
MutableAttributeSet
attrs
-属性
MutableAttributeSet.removeAttributes(java.util.Enumeration<?>)
public void setResolveParent(AttributeSet parent)
setResolveParent
接口
MutableAttributeSet
parent
-家长,如果没有返回null
MutableAttributeSet.setResolveParent(javax.swing.text.AttributeSet)
public Document getDocument()
getDocument
接口
Element
public Element getParentElement()
getParentElement
接口
Element
public AttributeSet getAttributes()
getAttributes
接口
Element
public abstract int getStartOffset()
getStartOffset
接口
Element
Document
,
AbstractDocument
public abstract int getEndOffset()
getEndOffset
接口
Element
Document
,
AbstractDocument
public abstract Element getElement(int index)
getElement
接口
Element
index
-孩子指数> = 0和<getelementcount()
public abstract int getElementCount()
getElementCount
接口
Element
public abstract int getElementIndex(int offset)
getElementIndex
接口
Element
offset
-偏移> = 0
public abstract boolean isLeaf()
public TreeNode getChildAt(int childIndex)
childIndex
孩子
TreeNode
。
getChildAt
接口
TreeNode
public int getChildCount()
TreeNode
的接收机数量包含。
getChildCount
接口
TreeNode
TreeNodews
的接收机数量包含
public TreeNode getParent()
TreeNode
接收机。
public int getIndex(TreeNode node)
node
指数在接收机的孩子。如果接收者没有包含
node
,1将返回。
public abstract boolean getAllowsChildren()
getAllowsChildren
接口
TreeNode
public abstract Enumeration children()
Enumeration
返回接收的孩子。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.