SalesPoint v3.3 API

sale.stdforms
Class FormSheetStrategy

java.lang.Object
  extended by sale.stdforms.FormSheetStrategy
All Implemented Interfaces:
Serializable, ProcessErrorCodes
Direct Known Subclasses:
EditButtonStrategy, MoveStrategy

public abstract class FormSheetStrategy
extends Object
implements ProcessErrorCodes, Serializable

Abstract super class of all strategies that are used with FormSheets.

Strategies are usually used to parameterize certain responses to user actions in standard FormSheets. Good examples are the parameterized responses to the buttons in a TwoTableFormSheet.

This abstract base class knows only about error handling. It uses error handling strategies so that subclasses can easily be adapted to behave differently in case of an error.

Since:
v2.0
Author:
Steffen Zschaler
See Also:
Serialized Form

Nested Class Summary
static interface FormSheetStrategy.ErrorHandler
          Interface that defines a error handling strategy for a FormSheetStrategy.
 
Field Summary
static FormSheetStrategy.ErrorHandler DEFAULT_ERROR_HANDLER
          The default error handler.
protected  FormSheetStrategy.ErrorHandler m_ehErrHandler
          The current error handler.
static FormSheetStrategy.ErrorHandler MSG_POPUP_ERROR_HANDLER
          An alternative error handler that will pop up a modeless MsgForm in the process.
 
Fields inherited from interface sale.ProcessErrorCodes
DATABASKET_CONFLICT_ERROR, DUPLICATE_KEY_EXCEPTION, ERR_INTERNAL, ERR_LOWERBOUND, ERR_NOERROR, ERR_UPPERBOUND, NOT_ENOUGH_ELEMENTS_ERROR, REMOVE_VETO_EXCEPTION
 
Constructor Summary
FormSheetStrategy()
           
 
Method Summary
 void error(SaleProcess p, int nErrorCode)
          Handle an error.
 void setErrorHandler(FormSheetStrategy.ErrorHandler ehErrHandler)
          Set the current error handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ERROR_HANDLER

public static final FormSheetStrategy.ErrorHandler DEFAULT_ERROR_HANDLER
The default error handler. This will pass the error on to the process' SaleProcess.error(int) method.


MSG_POPUP_ERROR_HANDLER

public static final FormSheetStrategy.ErrorHandler MSG_POPUP_ERROR_HANDLER
An alternative error handler that will pop up a modeless MsgForm in the process.


m_ehErrHandler

protected FormSheetStrategy.ErrorHandler m_ehErrHandler
The current error handler. Defaults to the DEFAULT_ERROR_HANDLER.

Constructor Detail

FormSheetStrategy

public FormSheetStrategy()
Method Detail

setErrorHandler

public void setErrorHandler(FormSheetStrategy.ErrorHandler ehErrHandler)
Set the current error handler.

Parameters:
ehErrHandler - the new error handler.
Override:
Never

error

public void error(SaleProcess p,
                  int nErrorCode)
Handle an error.

This is delegated to the error handler.

Parameters:
p - the process in which the error occurred.
nErrorCode - an int describing the error.
Override:
Never

SalesPoint v3.3 API