market
Class SProcessMarket
java.lang.Object
|
+--sale.SaleProcess
|
+--market.SProcessMarket
- All Implemented Interfaces:
- LogContext, Loggable, ProcessErrorCodes, Serializable
- Direct Known Subclasses:
- SProcessCustomer, SProcessCustomerEditProfile, SProcessLogOn, SProcessManager, SProcessSeller, SProcessWorker
- public abstract class SProcessMarket
- extends SaleProcess
Helper class that supports the division of FormSheet
and SaleProcess
.
Button actions which are attached to the FormSheets in the process are meant to be
reloaded after the shop's state has been saved. Therefore it is necessary to put the assignment of the
button actions to Buttons into a FormSheetContentCreator
.
As this assignment code is always the same, it has been put into this extra class. That makes the original
code more concise.
- See Also:
- Serialized Form
Methods inherited from class sale.SaleProcess |
attach, attach, canQuit, detachBasket, detachContext, error, error, error, getBasket, getCommitGate, getContext, getCurrentGate, getErrorGate, getErrorMsg, getInitialGate, getLogData, getLogGate, getName, getQuitGate, getRollbackGate, getStopGate, isAlive, isResumed, isRunning, isSuspended, log, onFinished, onResumeOrStart, onSuspended, printErrorInfo, quit, resume, start, suspend |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SProcessMarket
public SProcessMarket(String name)
- Parameters:
name
- the name of the process.
setAction
protected void setAction(FormSheet formSheet,
Action ac,
int btn_id)
- Assigns an
Action
to a FormSheet's button using a FormSheetContentCreator
.
- Parameters:
formSheet
- the FormSheet to which the action should be assigned.ac
- the action to be assigned.btn_id
- the button ID to which the action should be assigned. A button with this
ID must be defined in the FormSheet itself or a NullPointerException
will occur.
setTransition
protected void setTransition(FormSheet formSheet,
Transition trans,
int btn_id)
- Assigns an
Action
, which consists only of a Transition
to a FormSheet's
button using a FormSheetContentCreator
.
Caution has to be taken when a circular reference occurs.
Example: Method getGateA() has a setTransition-method which changes to gateB using method
getGateB(). This method getGateB() contains a setTransition-method which changes to gateA using
the getGateA()-method. This causes an infinite loop.
In contrast the setAction()
method works well,
because the transition in it is not run on initialization, but only when the button has been pressed.
- Parameters:
formSheet
- the FormSheet from which the Transition starts.trans
- the Transition to be performed.btn_id
- the button ID that causes the transition to start. A button with this
ID must be defined in the FormSheet itself or a NullPointerException
will occur.