|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.ide.cmd.buffer.EditProcessor
The EditProcessor
class contains static utility
routines for apply simple or complex edits to a
Document
. The EditProcessor
will take
care of buffer locking, notifications by sending an
UpdateMessage
to document observers, and undo by
wrapping the edit with an IDE command.
For a single simple edit such as an insert, remove, replace, or
replace all, Addins can simply call the corresponding
doInsert()
, doRemove()
,
doReplace
, or doReplaceAll
method to
perform the edit.
If the simple edit should be undoable by the user using Edit->Undo,
Addins should specify true
for the
isUndoable
parameter, and also specify an appropriate
human-readable (i.e., translateable) undo edit name for use with
the Edit->Undo menu item.
For a complex edit, such as a sequence of inserts or removes,
Addins should encapsulate the complex edit in the Edit
interface, and use the doEdit()
to perform the
edit.
For all edit utility methods, the origin parameter is optional. It
is used with the UpdateMessage
so that Addins that
also observe the document can identify the specify edit that they
just applied. Note that it is only used with
UpdateMessage
notification for the first application
of the edit. All subsequent Undo and Redo operations will use
null
for the origin.
Method Summary | |
static void |
doEdit(Edit edit,
Document document,
java.lang.Object origin)
Utility routine to invoke the specified edit for the given document as a command. |
static void |
doInsert(char[] insertData,
int insertOffset,
Document document,
boolean isUndoable,
java.lang.String editName,
java.lang.Object origin)
Utility routine to perform a single insert in the document. |
static void |
doRemove(int removeOffset,
int removeCount,
Document document,
boolean isUndoable,
java.lang.String editName,
java.lang.Object origin)
Utility routine to perform a single remove in the document. |
static void |
doReplace(char[] replaceData,
int replaceStartOffset,
int replaceEndOffset,
Document document,
boolean isUndoable,
java.lang.String editName,
java.lang.Object origin)
Utility routine to perform a single replace in the document with the specified replace data. |
static void |
doReplaceAll(char[] replaceData,
Document document,
boolean isUndoable,
java.lang.String editName,
java.lang.Object origin)
Utility routine to perform a replace all in the document with the new contents. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void doInsert(char[] insertData, int insertOffset, Document document, boolean isUndoable, java.lang.String editName, java.lang.Object origin)
insertData
- the data to insert into the documentinsertOffset
- the offset location to perform the insertdocument
- the document to apply the edit toisUndoable
- whether this edit should be undoableeditName
- the name of the edit to use for undoorigin
- the origin of this edit, used for the UpdateMessagepublic static void doRemove(int removeOffset, int removeCount, Document document, boolean isUndoable, java.lang.String editName, java.lang.Object origin)
removeOffset
- the start of the remove in the documentremoveCount
- the number of characters to removedocument
- the document to apply the edit toisUndoable
- whether this edit should be undoableeditName
- the name of the edit to use for undoorigin
- the origin of this edit, used for the UpdateMessagepublic static void doReplace(char[] replaceData, int replaceStartOffset, int replaceEndOffset, Document document, boolean isUndoable, java.lang.String editName, java.lang.Object origin)
replaceData
- the replace data for the location in the documentreplaceStartOffset
- the starting offset of the location to replacereplaceEndOffset
- the ending offset of the location to replacedocument
- the document to apply the edit toisUndoable
- whether this edit should be undoableeditName
- the name of the edit to use for undoorigin
- the origin of this edit, used for the UpdateMessagepublic static void doReplaceAll(char[] replaceData, Document document, boolean isUndoable, java.lang.String editName, java.lang.Object origin)
replaceData
- the new data for the documentdocument
- the document to apply the edit toisUndoable
- whether this edit should be undoableeditName
- the name of the edit to use for undoorigin
- the origin of this edit, used for the UpdateMessagepublic static void doEdit(Edit edit, Document document, java.lang.Object origin)
edit
- the edit to applydocument
- the document to apply the edit toorigin
- the origin of this edit, used for the UpdateMessage
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.