public class DocumentCommand extends Object
VerifyEvent
and
translated into a document replace command relative to a given offset. A
document command can also be used to initialize a given
VerifyEvent
.
A document command can also represent a list of related changes.
Modifier and Type | Field and Description |
---|---|
int |
caretOffset
The caret offset with respect to the document before the document command is executed.
|
boolean |
doit
Must the command be updated
|
int |
length
The length of the command
|
int |
offset
The offset of the command.
|
IDocumentListener |
owner
The owner of the document command which will not be notified.
|
boolean |
shiftsCaret
Indicates whether the caret should be shifted by this command.
|
String |
text
The text to be inserted
|
Modifier | Constructor and Description |
---|---|
protected |
DocumentCommand()
Creates a new document command.
|
Modifier and Type | Method and Description |
---|---|
void |
addCommand(int commandOffset,
int commandLength,
String commandText,
IDocumentListener commandOwner)
Adds an additional replace command.
|
int |
getCommandCount()
Returns the number of commands including the original document command.
|
Iterator |
getCommandIterator()
Returns an iterator over the commands in ascending position order.
|
public boolean doit
public int offset
public int length
public String text
public IDocumentListener owner
public int caretOffset
public boolean shiftsCaret
public void addCommand(int commandOffset, int commandLength, String commandText, IDocumentListener commandOwner) throws BadLocationException
null
, it will not
get document change notifications for the particular command.commandOffset
- the offset of the region to replacecommandLength
- the length of the region to replacecommandText
- the text to replace with, may be null
commandOwner
- the command owner, may be null
BadLocationException
- if the added command intersects with an existing onepublic Iterator getCommandIterator()
public int getCommandCount()
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.