|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.commands.dataselectors.SimpleCalculatedItemSelectorCommand
public class SimpleCalculatedItemSelectorCommand
This class implements the command for processing calculated items in the simple calculated
item selector command. This command is only supported when the associated data model is
an instance of BusinessQueryProviderInterface
.
The command is responsible for processing actions, via the Action Provider Framework, as they are initiated by the visual in response to user input. Actions include show, process, commit, and cancel. Each action causes a corresponding method on this command to be invoked.
The show action creates an instance of CalculatedItemListInterface
to provide to the visual
and then sets the state of the simple calculated item selector so it can be displayed to the
user.
The commit action is invoked when the user leaves the selector visual by pressing the OK button. Commit first validates the items coming from the selector client visual; if there are invalid items, an event is generated to notify the visual that the user needs to correct the invalid items. If all the items are valid, then the command processes each item in an appropriate fashion in order to update the business query.
The cancel action is invoked when the user leaves the selector visual by pressing the Cancel button. There is no specific processing by this command for the cancel action.
The process action is not used by this command.
SimpleCalculatedItemSelectorPanel
,
BusinessQueryProviderInterface
,
CalculatedItemListInterface
,
BusinessQueryToCalculatedItemListAdapter
Field Summary | |
---|---|
static java.lang.String |
ADD_STATE
Specifies that the given item is to be added to the list of calculated items. |
protected java.lang.String[] |
basePeriodList
|
protected CalculatedItemListInterface |
calculatedItemList
The list of calculated item objects processed by this command. |
static java.lang.String |
DELETE_STATE
Specifies that the given item is to be replaced in the list of calculated items. |
protected java.lang.String |
descriptionEntry
Used to access the value of the description entry field on the visual driving this command. |
protected java.lang.String[] |
descriptionList
Used to access the value of the descriptions of the calculated items on the visual driving this command. |
protected java.lang.String |
expressionArea
Used to access the value of the expression area field on the visual driving this command. |
protected java.lang.String[] |
expressionList
Used to access the value of the expressions of the calculated items on the visual driving this command. |
protected java.lang.String[] |
formatList
Used to access the value of the expressions of the calculated items on the visual driving this command. |
protected java.lang.String[] |
functionList
|
protected java.lang.String[] |
idList
Used to access the value of the ids of the calculated items on the visual driving this command. |
static java.lang.String |
INVALID_ITEM_KEY
Key used to identify list of invalid items to SimpleCalculatedItemSelectorPanel so that appropriate action can be taken by the view. |
protected java.util.List |
invalidItemList
Stores a list of any items received from the client which are invalid calculated items, usually because the expression for the calculated item is invalid. |
protected java.lang.String[] |
measureItems
|
protected java.lang.String |
nameEntry
Used to access the value of the name entry field on the visual driving this command. |
protected java.lang.String[] |
nameList
Used to access the value of the names of the calculated items on the visual driving this command. |
static java.lang.String |
RB_KEY
Key used to find resources in the resource bundle for this command. |
static java.lang.String |
REPLACE_STATE
Specifies that the given item is to be replaced in the list of calculated items. |
protected java.lang.String[] |
stateList
Used to access the value of the states for the calculated items on the visual driving this command. |
static java.lang.String |
UPDATE_STATE
Specifies that the given item is to be updated in the list of calculated items. |
Fields inherited from class com.sas.commands.dataselectors.BaseSelectorCommand |
---|
actionClass, CANCEL_MODE, COMMIT_MODE, complete, contentsChanged, eventInfo, eventSource, modal, mode, model, PROCESS_MODE, selector, selectorModel, SHOW_MODE |
Fields inherited from interface com.sas.actionprovider.CommandStatusInterface |
---|
DISABLED, ENABLED, IS_CURRENT_STATE_DISABLED, MODEL_MEMBER_DISABLED, MODEL_STATE_DISABLED, MODEL_TYPE_DISABLED |
Fields inherited from interface com.sas.commands.DynamicAttributeCommandInterface |
---|
COMMAND_NAME_PREFIX |
Constructor Summary | |
---|---|
SimpleCalculatedItemSelectorCommand()
Constructs the default version of the command. |
|
SimpleCalculatedItemSelectorCommand(java.lang.String name)
Constructor that accepts a command name. |
|
SimpleCalculatedItemSelectorCommand(java.lang.String name,
java.lang.String actionClass)
Constructor that accepts a command name and an action class type. |
Method Summary | |
---|---|
protected void |
addItem(int clientIndex)
Adds a new calculated item from the client to the list. |
void |
cancel(java.lang.Object o)
|
protected void |
commit(java.lang.Object o)
Invoked when the user presses OK on the selector. |
protected void |
deleteItem(int clientIndex)
Deletes an existing calculated item in the list. |
CalculatedItemListInterface |
getAdapter(java.lang.Object model)
Returns an instance of a CalculatedItemListInterface based on the given model. |
java.lang.String[] |
getBasePeriodList()
|
protected int |
getCalculatedItemIndex(java.lang.String calculatedItemId)
Returns the index of a calculated item in the server-side calculated item list. |
int |
getCommandStatus(ActionSupportFilter filter)
Returns a int value indicating whether the command is enabled for the given area as specified by the current area information encapsulated in the ActionSupportFilter. |
java.lang.String |
getDescriptionEntry()
Get the value entered by the user in the description entry field. |
java.lang.String[] |
getDescriptionList()
Gets the list of calculated item descriptions that were sent from the client to the server. |
java.lang.String |
getExpressionArea()
Get the value entered by the user in the expression area. |
java.lang.String[] |
getExpressionList()
Gets the list of calculated item expressions that were sent from the client to the server. |
java.lang.String |
getFormatEntry()
|
java.lang.String[] |
getFormatList()
Gets the list of calculated item formats that were sent from the client to the server. |
java.lang.String[] |
getFunctionList()
|
java.lang.String[] |
getIdList()
Gets the list of calculated item ids that were sent from the client to the server. |
com.sas.iquery.metadata.business.DataItem |
getMeasureItem(java.lang.String measureName,
CalculatedItemV2Interface item)
|
java.lang.String |
getNameEntry()
Get the value entered by the user in the name entry field. |
java.lang.String[] |
getNameList()
Gets the list of calculated item names that were sent from the client to the server. |
java.lang.String[] |
getStateList()
Gets the list of calculated item states that were sent from the client to the server. |
protected void |
process(java.lang.Object o)
Invoked to display the selector to the user. |
protected void |
processCalculatedItems()
Processes the list of calculated items returned from the client and takes appropriate action based on the state of any given item. |
void |
setBasePeriodList(java.lang.String[] basePeriods)
|
void |
setDescriptionEntry(java.lang.String description)
Set the value entered by the user in the description entry field. |
void |
setDescriptionList(java.lang.String[] descriptions)
Sets the list of calculated item descriptions that were sent from the client. |
void |
setExpressionArea(java.lang.String expression)
Set the value entered by the user in the expression area. |
void |
setExpressionList(java.lang.String[] expressions)
Sets the list of calculated item expressions that were sent from the client. |
void |
setFormatEntry(java.lang.String formatEntry)
|
void |
setFormatList(java.lang.String[] formats)
Sets the list of calculated item formats that were sent from the client. |
void |
setFunctionList(java.lang.String[] functionList)
|
void |
setIdList(java.lang.String[] names)
Sets the list of calculated item ids that were sent from the client. |
void |
setNameEntry(java.lang.String name)
Set the value entered by the user in the name entry field. |
void |
setNameList(java.lang.String[] names)
Sets the list of calculated item names that were sent from the client. |
void |
setStateList(java.lang.String[] states)
Sets the list of calculated item states that were sent from the client. |
protected void |
show(java.lang.Object o)
Invoked to display the selector to the user. |
protected void |
updateItem(int clientIndex)
Updates an existing calculated item in the list. |
Methods inherited from class com.sas.commands.dataselectors.BaseSelectorCommand |
---|
cancel, closeSelector, execute, getEventInfo, getEventSource, getMode, getModel, getSelector, getSelectorModel, isComplete, isContentsChanged, isModal, setComplete, setModal, setMode, setModel, setSelector, setSelectorModel |
Methods inherited from class com.sas.commands.BaseCommand |
---|
getLocale, getName, getNextCommandName, getText, isExecutable, isUndoable, setLocale, setName, setText, undo |
Methods inherited from class com.sas.entities.BaseEntity |
---|
clone, containsAttributeNamed, equals, equals, getAttribute, getAttribute, getAttributeCount, getAttributes, getEntityKey, getPropertyDescriptors, getStringAttribute, listAttributeNames, removeAllAttributes, removeAttribute, reset, sameEntity, setAttribute, setAttributes, setEntityKey, toString |
Methods inherited from interface com.sas.entities.BaseEntityValueInterface |
---|
getAttribute, setAttribute |
Methods inherited from interface com.sas.util.Command |
---|
clone |
Field Detail |
---|
public static final java.lang.String RB_KEY
public static final java.lang.String INVALID_ITEM_KEY
protected CalculatedItemListInterface calculatedItemList
protected java.lang.String nameEntry
protected java.lang.String descriptionEntry
protected java.lang.String expressionArea
protected java.lang.String[] nameList
protected java.lang.String[] descriptionList
protected java.lang.String[] expressionList
protected java.lang.String[] stateList
protected java.lang.String[] idList
protected java.lang.String[] formatList
protected java.util.List invalidItemList
protected java.lang.String[] functionList
protected java.lang.String[] measureItems
protected java.lang.String[] basePeriodList
public static final java.lang.String ADD_STATE
public static final java.lang.String UPDATE_STATE
public static final java.lang.String DELETE_STATE
public static final java.lang.String REPLACE_STATE
Constructor Detail |
---|
public SimpleCalculatedItemSelectorCommand()
public SimpleCalculatedItemSelectorCommand(java.lang.String name)
name
- the name of the commandpublic SimpleCalculatedItemSelectorCommand(java.lang.String name, java.lang.String actionClass)
name
- the name of the commandactionClass
- the class name of the associated actionMethod Detail |
---|
protected void show(java.lang.Object o)
show
in class BaseSelectorCommand
o
- not used by this methodprotected void process(java.lang.Object o)
process
in class BaseSelectorCommand
o
- not used by this methodprotected void commit(java.lang.Object o) throws java.io.IOException
commit
in class BaseSelectorCommand
o
- not used by this method.
java.io.IOException
public com.sas.iquery.metadata.business.DataItem getMeasureItem(java.lang.String measureName, CalculatedItemV2Interface item)
public CalculatedItemListInterface getAdapter(java.lang.Object model)
model
- is an object from which a CalculatedItemListInterface can be created.
The model must be an instance of a BusinessQueryProviderInterface.
public java.lang.String getNameEntry()
public void setNameEntry(java.lang.String name)
name
- is the user entered value for the name entry field.public java.lang.String getDescriptionEntry()
public void setDescriptionEntry(java.lang.String description)
description
- is the user entered value for the description entry field.public java.lang.String getExpressionArea()
public void setExpressionArea(java.lang.String expression)
expression
- is the user entered value for the expression area.public java.lang.String[] getNameList()
public void setNameList(java.lang.String[] names)
names
- is an array of calculated item names from the client.public java.lang.String[] getDescriptionList()
public void setDescriptionList(java.lang.String[] descriptions)
descriptions
- is an array of calculated item descriptions from the client.public java.lang.String[] getExpressionList()
public void setExpressionList(java.lang.String[] expressions)
expressions
- is an array of calculated item expressions from the client.public java.lang.String[] getStateList()
ADD_STATE
,
UPDATE_STATE
,
DELETE_STATE
,
REPLACE_STATE
public java.lang.String[] getFormatList()
public void setFormatList(java.lang.String[] formats)
names
- is an array of calculated item formats from the client.public java.lang.String[] getFunctionList()
public java.lang.String[] getBasePeriodList()
public void setStateList(java.lang.String[] states)
states
- is an array of calculated item states from the client.ADD_STATE
,
UPDATE_STATE
,
DELETE_STATE
,
REPLACE_STATE
public void setFunctionList(java.lang.String[] functionList)
public void setBasePeriodList(java.lang.String[] basePeriods)
public java.lang.String[] getIdList()
public void setIdList(java.lang.String[] names)
names
- is an array of calculated item ids from the client.protected int getCalculatedItemIndex(java.lang.String calculatedItemId)
calculatedItemId
- is a string representing the id of the item to find.
protected void processCalculatedItems()
ADD_STATE
,
UPDATE_STATE
,
DELETE_STATE
,
REPLACE_STATE
,
addItem(int)
,
updateItem(int)
,
deleteItem(int)
protected void addItem(int clientIndex)
clientIndex
- is the index of the item to be added from the array received from
the clientprotected void updateItem(int clientIndex)
clientIndex
- is the index of the item to be updated from the array received from
the clientprotected void deleteItem(int clientIndex)
Note: items can only be deleted from the server list if they have previously been added. In other words, if an item is added on the client and then deleted on the client, within the same selector invocation, it will never be sent to the server to be deleted. However, if it is added, and the user launches the selector again to delete the item, then this method will process that deletion.
clientIndex
- is the index of the item to be deleted from the array received from
the clientpublic int getCommandStatus(ActionSupportFilter filter)
getCommandStatus
in interface CommandStatusInterface
filter
- The ActionSupportFilter that encapsulates all the necessary
information to describe the current area.
BaseAction.setReturnStatus(int)
public java.lang.String getFormatEntry()
public void setFormatEntry(java.lang.String formatEntry)
formatEntry
- The formatEntry to set.public void cancel(java.lang.Object o)
cancel
in class BaseSelectorCommand
o
- ignored in this implementation
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |