SalesPoint Framework v3.0

data.stdforms.singletableformsheet
Class DefaultRemoveCatalogItemStrategy

java.lang.Object
  |
  +--sale.stdforms.FormSheetStrategy
        |
        +--data.stdforms.singletableformsheet.EditButtonStrategy
              |
              +--data.stdforms.singletableformsheet.DefaultRemoveCatalogItemStrategy

public class DefaultRemoveCatalogItemStrategy
extends EditButtonStrategy

Strategy that can be associated to the "Remove" button of a SingleTableFormSheet that displays the contents of a Catalog.

Hooks:
Removing Items From Container - Button
Since:
v2.0
Version:
2.0 20/08/1999
Author:
Steffen Zschaler
See Also:
Serialized Form

Inner classes inherited from class sale.stdforms.FormSheetStrategy
FormSheetStrategy.ErrorHandler
 
Field Summary
protected  Catalog m_cCatalog
          The Catalog that is being edited.
 
Fields inherited from class sale.stdforms.FormSheetStrategy
DEFAULT_ERROR_HANDLER, m_ehErrHandler, MSG_POPUP_ERROR_HANDLER
 
Constructor Summary
DefaultRemoveCatalogItemStrategy(Catalog c)
          Create a new DefaultRemoveCatalogItemStrategy.
 
Method Summary
protected  void doRemove(SaleProcess p, CatalogItem ci, DataBasket db)
          Perform the actual removal.
protected  Gate getCheckGate(SingleTableFormSheet stfs)
          Get the Gate that checks whether the removal is allowed.
protected  String getConfirmationCaption(SingleTableFormSheet stfs, CatalogItem ci)
          Get the caption for the default confirmation MsgForm.
protected  String getConfirmationText(SingleTableFormSheet stfs, CatalogItem ci)
          Get the text for the default confirmation MsgForm.
 Transition getEditProcess(SingleTableFormSheet stfs, SaleProcess p, SalesPoint sp)
           
protected  Transition getRemoveTransition(SingleTableFormSheet stfs)
          Get the transition that performs the actual removal.
 
Methods inherited from class sale.stdforms.FormSheetStrategy
error, setErrorHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_cCatalog

protected Catalog m_cCatalog
The Catalog that is being edited.
Constructor Detail

DefaultRemoveCatalogItemStrategy

public DefaultRemoveCatalogItemStrategy(Catalog c)
Create a new DefaultRemoveCatalogItemStrategy.
Parameters:
c - the Catalog to be edited. Must be the same that is displayed by the SingleTableFormSheet.
Method Detail

getEditProcess

public Transition getEditProcess(SingleTableFormSheet stfs,
                                 SaleProcess p,
                                 SalesPoint sp)
Override:
Never.
Overrides:
getEditProcess in class EditButtonStrategy

getCheckGate

protected Gate getCheckGate(SingleTableFormSheet stfs)
Get the Gate that checks whether the removal is allowed. If this is the case, the Gate must be left through getRemoveTransition(data.stdforms.SingleTableFormSheet), otherwise, a transition to the SingleTableFormSheet's gate should be triggered.
Override:
Sometimes.
The default implementation puts up a MsgForm asking for the user to confirm the removal. Caption and text of the message are obtained via getConfirmationCaption(data.stdforms.SingleTableFormSheet, data.CatalogItem) and getConfirmationText(data.stdforms.SingleTableFormSheet, data.CatalogItem), resp.
Parameters:
stfs - the FormSheet that triggered the operation.

getConfirmationCaption

protected String getConfirmationCaption(SingleTableFormSheet stfs,
                                        CatalogItem ci)
Get the caption for the default confirmation MsgForm.
Override:
Sometimes.
The default implementation returns (stfs.getCaption() + " - Confirmation").
Parameters:
stfs - the FormSheet that triggered the operation.
ci - the CatalogItem that is going to be removed.

getConfirmationText

protected String getConfirmationText(SingleTableFormSheet stfs,
                                     CatalogItem ci)
Get the text for the default confirmation MsgForm.
Override:
Sometimes.
The default implementation returns ("Are you sure, you want to remove \"" + ci.getName() + "\"?").
Parameters:
stfs - the FormSheet that triggered the operation.
ci - the CatalogItem that is going to be removed.

getRemoveTransition

protected Transition getRemoveTransition(SingleTableFormSheet stfs)
Get the transition that performs the actual removal. This basically calls doRemove(sale.SaleProcess, data.CatalogItem, data.DataBasket).
Override:
Never.
Instead, override doRemove(sale.SaleProcess, data.CatalogItem, data.DataBasket).
Parameters:
stfs - the FormSheet that triggered the operation.

doRemove

protected void doRemove(SaleProcess p,
                        CatalogItem ci,
                        DataBasket db)
Perform the actual removal.

Any error condition should be passed on to FormSheetStrategy.error(sale.SaleProcess, int) in FormSheetStrategy.

Override:
Sometimes.
Parameters:
p - the process in which this sub-process will be implanted.
ci - the CatalogItem to be removed. Can be null.
db - the DataBasket relative to which to perform the operation.

SalesPoint Framework v3.0