Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.jface.text
Class DocumentCommand

java.lang.Object
  extended by 
org.eclipse.jface.text.DocumentCommand

public class DocumentCommand
extends Object

Represents a text modification as a document replace command. The text modification is given as a 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.


Field Summary
 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
 
Constructor Summary
protected DocumentCommand ()
          Creates a new document command.
 
Method Summary
 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.
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

doit

public boolean doit
Must the command be updated


offset

public int offset
The offset of the command.


length

public int length
The length of the command


text

public 
String text
The text to be inserted


owner

public 
IDocumentListener owner
The owner of the document command which will not be notified.

Since:
2.1

caretOffset

public int caretOffset
The caret offset with respect to the document before the document command is executed.

Since:
2.1

shiftsCaret

public boolean shiftsCaret
Indicates whether the caret should be shifted by this command.

Since:
3.0
Constructor Detail

DocumentCommand

protected DocumentCommand()
Creates a new document command.

Method Detail

addCommand

public void addCommand(int commandOffset,
                       int commandLength,
                       
String commandText,
                       
IDocumentListener commandOwner)
                throws 
BadLocationException
Adds an additional replace command. The added replace command must not overlap with existing ones. If the document command owner is not null, it will not get document change notifications for the particular command.

Parameters:
commandOffset - the offset of the region to replace
commandLength - the length of the region to replace
commandText - the text to replace with, may be null
commandOwner - the command owner, may be null
Throws:
BadLocationException - if the added command intersects with an existing one
Since:
2.1

getCommandIterator

public 
Iterator getCommandIterator()
Returns an iterator over the commands in ascending position order. The iterator includes the original document command. Commands cannot be removed.

Returns:
returns the command iterator

getCommandCount

public int getCommandCount()
Returns the number of commands including the original document command.

Returns:
returns the number of commands
Since:
2.1

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire