palmed.edit.selection
Class CharacterInsertion

java.lang.Object
  extended by palmed.edit.selection.AbstractAction
      extended by palmed.edit.selection.CharacterInsertion
All Implemented Interfaces:
IAction

public final class CharacterInsertion
extends AbstractAction

This class implements an action to insert a character at a given position.

Version:
$Revision$ $Date$
Author:
Mathieu Champlon

Constructor Summary
CharacterInsertion(ISelection selection, IText text, char value, Coordinate insertion)
          Create a type action.
 
Method Summary
 boolean merge(IAction action)
          Merge another action.
protected  void onPerform()
          Perform the action.
protected  boolean onRedo()
          Redo the action.
protected  boolean onUndo()
          Undo the action.
 
Methods inherited from class palmed.edit.selection.AbstractAction
backupData, overwriteFinalState, perform, prependData, redo, restoreData, undo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CharacterInsertion

public CharacterInsertion(ISelection selection,
                          IText text,
                          char value,
                          Coordinate insertion)
Create a type action.

Parameters:
selection - the selection
text - the text
value - the character to insert
insertion - the insertion position
Method Detail

onPerform

protected void onPerform()
Perform the action.

Specified by:
onPerform in class AbstractAction

onUndo

protected boolean onUndo()
Undo the action.

Specified by:
onUndo in class AbstractAction
Returns:
Whether the initial state must be restored or not

onRedo

protected boolean onRedo()
Redo the action.

Specified by:
onRedo in class AbstractAction
Returns:
Whether the final state must be restored or not

merge

public boolean merge(IAction action)
Merge another action.

Parameters:
action - the action to merge
Returns:
whether the merging was possible or not


Copyright © 2004-2006 PalmEd. All Rights Reserved.