sk.uniba.euromath.editor.textEditor.commands
Class InsertTextCommand

java.lang.Object
  extended by org.eclipse.gef.commands.Command
      extended by sk.uniba.euromath.editor.textEditor.commands.InsertTextCommand

public class InsertTextCommand
extends org.eclipse.gef.commands.Command

Command to insert text and move caret to correct position. Use canExecute to test if insertion can be performed.

Author:
Tomáš Studva 1.10.2005

Constructor Summary
InsertTextCommand(ITextPieceKeeper pieceKeeper, int position, String textToInsert, XMLAccess xmlAccess, CaretManager caretManager)
          Constructor.
InsertTextCommand(String id, int position, String textToInsert, XMLAccess xmlAccess, CaretManager caretManager)
          Constructor.
 
Method Summary
 boolean canExecute()
           
 void execute()
           
 void undo()
           
 
Methods inherited from class org.eclipse.gef.commands.Command
canUndo, chain, dispose, getDebugLabel, getLabel, redo, setDebugLabel, setLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InsertTextCommand

public InsertTextCommand(ITextPieceKeeper pieceKeeper,
                         int position,
                         String textToInsert,
                         XMLAccess xmlAccess,
                         CaretManager caretManager)
Constructor. Target of insertion = piece keeper's text.

Parameters:
pieceKeeper - pieceKeeper holding text where insertion will be done
position - position of insertion in pieceKeeper's rendered text
textToInsert - text to insert
xmlAccess - XMLAccess instance

InsertTextCommand

public InsertTextCommand(String id,
                         int position,
                         String textToInsert,
                         XMLAccess xmlAccess,
                         CaretManager caretManager)
Constructor. Target of insertion = textual node's text.

Parameters:
id - of textual node holding text where insertion will be done
position - position of insertion in textual node's text
textToInsert - text to insert
xmlAccess - XMLAccess instance
Method Detail

execute

public void execute()
Overrides:
execute in class org.eclipse.gef.commands.Command

canExecute

public boolean canExecute()
Overrides:
canExecute in class org.eclipse.gef.commands.Command

undo

public void undo()
Overrides:
undo in class org.eclipse.gef.commands.Command


Copyright © 2003-2006 null. All Rights Reserved.