sk.uniba.euromath.editor.textEditor.requests.editTextRequests
Class DeleteTextRequest

java.lang.Object
  extended by org.eclipse.gef.Request
      extended by sk.uniba.euromath.editor.textEditor.requests.editTextRequests.EditTextRequest
          extended by sk.uniba.euromath.editor.textEditor.requests.editTextRequests.DeleteTextRequest
All Implemented Interfaces:
IRequestSpecialization

public final class DeleteTextRequest
extends EditTextRequest
implements IRequestSpecialization

Request to delete text from specified position of specified size. Position is specified by ITextPieceKeeper and offset. Size specifies deletion direction and length of text to delete. So effect is deletion of text from offset(include offset character) in ITextPieceKeeper to offset + size (including).

Author:
Martin Kollar 17.11.2005

Constructor Summary
DeleteTextRequest(ITextPieceKeeper source, int offset, int length, Direction direction)
          Constructor.
 
Method Summary
 Direction getDirection()
           
 int getLength()
          Returns length of text to delete.
 int getOffset()
          Returns position in text piece from where text should be deleted.
 String getSpecialization()
          Returns request specialization - unique string.
 void setLength(int length)
           
 void setOffset(int offset)
           
 
Methods inherited from class sk.uniba.euromath.editor.textEditor.requests.editTextRequests.EditTextRequest
getSource
 
Methods inherited from class org.eclipse.gef.Request
getExtendedData, getType, setExtendedData, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeleteTextRequest

public DeleteTextRequest(ITextPieceKeeper source,
                         int offset,
                         int length,
                         Direction direction)
Constructor.

Parameters:
source - ITextPieceKeeper where was the deletion called
offset - offset in text piece(ITextPieceKeeper's text) from where text should be deleted, must be valid (in range of text piece). Character at this offset position is also deleted.
size - length of text to delete(absolute value of size) Length can have any positive value(not bounded by text piece), but text at that length must exists (bounded by text of whole document), otherwise exception is thrown in process of execution. NOT ZERO.
direction - of deletion, one of Direction.Left, Direction.Right
Method Detail

getLength

public int getLength()
Returns length of text to delete.

Returns:
length of text to delete.

getOffset

public int getOffset()
Returns position in text piece from where text should be deleted. Character at this offset position should be also deleted.

Returns:
offset in text piece (ITextPieceKeeper's text)

getDirection

public Direction getDirection()

getSpecialization

public String getSpecialization()
Description copied from interface: IRequestSpecialization
Returns request specialization - unique string.

Specified by:
getSpecialization in interface IRequestSpecialization
Returns:
request specialization string

setOffset

public void setOffset(int offset)
Parameters:
offset - the offset to set

setLength

public void setLength(int length)
Parameters:
length - the length to set


Copyright © 2003-2006 null. All Rights Reserved.