Package de.xima.fc.gui.utils.designer
Class TabViewActions
java.lang.Object
de.xima.fc.gui.utils.designer.TabViewActions
Actions operating on a
TabViewModel.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
Method Summary
Modifier and TypeMethodDescriptionstatic TabModeladdTab(TabViewModel model, String tabId) Opens the given tab, adding it to the topbar menu.static TabSwitchResultcloseTab(TabViewModel model, TabModel tab) Close the given tab, removing it from the topbar menu.static TabModelcomputeActiveTab(TabViewModel model) computeAvailableTabs(TabViewModel model) static Stringstatic booleancomputeMoreTabIds(TabViewModel model) static org.primefaces.model.menu.MenuModelstatic StringcomputeOverlayStyleClass(TabViewModel model, TabModel tab) static StringcomputeTabMenuCloseIconStyleClass(TabViewModel model, TabModel tab) computeTabMenuItems(TabViewModel model) static StringcomputeTabMenuStyleClass(TabViewModel model, TabModel tab) static StringcomputeTabStyleClass(TabViewModel model, TabModel tab) static TabModelfindAvailableTabBy(TabViewModel model, EContentView contentView) static booleanstatic booleanisAnyTabVisible(TabViewModel model) static booleanisTabClosed(TabViewModel model, EContentView contentView) static booleanisTabClosed(TabViewModel model, String tabId) static booleanisTabOpen(TabViewModel model, EContentView contentView) static booleanisTabOpen(TabViewModel model, String tabId) static TabModelmarkError(TabViewModel model, String tabId, TabError error) Marks the given tab as erroneous, and adds the given error details.static voidmarkUnsavedChanges(TabViewModel model, String tabId, boolean hasUnsavedChanges) Sets the flag whether the given tab has unsaved changes.static voidshowTabs(TabViewModel model, List<String> tabIds) Adds the given tabs to the list of tabs that are shown in the tab menu.static booleanswitchToTab(TabViewModel model, String tabId) Switches to the given tab, and setTabModel.isOpen()totrue.static booleanswitchToTab(TabViewModel model, String tabId, boolean openNewTab) Switches to the given tab, and setTabModel.isOpen()totrue.static booleanswitchToTab(TabViewModel model, String tabId, String fallbackTabId) Switches to the given tab, and setTabModel.isOpen()totrue.static voidupdatePlaceholderLibraryFor(TabViewModel tabViewModel) Updates the placeholder library so that it shows the placeholders that are available within the context of the given tab.static voidAdds / removes the placeholder library groups for the given tab, which shold be the active tab.
-
Method Details
-
addTab
Opens the given tab, adding it to the topbar menu.- Parameters:
model- Model to operate on.tabId- ID of the Tab to add.- Returns:
- The tab with the given ID, or
nullwhen not such tab exists.
-
closeTab
Close the given tab, removing it from the topbar menu.- Parameters:
model- Model to operate on.tab- Tab to remove.- Returns:
- Whether the current tab was switched.
-
computeActiveTab
- Parameters:
model- Model to operate on.- Returns:
- The tab representing the currently active tab model.
-
computeAvailableTabs
- Parameters:
model- Model to operate on.- Returns:
- A list of all available tabs.
-
computeExtraTopMenuEntriesForActiveTab
- Parameters:
model- Model to operate on.- Returns:
- XHTML page with the extra top menu items of the active tab.
-
computeIsHasMoreTabMenuEntries
- Parameters:
model- Model to operate on.- Returns:
- Whether any more tabs can be added to the menu bar.
-
computeMoreTabIds
- Parameters:
model- Model to operate on.- Returns:
- A set of all tab IDs corresponding to the tabs that can be added.
-
computeMoreTabMenuEntries
- Parameters:
model- Model to operate on.- Returns:
- A menu model entry with the tab that can be added.
-
computeOverlayStyleClass
- Parameters:
model- Model to operate on.tab- An existing tab.- Returns:
- The style class for the error overlay of the given tab in the main content area.
-
computeTabMenuCloseIconStyleClass
- Parameters:
model- Model to operate on.tab- An existing tab.- Returns:
- The style class for the close icon of the given tab in the main content area.
-
computeTabMenuItems
- Parameters:
model- Model to operate on.- Returns:
- All tabs currently shown in the top menu bar.
-
computeTabMenuStyleClass
- Parameters:
model- Model to operate on.tab- An existing tab.- Returns:
- The style class for the menu entry of the given tab in the topbar menu.
-
computeTabStyleClass
- Parameters:
model- Model to operate on.tab- An existing tab.- Returns:
- The style class for the iframe of the given tab in the main content area.
-
findAvailableTabBy
- Parameters:
model- Model to operate on.contentView- Content view to search for.- Returns:
- The tab for the given content view (whether open or closed), or
nullif no such tab exists.
-
isAnyTabShownInTopMenu
- Parameters:
model- Model to operate on.- Returns:
- Whether any tab is shown in the top menu, regardless of whether is is opened.
-
isAnyTabVisible
- Parameters:
model- Model to operate on.- Returns:
trueif any tab is shown,falseif no tab is shown.
-
isTabClosed
- Parameters:
model- Model to operate on.contentView- Content view to check.- Returns:
- Whether the tab corresponding to the content view is currently close (e.g. its iframe / DOM element / browser tab does not exist).
-
isTabClosed
- Parameters:
model- Model to operate on.tabId- ID of the tab to check.- Returns:
- Whether the tab corresponding to the content view is currently close (e.g. its iframe / DOM element / browser tab does not exist).
-
isTabOpen
- Parameters:
model- Model to operate on.contentView- Content view to check.- Returns:
- Whether the tab corresponding to the content view is currently opened (e.g. its iframe / DOM element / browser tab exists).
-
isTabOpen
- Parameters:
model- Model to operate on.tabId- ID of the tab to check.- Returns:
- Whether the tab corresponding to the content view is currently opened (e.g. its iframe / DOM element / browser tab exists).
-
markError
Marks the given tab as erroneous, and adds the given error details.- Parameters:
model- Model to operate on.tabId- ID of an existing tab.error- Error to set on the tab.- Returns:
- The tab with the given ID, or
nullwhen no such tab exists.
-
markUnsavedChanges
Sets the flag whether the given tab has unsaved changes. When a tab has unsaved changes, this is usually shown with a small asterisk next to the tab.- Parameters:
model- Model to operate on.tabId- ID of the tab to mark as having unsaved changes or not.hasUnsavedChanges- Whether the tab has unsaved changes.
-
showTabs
Adds the given tabs to the list of tabs that are shown in the tab menu. The tab that is currently open is not changed.- Parameters:
model- Model to operate on.tabIds- IDs of tabs to show.
-
switchToTab
Switches to the given tab, and setTabModel.isOpen()totrue.- Parameters:
model- Model to operate on.tabId- ID of a tab representing the tab to switch to.- Returns:
- Whether the tab was switched to (i.e. whether it exists and isn't disabled).
-
switchToTab
Switches to the given tab, and setTabModel.isOpen()totrue.- Parameters:
model- Model to operate on.tabId- ID of a tab representing the tab to switch to.openNewTab- Whether to open a new tab if not already opened.- Returns:
- Whether the tab was switched to (i.e. whether it exists and isn't disabled).
-
switchToTab
Switches to the given tab, and setTabModel.isOpen()totrue. When no tab with the given ID exists, switches to the fallback tab ID.- Parameters:
model- Model to operate on.tabId- ID of a tab representing the tab to switch to.fallbackTabId- ID of a tab representing the tab to switch to when no tab with the given tabId exists.- Returns:
- Whether the tab was switched to (i.e. whether it exists).
-
updatePlaceholderLibraryFor
Adds / removes the placeholder library groups for the given tab, which shold be the active tab.- Parameters:
tabId- Currently active tab ID.
-
updatePlaceholderLibraryFor
Updates the placeholder library so that it shows the placeholders that are available within the context of the given tab.- Parameters:
tabViewModel- The model of the tab for which to update the placeholders.
-