|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.actionprovider.strategies.BaseActionStrategy
public abstract class BaseActionStrategy
This class is the base class for all ActionStrategy classes used in the ActionProviderFramework.
ActionStrategy objects may do one or all of the following tasks for the Action object to which they are associated.
Visit the AppDev Studio Developer's Site to access step-by-step examples, white papers and additional usage information at http://support.sas.com/rnd/appdev/.
Note: A snapshot of the AppDev Studio Developers Site is installed on your local Web server when you install AppDev Studio. To access the site from webAF, select Help -> Developer Site .
BaseAction.setActionStrategy(com.sas.actionprovider.strategies.ActionStrategyInterface)
Field Summary | |
---|---|
protected static java.lang.String |
TEMPLATE_DELIMITER
Default marker for tokenizing template patterns in Action attribute values. |
Fields inherited from interface com.sas.actionprovider.ActionStatusKeysInterface |
---|
AREA_DISABLED, DISABLED, ENABLED, IS_CURRENT_STATE_DISABLED, MODEL_MEMBER_DISABLED, MODEL_STATE_DISABLED, MODEL_TYPE_DISABLED, UNSUPPORTED, VIEWER_DISABLED |
Constructor Summary | |
---|---|
BaseActionStrategy()
Default Constructor Calls the Utility Object Constructor with null parameter. |
|
BaseActionStrategy(boolean swing,
java.lang.Object utilObject)
Utility Object Constructor Calls the setUtilObject(java.lang.Object) method
Calls the setSwing(boolean) method
Calls the initialize() method
|
Method Summary | |
---|---|
protected void |
addDynamicValueInfo(java.lang.String valueName,
java.lang.String methodName,
java.lang.Object methodObject,
java.lang.String filterAlias)
Register the information for determining a dynamic value. |
protected void |
addDynamicValueInfo(java.lang.String valueName,
java.lang.String methodName,
java.lang.Object methodObject,
java.lang.String filterAlias,
boolean nullValid)
Register the information for determining a dynamic value. |
int |
getActionStatus(BaseAction action,
ActionSupportFilter filter)
Returns a status value indicating whether the Action is enabled for a specific area as described by various filter attributes. |
protected java.lang.Object |
getCustomAttributeValue(java.lang.String attributeName,
ActionSupportFilter filter)
Returns a value for a specific custom attribute. |
protected java.lang.Object |
getDynamicValue(java.lang.String valueName,
ActionSupportFilter filter,
java.lang.Object defaultValue)
Returns the value of a dynamic Action attribute. |
protected java.lang.Object |
getUtilObject()
Returns the default utility object on which methods are invoked to determine dynamic attribute values and Action status values. |
protected void |
initialize()
Initialize this strategy object. |
void |
initializeAction(BaseAction action,
java.lang.String areaType,
java.util.Locale locale)
Initializes all default settings for an Action. |
protected void |
initializeActionAttributes(BaseAction action,
java.lang.String areaType,
java.util.Locale locale)
Initializes an Action with all its default attributes, default AttributeDescriptor property settings and default values for non-locale-dependent attributes. |
protected boolean |
isSwing()
Returns the boolean indicating whether the strategy should function in swing mode or not. |
void |
setActionAttributes(BaseAction action,
ActionSupportFilter filter)
Sets all the dynamic attributes of the Action. |
void |
setLocaleDependentDefaultAttributes(BaseAction action,
java.lang.String areaType,
java.util.Locale locale)
Sets the Action's default locale dependent attribute values. |
protected void |
setSwing(boolean swing)
Set the boolean indicating whether the strategy should function in swing mode or not. |
protected void |
setUtilObject(java.lang.Object util)
Sets the default utility object on which to invoke the methods that determine dynamic attribute values and Action status values. |
Field Detail |
---|
protected static java.lang.String TEMPLATE_DELIMITER
Constructor Detail |
---|
public BaseActionStrategy()
Default Constructor
Calls the Utility Object Constructor with null parameter.
initialize()
public BaseActionStrategy(boolean swing, java.lang.Object utilObject)
Utility Object Constructor
Calls the setUtilObject(java.lang.Object)
method
Calls the setSwing(boolean)
method
Calls the initialize()
method
swing
- boolean indicating whether the strategy is to be used
in a Swing environment.utilObject
- The default object used for encapsulating
common methods called by the strategy.initialize()
Method Detail |
---|
protected void initialize()
Initialize this strategy object.
This method should be overridden to register the dynamic
value information for specific strategies. Registration
is accomplished via the addDynamicValueInfo(java.lang.String, java.lang.String, java.lang.Object, java.lang.String)
method.
the
#setReturnStatus
public void initializeAction(BaseAction action, java.lang.String areaType, java.util.Locale locale)
Initializes all default settings for an Action.
This base implementation calls the initializeAction() method followed by the setLocaleDependentDefaultAttributes() method.
initializeAction
in interface ActionStrategyInterface
action
- The instance of the Action to be initialized.areaType
- The area in which the Action will be used.locale
- The localeprotected void setUtilObject(java.lang.Object util)
Sets the default utility object on which to invoke the methods that determine dynamic attribute values and Action status values.
util
- the utility objectprotected java.lang.Object getUtilObject()
Returns the default utility object on which methods are invoked to determine dynamic attribute values and Action status values.
protected void setSwing(boolean swing)
swing
- the boolean indicating whether the strategy should function
in swing mode or not.protected boolean isSwing()
protected void initializeActionAttributes(BaseAction action, java.lang.String areaType, java.util.Locale locale)
Initializes an Action with all its default attributes, default AttributeDescriptor property settings and default values for non-locale-dependent attributes. values.
This base implementation does nothing to the Action.
action
- The instance of the Action to be initialized.areaType
- The areaType of the Viewer where the Action will be presented.locale
- The localepublic void setLocaleDependentDefaultAttributes(BaseAction action, java.lang.String areaType, java.util.Locale locale)
Sets the Action's default locale dependent attribute values.
This base implementation does nothing to the Action.
setLocaleDependentDefaultAttributes
in interface ActionStrategyInterface
action
- The instance of the Action to be initialized.locale
- The localeareaType
- The areaType of the Viewer where the Action will be presented.public void setActionAttributes(BaseAction action, ActionSupportFilter filter)
Sets all the dynamic attributes of the Action.
setActionAttributes
in interface ActionStrategyInterface
action
- The Action to set dynamic attribute values on.filter
- The ActionSupportFilter that contains area-specific
information relating to where the Action will be used.public int getActionStatus(BaseAction action, ActionSupportFilter filter)
If enabled, the value is:
ActionStatusKeysInterface.ENABLED
If disabled, the value may be one of the following values which indicate why the Action is disabled.
ActionStatusKeysInterface.VIEWER_DISABLED
ActionStatusKeysInterface.AREA_DISABLED
ActionStatusKeysInterface.MODEL_TYPE_DISABLED
ActionStatusKeysInterface.MODEL_STATE_DISABLED
ActionStatusKeysInterface.MODEL_MEMBER_DISABLED
ActionStatusKeysInterface.IS_CURRENT_STATE_DISABLED
ActionStatusKeysInterface.DISABLED
ActionStatusKeysInterface.UNSUPPORTED
The status of an Action with a CommandSupportedInterface command
whose isSupported()
method returns false will have the ActionStatusKeysInterface.UNSUPPORTED
status bit set.
The status of an Action with a CommandStatusInterface command
will have the status bit value returned by the command's
getCommandStatus()
method.
The Action's status may also be set with bit values that are determined by the support class in addition to a command.
getActionStatus
in interface ActionStrategyInterface
action
- The action for which status is to be determined.filter
- The ActionSupportFilter that encapsulates all information
describing the specific area.
CommandSupportedInterface
,
CommandStatusInterface
protected java.lang.Object getDynamicValue(java.lang.String valueName, ActionSupportFilter filter, java.lang.Object defaultValue)
Returns the value of a dynamic Action attribute.
This base implementation first looks for a registered
com.sas.actionprovider.DynamicValueInfo
object for the
specified valueName argument. Depending on the contents of the
DynamicValueInfo object, the method will return a dynamic value
either from the filter or a method call, see
com.sas.actionprovider.DynamicValueInfo#setValueMethod
,
on the DynamicValueInfo's valueObject
.
See com.sas.actionprovider.DynamicValueInfo#setValueObject
.
If a DynamicValueInfo object is not registered for the specified valueName then this implementation returns null.
valueName
- The name of the Action attribute.filter
- The ActionSupportFilter that contains area-specific
information relating to where the Action will be used.defaultValue
- The current value of this attribute on the default Action.
com.sas.actionprovider.DynamicValueInfo#setValueObject
,
com.sas.actionprovider.DynamicValueInfo#setValueMethod
,
addDynamicValueInfo(java.lang.String, java.lang.String, java.lang.Object, java.lang.String)
protected void addDynamicValueInfo(java.lang.String valueName, java.lang.String methodName, java.lang.Object methodObject, java.lang.String filterAlias)
Register the information for determining a dynamic value.
valueName
- The name of the dynamic value.methodName
- The name of the method to call on the methodObject when determining
this value dynamically. If null, the dynamic value is considered to be available
directly from the ActionSupport filter.methodObject
- The Object on which the method will be invoked.filterAlias
- The name of the attribute on the filter.BaseAction.setActionStrategy(com.sas.actionprovider.strategies.ActionStrategyInterface)
,
BaseActionProvider.getDefaultAction(java.lang.String, java.lang.String, java.lang.String)
protected void addDynamicValueInfo(java.lang.String valueName, java.lang.String methodName, java.lang.Object methodObject, java.lang.String filterAlias, boolean nullValid)
Register the information for determining a dynamic value.
valueName
- The name of the dynamic value.methodName
- The name of the method to call on the methodObject when determining
this value dynamically. If null, the dynamic value is considered to be available
directly from the ActionSupport filter.methodObject
- The Object on which the method will be invoked.filterAlias
- The name of the attribute on the filter.nullValid
- If true, dynamic values equal to null will be applied to the Actions.BaseAction.setActionStrategy(com.sas.actionprovider.strategies.ActionStrategyInterface)
,
BaseActionProvider.getDefaultAction(java.lang.String, java.lang.String, java.lang.String)
protected java.lang.Object getCustomAttributeValue(java.lang.String attributeName, ActionSupportFilter filter)
If a support class can derive custom attribute values, then it should override this method.
This base implementation always returns null.
attributeName
- The name of the custom attributefilter
- The object that encapsulates all the specific query information.
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |