|
SalesPoint Framework v3.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sale.stdforms.FormSheetStrategy data.stdforms.singletableformsheet.EditButtonStrategy data.stdforms.singletableformsheet.AbstractAddCatalogItemStrategy
A strategy that can be attached to the "Add" button
of
a SingleTableFormSheet
that displays a Catalog's
contents.
This strategy is abstract since the creation of the CatalogItem
is application specific.
It must be defined by overriding createCatalogItem(java.lang.String)
.
Nested Class Summary |
Nested classes inherited from class sale.stdforms.FormSheetStrategy |
FormSheetStrategy.ErrorHandler |
Field Summary | |
static String |
KEY_LABEL
The resource bundle key of the label to be shown in the "Define Key" FormSheet. |
protected Catalog |
m_cCatalog
The Catalog to be edited. |
Fields inherited from class sale.stdforms.FormSheetStrategy |
DEFAULT_ERROR_HANDLER, m_ehErrHandler, MSG_POPUP_ERROR_HANDLER |
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 | |
AbstractAddCatalogItemStrategy(Catalog c)
Create a new AbstractAddCatalogItemStrategy. |
Method Summary | |
protected void |
addToCatalog(SaleProcess p,
CatalogItem ci)
Add the specified CatalogItem to the Catalog. |
protected abstract CatalogItem |
createCatalogItem(String sKey)
Create a new CatalogItem of the given key. |
protected Gate |
getCreateCIGate(SingleTableFormSheet stfs)
Get the first Gate in the sub-process. |
protected Gate |
getEditCIGate(CatalogItem ci,
SingleTableFormSheet stfs,
Transition tOk)
Get a Gate at which a newly created CatalogItem can be edited by the user. |
Transition |
getEditProcess(SingleTableFormSheet stfs,
SaleProcess p,
SalesPoint sp)
Get the first transition of the process that will perform the editing. |
protected String |
getNewKey(SingleTableFormSheet stfs,
SaleProcess p)
Get the key of the new item. |
protected String |
getResourceString(String sKey)
Get the resource String for the specified key. |
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 |
public static final String KEY_LABEL
protected Catalog m_cCatalog
Constructor Detail |
public AbstractAddCatalogItemStrategy(Catalog c)
c
- the Catalog to be edited. Must be the same that is displayed in the SingleTableFormSheet
.Method Detail |
public Transition getEditProcess(SingleTableFormSheet stfs, SaleProcess p, SalesPoint sp)
EditButtonStrategy
Gates
and Transitions
and display any number of Form-
and MenuSheets
. Normally, the sub-process should end at the gate at which the
SingleTableFormSheet is being displayed, which can be obtained by
SingleTableFormSheet.getGate()
.
getEditProcess
in class EditButtonStrategy
stfs
- the SingleTableFormSheet that triggers the sub-process.p
- the process into which the sub-process will be implanted.sp
- the SalesPoint at which the FormSheet is displayed, if any.protected Gate getCreateCIGate(SingleTableFormSheet stfs)
stfs
- the FormSheet that triggered the sub-process.getNewKey(data.stdforms.SingleTableFormSheet, sale.SaleProcess)
, createCatalogItem(java.lang.String)
, getEditCIGate(data.CatalogItem, data.stdforms.SingleTableFormSheet, sale.Transition)
and/or addToCatalog(sale.SaleProcess, data.CatalogItem)
.protected String getNewKey(SingleTableFormSheet stfs, SaleProcess p) throws InterruptedException
stfs
- the FormSheet that triggered the sub-process.p
- the process into which the sub-process was embedded.
InterruptedException
protected abstract CatalogItem createCatalogItem(String sKey)
sKey
- the key for which to create a new CatalogItem.
protected Gate getEditCIGate(CatalogItem ci, SingleTableFormSheet stfs, Transition tOk)
ci
- the CatalogItem to be edited.stfs
- the FormSheet that triggered the sub-process. A transition to this FormSheet's gate must be
leaving the Gate if the user cancels the operation.tOk
- the Transition that must be leaving the Gate if the user finished editing and did not cancel
the operation or enter invalid data.tOk
.protected void addToCatalog(SaleProcess p, CatalogItem ci)
Any error condition should be passed on to FormSheetStrategy.error(sale.SaleProcess, int)
in
FormSheetStrategy
.
p
- the process into which the sub-process was embedded.ci
- the CatalogItem to be added to the Catalog.protected String getResourceString(String sKey)
KEY_LABEL
.
|
SalesPoint Framework v3.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |