edu.umd.cfar.lamp.apploader.undo
Interface LabeledUndoableEdit


public interface LabeledUndoableEdit

Alternative to java's undoable edit, this edit interface works better with the LAL framework, offering a URI as GUID to allow external manipulation with the preferences. It is a little simplified, for now.

Author:
davidm@cfar.umd.edu

Method Summary
 boolean canRedo()
          Checks to see if the action may be applied in the given state of the system.
 boolean canUndo()
          Checks to see if the action may be undone in the given state of the system.
 void die()
          Kill the undo.
 java.lang.Object getClient()
          Gets the recipient of the action.
 java.lang.Object getSource()
          Gets the source of the action.
 java.lang.String getUri()
          Get the URI that identifies the type of action this object represents.
 void redo()
          Apply the action again.
 void undo()
          Undo the action.
 

Method Detail

die

public void die()
Kill the undo. Not sure why this is necessary; assume has something to do with java's lack of descructors, so can be null-op in most implementations, as it will only be called before all references are removed.


canRedo

public boolean canRedo()
Checks to see if the action may be applied in the given state of the system.

Returns:
true if the action may be redone

canUndo

public boolean canUndo()
Checks to see if the action may be undone in the given state of the system.

Returns:
true if the action may be undone

redo

public void redo()
Apply the action again.

Throws:
java.lang.IllegalStateException - if the action cannot be redone

undo

public void undo()
Undo the action.

Throws:
java.lang.IllegalStateException - if the action cannot be undone

getUri

public java.lang.String getUri()
Get the URI that identifies the type of action this object represents.

Returns:
A valid URI that represents the type of action

getClient

public java.lang.Object getClient()
Gets the recipient of the action.

Returns:
The object that had the action acted upon it.

getSource

public java.lang.Object getSource()
Gets the source of the action.

Returns:
The object where the action originated