|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.actionprovider.support.BaseActionProviderCompositeSupport
public abstract class BaseActionProviderCompositeSupport
The BaseActionProviderCompositeSupport class is the base class for all composite support classes of the Action Provider Framework( APF ). Support classes provide the functionality for registering and accessing Actions.
A composite support class is a grouping mechanism for other support classes. It allows a support class developer to group together different support classes to serve the needs of specialized view components. For example:
The HttpRemoteFileSelector Transformation Bean acquires it actions from a composite support class. This HttpRemoteFileSelectorComposite support delegates all requests for actions of table-type areas to the HttpRemoteFileSelectorTableViewSupport.
A basic understanding of the ActionProvider Framework, of which this class is a part, is recommended before attempting to use this class.
For general information on the ActionProvider Framework, including an overview of how
the primary classes of the framework work together, refer to the
package documentation.
com.sas.actionprovider
For examples demonstrating how to use the ActionProvider Framework, including how to override default Actions or add new custom Actions, refer to the Samples Site.
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 .
RemoteFileSelector
,
HttpRemoteFileSelectorCompositeSupport
,
HttpRemoteFileSelectorTableViewSupport
Field Summary |
---|
Fields inherited from class com.sas.actionprovider.support.BaseActionProviderSupport |
---|
AREA_DISABLED, AREA_VALUE_ATTRKEY, DISABLED, ENABLED, IS_CURRENT_STATE_DISABLED, MODEL_MEMBER_DISABLED, MODEL_STATE_DISABLED, MODEL_TYPE_DISABLED, NON_SPECIFIC_AREA, UNSUPPORTED, VIEWER_DISABLED |
Constructor Summary | |
---|---|
BaseActionProviderCompositeSupport()
Default Constructor |
|
BaseActionProviderCompositeSupport(java.lang.Class actionClass)
ActionClass Constructor |
Method Summary | |
---|---|
protected void |
addSupport(java.lang.String className)
Adds a delegate support class to this composite. |
protected abstract void |
addSupportClassInstances()
Subclasses should register their sub-support class instances via addSupport in their implementations of this method. |
BaseAction |
getAction(java.lang.String actionType,
ActionSupportFilter actionFilter)
Returns the Action corresponding to the specified actionType. |
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. |
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.util.Map |
getAreaScopeAttributeMap(ActionSupportFilter filter)
Returns mappings for a pre-defined set of Action attribute keys to their corresponding dynamic values for a specific area. |
BaseAction |
getDefaultAction(java.lang.String areaType,
java.lang.String actionType)
Return the specific default action registered for a specific areaType. |
protected abstract java.lang.Class |
getSupportClass(java.lang.String supportClassName)
Returns the support class associated with the specified class name. |
protected BaseActionProviderSupport |
getSupportInstance(java.lang.String supportClassName)
Instantiates and returns the instance of the specified supportClass argument. |
void |
initialize()
Initializes all the delegate support classes. |
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. |
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)
Initializes the support class. |
protected boolean |
validArea(Area area,
ActionSupportFilter actionFilter)
Validates that the given Area's value constraints are met by the information provided on the given ActionSupportFilter. |
protected void |
validateSupport(BaseActionProviderSupport support)
Validates that the areaTypes defined by specified support class instance are not defined by a support class that has already been added. |
Methods inherited from class com.sas.actionprovider.support.BaseActionProviderSupport |
---|
addDefaultAction, getActionId, getActionProvider, getActionScopeAttribute, getActionScopeAttributeMap, getLocale, listDefaultActions |
Constructor Detail |
---|
public BaseActionProviderCompositeSupport()
public BaseActionProviderCompositeSupport(java.lang.Class actionClass)
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 |
---|
public void initialize()
Called by the ActionProvider after it sets the locale on this support class.
initialize
in class BaseActionProviderSupport
setLocale(java.util.Locale)
protected void addSupport(java.lang.String className)
className
- The name of the delegate support class to add.
java.lang.IllegalArgumentException
- if className is null.
java.lang.IllegalArgumentException
- if support instance cannot be instantiated.protected void validateSupport(BaseActionProviderSupport support)
support
- The instance of the support class being validated.
java.lang.IllegalStateException
- if key is already registered to a support class.protected boolean validArea(Area area, ActionSupportFilter actionFilter)
This method's return value is used by the getActions() method to determine whether an Action with an accompanying Area specification should be returned to the requesting viewer.
An Area object is optionally specified during Action registration and may define specific areas, within a more general areaType, for which the Action is to be available.
This Method's implementation ensures that the current area for which actions are being requested, as represented by ActionSupportFilter attributes, match the Area specification associated with an Action.
The method should only return false if none of the Area's values match the current area represented on the filter. If the Area is null or its 'type' is null then the method should return true.
The types of values on the Area object and the determination of what constitutes as a match with ActionSupportFilter attributes varies among different viewers/support class combinations.
validArea
in class BaseActionProviderSupport
area
- The Area object that may or may not specify certain area 'values'.actionFilter
- the ActionSupportFilter that the component passed as an
argument on the getActions() method.
setAction(com.sas.actionprovider.BaseAction, java.util.Collection, com.sas.actionprovider.Area)
,
getActions(com.sas.actionprovider.ActionSupportFilter)
protected BaseActionProviderSupport getSupportInstance(java.lang.String supportClassName)
supportClassName
- The name of the support Class to be instantiated.
java.lang.IllegalArgumentException
- if supportClass is null.
java.lang.IllegalStateException
- if instantiation of support class from the support class fails for any reason.public void setAction(BaseAction action, java.util.Collection viewers, Area area)
setAction
in class BaseActionProviderSupport
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.
java.lang.IllegalArgumentException
- if any of the arguments are invalid.public void setActionOrderList(ActionOrderList orderList, ActionProviderViewInterface viewer, java.lang.String areaType)
setActionOrderList
in class BaseActionProviderSupport
orderList
- The order list.viewer
- The viewer this order list affects.
If null, the specified orderlist becomes the all-viewer scope orderList for this support class.
areaType
- The area this order list affects.
java.lang.IllegalArgumentException
- if any of the arguments are null or if areaType is not valid.getActionOrderList(com.sas.actionprovider.ActionProviderViewInterface, java.lang.String)
public ActionOrderList getActionOrderList(ActionProviderViewInterface viewer, java.lang.String areaType)
getActionOrderList
in class BaseActionProviderSupport
viewer
- The viewer this order list affects.
If null, the all-viewer scope orderlist for this support class is returned.
If non-null and an orderList has not be registered for the viewer, the all-viewer scope orderList for this support class is returned.
areaType
- The area this order list affects.
java.lang.IllegalArgumentException
- if areaType is not valid.setActionOrderList(com.sas.actionprovider.ActionOrderList, com.sas.actionprovider.ActionProviderViewInterface, java.lang.String)
public ActionList getActions(ActionSupportFilter actionFilter)
ActionSupportFilter
.
getActions
in class BaseActionProviderSupport
actionFilter
- the ActionSupportFilter that the component passed as an
argument on the getActions() method.
java.lang.IllegalArgumentException
- if the filter is invalid.public BaseAction getAction(java.lang.String actionType, ActionSupportFilter actionFilter)
getAction
in class BaseActionProviderSupport
actionType
- the type of action to be returned.actionFilter
- the ActionSupportFilter.
java.lang.IllegalArgumentException
- if the filter is invalid or actionType is null.public BaseAction getDefaultAction(java.lang.String areaType, java.lang.String actionType)
getDefaultAction
in class BaseActionProviderSupport
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.
BaseActionProviderSupport.listDefaultActions(java.lang.String)
public java.util.Collection listAreaTypes()
listAreaTypes
in class BaseActionProviderSupport
listActionTypes(java.lang.String)
public java.util.Collection listActionTypes(java.lang.String areaType)
listActionTypes
in class BaseActionProviderSupport
areaType
- The key associated with a defined areaType.
java.lang.IllegalArgumentException
- if areaType is null.listAreaTypes()
public void setLocale(java.util.Locale loc)
Called by the ActionProvider after it sets the locale on this support class.
setLocale
in class BaseActionProviderSupport
loc
- The locale object used by this support class.setLocale(java.util.Locale)
public void setActionProvider(BaseActionProvider actionProvider)
setActionProvider
in class BaseActionProviderSupport
actionProvider
- the instance of the ActionProvider that is using this support class.BaseActionProviderSupport.getActionProvider()
public void reset()
reset
in class BaseActionProviderSupport
public BaseAction newActionInstance(java.lang.String areaType, java.lang.String actionType)
Returns null if actionType is valid but not defined by the support class.
newActionInstance
in class BaseActionProviderSupport
areaType
- the key associated with a defined area type.actionType
- the key associated with a defined action type.
protected java.util.Map getAreaScopeAttributeMap(ActionSupportFilter filter)
This implementation just returns null because, typically, there are no attributes that the Composite proper needs to set. The Composite's delegate support classes typically need to derive attribute values.
getAreaScopeAttributeMap
in class BaseActionProviderSupport
filter
- Defines the specific area.
protected abstract void addSupportClassInstances()
Called during instantiation of the Composite support class.
addSupport(java.lang.String)
protected abstract java.lang.Class getSupportClass(java.lang.String supportClassName)
supportClassName
- The name of the class being requested.
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |