net.sf.doolin.gui.edit
Class AbstractGUIEdit

java.lang.Object
  extended by net.sf.doolin.bus.bean.Bean
      extended by net.sf.doolin.gui.edit.AbstractGUIEdit
All Implemented Interfaces:
Serializable, IBean, GUIEdit

public abstract class AbstractGUIEdit
extends Bean
implements GUIEdit

Abstract ancestor for GUIEdit implementations, which provides support for the message and for the life-cycle.

Author:
Damien Coraboeuf
See Also:
Serialized Form

Constructor Summary
AbstractGUIEdit(String msgKey, Object... msgParameters)
          Constructor.
 
Method Summary
 boolean canRedo()
          Can this task be done again
 boolean canUndo()
          Can this task be undone
protected abstract  void doTask()
          Runs the main task.
 String getDisplayName()
          Gets a display name for this task
 boolean isDone()
          Checks if the task has been done.
 void perform()
          Performs this task
 void redo()
          Redoes this task
protected  void setDone(boolean done)
          Sets if the task has been done.
 void undo()
          Undoes this task
protected abstract  void undoTask()
          Undoes the main task.
 
Methods inherited from class net.sf.doolin.bus.bean.Bean
getBeanNotificationSupport, getParentBean, notify, setParentBean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractGUIEdit

public AbstractGUIEdit(String msgKey,
                       Object... msgParameters)
Constructor.

Parameters:
msgKey - Key for the message
msgParameters - Parameters for the message
Method Detail

canRedo

public boolean canRedo()
Description copied from interface: GUIEdit
Can this task be done again

Specified by:
canRedo in interface GUIEdit
Returns:
true if this task can be done again

canUndo

public boolean canUndo()
Description copied from interface: GUIEdit
Can this task be undone

Specified by:
canUndo in interface GUIEdit
Returns:
true if this task can be undone

doTask

protected abstract void doTask()
Runs the main task.


getDisplayName

public String getDisplayName()
Description copied from interface: GUIEdit
Gets a display name for this task

Specified by:
getDisplayName in interface GUIEdit
Returns:
Display name

isDone

public boolean isDone()
Checks if the task has been done.

Returns:
true if the task has been done.

perform

public void perform()
Description copied from interface: GUIEdit
Performs this task

Specified by:
perform in interface GUIEdit

redo

public void redo()
Description copied from interface: GUIEdit
Redoes this task

Specified by:
redo in interface GUIEdit

setDone

protected void setDone(boolean done)
Sets if the task has been done.

Parameters:
done - true if the task has been done.

undo

public void undo()
Description copied from interface: GUIEdit
Undoes this task

Specified by:
undo in interface GUIEdit

undoTask

protected abstract void undoTask()
Undoes the main task.



Copyright © 2011. All Rights Reserved.