public class AbstractDocument.DefaultDocumentEvent extends CompoundEdit implements DocumentEvent
DocumentEvent.ElementChange, DocumentEvent.EventType
edits
RedoName, UndoName
Constructor and Description |
---|
DefaultDocumentEvent(int offs, int len, DocumentEvent.EventType type)
构造一个更改记录。
|
Modifier and Type | Method and Description |
---|---|
boolean |
addEdit(UndoableEdit anEdit)
添加文档编辑。
|
DocumentEvent.ElementChange |
getChange(Element elem)
获取元素的更改。
|
Document |
getDocument()
获取源更改事件的文档。
|
int |
getLength()
返回更改的长度。
|
int |
getOffset()
返回更改的开始文档中的偏移量。
|
String |
getPresentationName()
提供一个本地化的,人类可读的描述这个编辑适合使用,说,一个更改日志。
|
String |
getRedoPresentationName()
提供了一个本地化的形式,这redoable人类可读的描述进行编辑,例如
|
DocumentEvent.EventType |
getType()
返回事件的类型。
|
String |
getUndoPresentationName()
提供了一个本地化的撤消,形成人类可读的描述进行编辑,例如
|
boolean |
isSignificant()
defaultdocument事件是重要的。
|
void |
redo()
重作的变化。
|
String |
toString()
返回更改事件的字符串描述。
|
void |
undo()
撤消更改。
|
canRedo, canUndo, die, end, isInProgress, lastEdit
replaceEdit
public DefaultDocumentEvent(int offs, int len, DocumentEvent.EventType type)
offs
-偏移的变化> = 0的文件
len
- > = 0的长度的变化
type
-事件类型(documentevent。事件类型)
public String toString()
toString
方法重写,继承类
CompoundEdit
public boolean addEdit(UndoableEdit anEdit)
addEdit
接口
UndoableEdit
addEdit
方法重写,继承类
CompoundEdit
anEdit
-文档编辑记录
UndoableEdit.addEdit(javax.swing.undo.UndoableEdit)
public void redo() throws CannotRedoException
redo
接口
UndoableEdit
redo
方法重写,继承类
CompoundEdit
CannotRedoException
如果改变不能重来
AbstractUndoableEdit.canRedo()
public void undo() throws CannotUndoException
undo
接口
UndoableEdit
undo
方法重写,继承类
CompoundEdit
CannotUndoException
如果改变无法挽回
AbstractUndoableEdit.canUndo()
public boolean isSignificant()
isSignificant
接口
UndoableEdit
isSignificant
方法重写,继承类
CompoundEdit
UndoableEdit.isSignificant()
public String getPresentationName()
getPresentationName
接口
UndoableEdit
getPresentationName
方法重写,继承类
CompoundEdit
AbstractUndoableEdit.getUndoPresentationName()
,
AbstractUndoableEdit.getRedoPresentationName()
public String getUndoPresentationName()
getUndoPresentationName
接口
UndoableEdit
getUndoPresentationName
方法重写,继承类
CompoundEdit
AbstractUndoableEdit.getPresentationName()
public String getRedoPresentationName()
getRedoPresentationName
接口
UndoableEdit
getRedoPresentationName
方法重写,继承类
CompoundEdit
AbstractUndoableEdit.getPresentationName()
public DocumentEvent.EventType getType()
getType
接口
DocumentEvent
DocumentEvent.getType()
public int getOffset()
getOffset
接口
DocumentEvent
DocumentEvent.getOffset()
public int getLength()
getLength
接口
DocumentEvent
DocumentEvent.getLength()
public Document getDocument()
getDocument
接口
DocumentEvent
DocumentEvent.getDocument()
public DocumentEvent.ElementChange getChange(Element elem)
getChange
接口
DocumentEvent
elem
-元素
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.