public class TabActionsSelection extends Object implements Serializable
WebActions.CURRENT_TAB_CHANGED_EVENT
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected Map<String,Action> |
currentTabActions
Map of current tab actions, with category as key and corresponding action as value.
|
Constructor and Description |
---|
TabActionsSelection() |
Modifier and Type | Method and Description |
---|---|
protected String |
encodeActions(String category,
List<Action> actions) |
Action |
getCurrentTabAction(String category)
Returns the current action for given category.
|
String |
getCurrentTabId(String category) |
String |
getCurrentTabIds()
Returns current tab ids as a string, encoded as is:
CATEGORY_1:ACTION_ID_1,CATEGORY_2:ACTION_ID_2:SUBTAB_ACTION_ID_2,...
|
static String |
getSubTabCategory(String parentActionId) |
protected void |
raiseEventOnCurrentTabChange(String category,
String tabId)
Raises a seam event when current tab changes for a given category.
|
protected void |
raiseEventOnCurrentTabSelected(String category,
String tabId)
Raises a seam event when current tab is selected for a given category.
|
void |
resetCurrentTabs()
Resets all current tabs information.
|
void |
resetCurrentTabs(String category)
Resets current tabs for given category, taking subtabs into account by resetting actions in categories computed
from reset actions id with suffix
#SUBTAB_CATEGORY_SUFFIX . |
void |
setCurrentTabAction(String category,
Action tabAction)
Sets the current action for given category, with additional sub tabs.
|
void |
setCurrentTabId(ActionManager actionManager,
ActionContext actionContext,
String category,
String tabId,
String... subTabIds) |
void |
setCurrentTabIds(ActionManager actionManager,
ActionContext actionContext,
String tabIds)
Sets current tab ids as a String, splitting on commas ',' and parsing each action information as is:
CATEGORY:[ACTION_ID[:OPTIONAL_SUB_ACTION_ID [:OPTIONAL_SUB_ACTION_ID]...]]
|
protected Map<String,Action> currentTabActions
Use a linked has map to preserve order when using several selections as sub tabs management needs order to be preserved.
public TabActionsSelection()
public Action getCurrentTabAction(String category)
public void setCurrentTabAction(String category, Action tabAction)
If given action is null, it resets the current action for this category.
public String getCurrentTabId(String category)
public void setCurrentTabId(ActionManager actionManager, ActionContext actionContext, String category, String tabId, String... subTabIds)
public String getCurrentTabIds()
public void setCurrentTabIds(ActionManager actionManager, ActionContext actionContext, String tabIds)
If category is omitted or empty, the category #DEFAULT_TABS_CATEGORY
will be used (if there is no subtab
information).
If no action id is given, the corresponding category is reset (for instance using 'CATEGORY:').
If the action information is '*:', all categories will be reset.
The resulting string looks like: CATEGORY_1:ACTION_ID_1,CATEGORY_2:ACTION_ID_2_SUB_ACTION_ID_2,...
public void resetCurrentTabs()
public void resetCurrentTabs(String category)
#SUBTAB_CATEGORY_SUFFIX
.protected String encodeActions(String category, List<Action> actions)
public static String getSubTabCategory(String parentActionId)
protected void raiseEventOnCurrentTabChange(String category, String tabId)
Actually raises 2 events: one with name WebActions#CURRENT_TAB_CHANGED_EVENT and another with name WebActions#CURRENT_TAB_CHANGED_EVENT + '_' + category to optimize observers declarations.
The event is always sent with 2 parameters: the category and tab id (the tab id can be null when resetting current tab for given category).
WebActions.CURRENT_TAB_CHANGED_EVENT
protected void raiseEventOnCurrentTabSelected(String category, String tabId)
Actually raises 2 events: one with name WebActions#CURRENT_TAB_SELECTED_EVENT and another with name WebActions#CURRENT_TAB_SELECTED_EVENT + '_' + category to optimize observers declarations.
The event is always sent with 2 parameters: the category and tab id (the tab id can be null when resetting current tab for given category).
WebActions.CURRENT_TAB_SELECTED_EVENT
Copyright © 2018 Nuxeo. All rights reserved.