|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.malai.action.Action
public abstract class Action
An action is based on the command design pattern: it is an object that
encapsulates information to execute a task and to undo/redo it if
necessary.
This file is part of Malai.
Copyright (c) 2009-2012 Arnaud BLOUIN
Malai is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later version.
Malai is distributed without any warranty; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
Nested Class Summary | |
---|---|
static class |
Action.ActionStatus
Defines the different state of the action. |
Field Summary | |
---|---|
protected Action.ActionStatus |
status
Provides the state of the action. |
Constructor Summary | |
---|---|
Action()
The default constructor. |
Method Summary | |
---|---|
void |
abort()
Aborts the action. |
boolean |
cancelledBy(Action action)
Defines if the given action can cancel the calling action. |
abstract boolean |
canDo()
|
protected abstract void |
doActionBody()
This method contains the core code to execute when the action is executed. |
boolean |
doIt()
Executes the action. |
void |
done()
Sets the action to "done". |
void |
flush()
When an action is no more useful it can be flushes to release the used data. |
Action.ActionStatus |
getStatus()
Provides the state of the action. |
boolean |
hadEffect()
|
boolean |
isDone()
|
abstract boolean |
isRegisterable()
Specifies if the action must be saved in the action register. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Action.ActionStatus status
Constructor Detail |
---|
public Action()
Method Detail |
---|
public void flush()
public abstract boolean isRegisterable()
public boolean doIt()
protected abstract void doActionBody()
public abstract boolean canDo()
public boolean hadEffect()
public boolean cancelledBy(Action action)
action
- The action to test.
public void done()
public boolean isDone()
public java.lang.String toString()
toString
in class java.lang.Object
public void abort()
public Action.ActionStatus getStatus()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |