com.sas.actionprovider.support
Class BaseActionProviderSupport

com.sas.actionprovider.support.BaseActionProviderSupport
Direct Known Subclasses:
BaseActionProviderCompositeSupport, BaseCustomSupport, BaseGraphSupport, BaseMenuBarSupport, BaseNavigationBarSupport, BaseOLAPDrillStateSupport, BaseOLAPGraphSupport, BaseOLAPTableViewSupport, BaseRelationalMenuBarSupport, BaseRemoteFileSelectorSupport, BaseRemoteFileSelectorSupport, BaseRemoteFileSelectorSupportV2, BaseTableViewSupport, ESRIMapSupport, ESRIToolbarSupport

public abstract class BaseActionProviderSupport

The BaseActionProviderSupport class is the base class for all support classes of the Action Provider Framework( APF ). Support classes provide the functionality for registering and accessing Actions.

A basic understanding of the ActionProvider Framework, of which this class is a part, is recommended before attempting to use this class.



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 .

Since:
3.0

Field Summary
static int AREA_DISABLED
          Return value from getActionStatus method if the Action is disabled for specific areas within a more general areaType.
static java.lang.String AREA_VALUE_ATTRKEY
          The Action attributeKey used to access the data value associated with the specific area where the Action is to be rendered.
static int DISABLED
          Return value from getActionStatus method if the Action is disabled for an unspecified reason.
static int ENABLED
          Return value from getActionStatus method if the Action is fully operational.
static int IS_CURRENT_STATE_DISABLED
          Return value of getActionStatus method if Action is disabled given that the intended state of the operation already exists.
static int MODEL_MEMBER_DISABLED
          Return value of getActionStatus method if Action is disabled for a particular member of the model.
static int MODEL_STATE_DISABLED
          Return value of getActionStatus method if Action is disabled due to some state of the model.
static int MODEL_TYPE_DISABLED
          Return value of getActionStatus method if Action is disabled for a particular type of model.
static java.lang.String NON_SPECIFIC_AREA
          Reserved areaType key for use when registering Actions that map directly to some specific sub-component of a composite.
static int UNSUPPORTED
          Return value of getActionStatus method if Action is disabled due to the command's isSupported returning false.
static int VIEWER_DISABLED
          Return value from getActionStatus method if the Action is disabled due to some state of the Viewer.
 
Constructor Summary
BaseActionProviderSupport()
          Default Constructor
BaseActionProviderSupport(java.lang.Class actionClass)
          ActionClass Constructor
 
Method Summary
protected  void addDefaultAction(BaseAction action, java.lang.String areaType)
          Registers a default action for a specific area and ensure that the specified areaType is registered as a valid areaType.
 BaseAction getAction(java.lang.String actionType, ActionSupportFilter actionFilter)
          Returns the Action corresponding to the specified actionType.
protected  java.lang.String getActionId(ActionSupportFilter filter, java.lang.String actionType, java.lang.String orderListName)
           
 ActionOrderList getActionOrderList(ActionProviderViewInterface viewer, java.lang.String areaType)
          Returns the order list that is used to control the structure and ordering of the ActionList returned by the getActions() method.
 BaseActionProvider getActionProvider()
          Returns the instance of the ActionProvider that is using this support class.
 ActionList getActions(ActionSupportFilter actionFilter)
          Returns an ActionList containing all the actions, both default and custom, that are available according to the information provided by the viewer component on the ActionSupportFilter.
protected  java.lang.Object getActionScopeAttribute(java.lang.String actionType, java.lang.String attributeName, ActionSupportFilter filter, java.lang.Object currentValue)
          Returns a specific dynamic value for an attribute whose value varies according to the type of action being generated.
protected  java.util.Map getActionScopeAttributeMap(java.lang.String actionType, ActionSupportFilter filter)
          Returns mappings for a pre-defined set of Action attribute keys to their corresponding dynamic values for a specific area and a specific actionType.
 BaseAction getDefaultAction(java.lang.String areaType, java.lang.String actionType)
          Return the specific default action registered for a specific areaType.
 java.util.Locale getLocale()
          Get the locale
abstract  void initialize()
          Initializes the support class.
 java.util.Collection listActionTypes(java.lang.String areaType)
          Returns a Collection of String keys that define the valid actionTypes for the specified area of this support class.
 java.util.Collection listAreaTypes()
          Returns a Collection of String keys that define the valid areaTypes for this support class.
 java.util.Collection listDefaultActions(java.lang.String areaType)
          Return a Collection of all the default actions registered for a specific areaType.
abstract  BaseAction newActionInstance(java.lang.String areaType, java.lang.String actionType)
          Returns a new instance of a default actionType.
 void reset()
           
 void setAction(BaseAction action, java.util.Collection viewers, Area area)
          Override a default Action or add a custom action.
 void setActionOrderList(ActionOrderList orderList, ActionProviderViewInterface viewer, java.lang.String areaType)
          Sets the order list that is used to control the structure and ordering of the ActionList returned via the getActions() method.
 void setActionProvider(BaseActionProvider actionProvider)
          Sets the instance of the ActionProvider that is using this support class.
 void setLocale(java.util.Locale loc)
          Set the locale
 

Field Detail

NON_SPECIFIC_AREA

public static final java.lang.String NON_SPECIFIC_AREA
Reserved areaType key for use when registering Actions that map directly to some specific sub-component of a composite.

See Also:
Constant Field Values

ENABLED

public static final int ENABLED
Return value from getActionStatus method if the Action is fully operational.

See Also:
getActionStatus(com.sas.actionprovider.BaseAction, com.sas.actionprovider.ActionSupportFilter), Constant Field Values

DISABLED

public static final int DISABLED
Return value from getActionStatus method if the Action is disabled for an unspecified reason.

See Also:
getActionStatus(com.sas.actionprovider.BaseAction, com.sas.actionprovider.ActionSupportFilter), Constant Field Values

VIEWER_DISABLED

public static final int VIEWER_DISABLED
Return value from getActionStatus method if the Action is disabled due to some state of the Viewer.

For example,

See Also:
getActionStatus(com.sas.actionprovider.BaseAction, com.sas.actionprovider.ActionSupportFilter), Constant Field Values

AREA_DISABLED

public static final int AREA_DISABLED
Return value from getActionStatus method if the Action is disabled for specific areas within a more general areaType.

For example,

See Also:
getActionStatus(com.sas.actionprovider.BaseAction, com.sas.actionprovider.ActionSupportFilter), Constant Field Values

MODEL_TYPE_DISABLED

public static final int MODEL_TYPE_DISABLED
Return value of getActionStatus method if Action is disabled for a particular type of model.

For example,

See Also:
getActionStatus(com.sas.actionprovider.BaseAction, com.sas.actionprovider.ActionSupportFilter), Constant Field Values

MODEL_STATE_DISABLED

public static final int MODEL_STATE_DISABLED
Return value of getActionStatus method if Action is disabled due to some state of the model.

For example,

See Also:
getActionStatus(com.sas.actionprovider.BaseAction, com.sas.actionprovider.ActionSupportFilter), Constant Field Values

MODEL_MEMBER_DISABLED

public static final int MODEL_MEMBER_DISABLED
Return value of getActionStatus method if Action is disabled for a particular member of the model.

For example,

See Also:
getActionStatus(com.sas.actionprovider.BaseAction, com.sas.actionprovider.ActionSupportFilter), Constant Field Values

IS_CURRENT_STATE_DISABLED

public static final int IS_CURRENT_STATE_DISABLED
Return value of getActionStatus method if Action is disabled given that the intended state of the operation already exists.

For example,

See Also:
getActionStatus(com.sas.actionprovider.BaseAction, com.sas.actionprovider.ActionSupportFilter), Constant Field Values

UNSUPPORTED

public static final int UNSUPPORTED
Return value of getActionStatus method if Action is disabled due to the command's isSupported returning false. This key is returned when the Action's command implements the CommandSupportedInterface and its isSupported() method return false.

See Also:
getActionStatus(com.sas.actionprovider.BaseAction, com.sas.actionprovider.ActionSupportFilter), CommandSupportedInterface, Constant Field Values

AREA_VALUE_ATTRKEY

public static final java.lang.String AREA_VALUE_ATTRKEY
The Action attributeKey used to access the data value associated with the specific area where the Action is to be rendered.

See Also:
Constant Field Values
Constructor Detail

BaseActionProviderSupport

public BaseActionProviderSupport()
Default Constructor


BaseActionProviderSupport

public BaseActionProviderSupport(java.lang.Class actionClass)
ActionClass Constructor

Parameters:
actionClass - The base type of class this support class should create instances of and return for all of its default action types unless overridden on a per-actionType basis.
Method Detail

getActionOrderList

public ActionOrderList getActionOrderList(ActionProviderViewInterface viewer,
                                          java.lang.String areaType)
Returns the order list that is used to control the structure and ordering of the ActionList returned by the getActions() method.

Parameters:
viewer - The viewer this order list affects.

If null, the default orderlist for this support class is returned.

If non-null, the orderlist registered for the specific viewer is returned.

If non-null and an orderlist is not reqistered for the specific viewer, a copy of the default orderlist is registered for the viewer and then returned.

areaType - The area this order list affects.
Throws:
java.lang.IllegalArgumentException - if areaType is not valid.
See Also:
setActionOrderList(com.sas.actionprovider.ActionOrderList, com.sas.actionprovider.ActionProviderViewInterface, java.lang.String)

setActionOrderList

public void setActionOrderList(ActionOrderList orderList,
                               ActionProviderViewInterface viewer,
                               java.lang.String areaType)
Sets the order list that is used to control the structure and ordering of the ActionList returned via the getActions() method.

Parameters:
orderList - The order list.
viewer - The viewer this order list affects.

If null, the specified orderlist replaces the default orderList for this support class.

areaType - The area this order list affects.
Throws:
java.lang.IllegalArgumentException - if any of the arguments are null or if areaType is not valid.
See Also:
getActionOrderList(com.sas.actionprovider.ActionProviderViewInterface, java.lang.String)

setAction

public void setAction(BaseAction action,
                      java.util.Collection viewers,
                      Area area)
Override a default Action or add a custom action.

Parameters:
action - The custom or override action object.
viewers - The collection of viewers to which this Action should be available.
area - The Area object that specifies the area where this action should be available.
Throws:
java.lang.IllegalArgumentException - if any of the arguments are invalid.

getActions

public ActionList getActions(ActionSupportFilter actionFilter)
Returns an ActionList containing all the actions, both default and custom, that are available according to the information provided by the viewer component on the ActionSupportFilter.

Parameters:
actionFilter - the ActionSupportFilter that the component passed as an argument on the getActions() method.
Returns:
an ActionList containing all the available custom actions. Null if no actions available.
Throws:
java.lang.IllegalArgumentException - if the filter is invalid.

getAction

public BaseAction getAction(java.lang.String actionType,
                            ActionSupportFilter actionFilter)
Returns the Action corresponding to the specified actionType.

Parameters:
actionType - the type of action to be returned.
actionFilter - the ActionSupportFilter.
Returns:
an Action containing all the available custom actions. Null if no actions available.
Throws:
java.lang.IllegalArgumentException - if the filter is invalid or actionType is null.

getDefaultAction

public BaseAction getDefaultAction(java.lang.String areaType,
                                   java.lang.String actionType)
Return the specific default action registered for a specific areaType.

Parameters:
areaType - areaType the areaType key which is associated with a defined area.
actionType - The actionType key that is associated with the action to be returned.
Returns:
the default action registered for a specific areaType.
See Also:
listDefaultActions(java.lang.String)

getActionId

protected java.lang.String getActionId(ActionSupportFilter filter,
                                       java.lang.String actionType,
                                       java.lang.String orderListName)

getActionScopeAttribute

protected java.lang.Object getActionScopeAttribute(java.lang.String actionType,
                                                   java.lang.String attributeName,
                                                   ActionSupportFilter filter,
                                                   java.lang.Object currentValue)
Returns a specific dynamic value for an attribute whose value varies according to the type of action being generated.

Parameters:
actionType - The key that uniquely identifies this type of action.
attributeName - The name of the dynamic attribute.
filter - Defines the specific area.
currentValue - The current value of this attribute on the action

getActionScopeAttributeMap

protected java.util.Map getActionScopeAttributeMap(java.lang.String actionType,
                                                   ActionSupportFilter filter)
Returns mappings for a pre-defined set of Action attribute keys to their corresponding dynamic values for a specific area and a specific actionType.

Parameters:
actionType -
filter - Defines the specific area.

listAreaTypes

public java.util.Collection listAreaTypes()
Returns a Collection of String keys that define the valid areaTypes for this support class.

Returns:
a Collection of String keys that define the valid areaTypes for this support class.
See Also:
listActionTypes(java.lang.String)

listActionTypes

public java.util.Collection listActionTypes(java.lang.String areaType)
Returns a Collection of String keys that define the valid actionTypes for the specified area of this support class.

Parameters:
areaType - The key associated with a defined areaType.
Returns:
a Collection of String keys that define the valid actionTypes for the specified area of this support class.
Throws:
java.lang.IllegalArgumentException - if areaType is null.
See Also:
listAreaTypes()

addDefaultAction

protected void addDefaultAction(BaseAction action,
                                java.lang.String areaType)
Registers a default action for a specific area and ensure that the specified areaType is registered as a valid areaType.

Parameters:
action - the Action to be registered.
areaType - the areaType key which is associated with a defined area.
Throws:
java.lang.IllegalArgumentException - if action or areaType or action's actionType are null.

listDefaultActions

public java.util.Collection listDefaultActions(java.lang.String areaType)
Return a Collection of all the default actions registered for a specific areaType.

Parameters:
areaType - areaType the areaType key which is associated with a defined area.
Returns:
an ActionList of default actions or null if none found.

setLocale

public void setLocale(java.util.Locale loc)
Set the locale

Parameters:
loc - The locale to be used for locale-dependent action attributes.

getLocale

public java.util.Locale getLocale()
Get the locale

Returns:
The locale to be used for locale-dependent action attributes.

reset

public void reset()

setActionProvider

public void setActionProvider(BaseActionProvider actionProvider)
Sets the instance of the ActionProvider that is using this support class.

Parameters:
actionProvider - the instance of the ActionProvider that is using this support class.
See Also:
getActionProvider()

getActionProvider

public BaseActionProvider getActionProvider()
Returns the instance of the ActionProvider that is using this support class.

Returns:
the instance of the ActionProvider
See Also:
setActionProvider(com.sas.actionprovider.BaseActionProvider)

initialize

public abstract void initialize()
Initializes the support class.

Called by the ActionProvider after it sets the locale on this support class.

See Also:
setLocale(java.util.Locale)

newActionInstance

public abstract BaseAction newActionInstance(java.lang.String areaType,
                                             java.lang.String actionType)
Returns a new instance of a default actionType.

Returns null if actionType is valid but not defined by the support class.

Parameters:
areaType - the key associated with a defined area type.
actionType - the key associated with a defined action type.
Returns:
a new action of the specified type.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.