Package org.ametys.core.ui
Class SimpleMenu
- All Implemented Interfaces:
ClientSideElement
,MenuClientSideElement
,LogEnabled
,PluginAware
,Configurable
,Serviceable
- Direct Known Subclasses:
AbstractPageMenu
,ContentPrivacyMenu
,ContentTypesGallery
,ContentTypesMenuItem
,DesignsMenu
,DevModeClientSideElement
,EditorStyleMenu
,ExportSimpleMenu
,FormEditionModeMenu
,FormQuestionButtonMenu
,FormsContentClientSideElement
,FormWorkflowButtonMenu
,ImportModelClientSideElement
,ImportSkinClientSideElement
,LanguageMenu
,ModelsMenu
,ODFPilotageSimpleMenuClientSideElement
,SetContentViewMenu
,ShareableCourseMenuItemClientSideElement
,SkinLanguageMenu
,TemplatesMenu
,ThemeColorsMenu
,ThesaurusGallery
This element creates a control button with a menu
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Class representing a gallery groupclass
Class representing a gallery itemprotected class
The unresolved itemNested classes/interfaces inherited from interface org.ametys.core.ui.ClientSideElement
ClientSideElement.Script, ClientSideElement.ScriptFile
-
Field Summary
Modifier and TypeFieldDescriptionprotected List<SimpleMenu.GalleryItem>
The gallery itemsprotected ThreadSafeComponentManager<ClientSideElement>
The client side element component manager for menu items.protected List<ClientSideElement>
The menu itemsprotected ClientSideElement
The primary menu itemprotected RibbonControlsManager
The ribbon control managerprotected ServiceManager
The service managerprotected List<SimpleMenu.UnresolvedItem>
The unresolved menu itemsFields inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_currentUserProvider, _dependencies, _featureName, _id, _pluginName, _rightManager, _rights, _rightsMode, _script
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
_addDependencies
(Map<String, List<String>> additionalDependencies) Add additional dependencies to the Menu, such as dependencies inherited from its menu items or gallery items.protected String
_configureClass
(Configuration configuration) Configure the js class nameprotected void
_configureGalleries
(Configuration configuration) Configure the galleriesprotected SimpleMenu.GalleryGroup
_configureGroupGallery
(Configuration configuration) Configure a group galleryprotected void
_configureItemsMenu
(Configuration configuration) Configure the items menuprotected ThreadSafeComponentManager<ClientSideElement>
Get the gallery item managerprotected List<SimpleMenu.GalleryItem>
Get the gallery itemsprotected void
Get the gallery itemsprotected void
Get the menu itemsprotected void
Initialize the gallery item managervoid
configure
(Configuration configuration) getReferencedClientSideElements
(Map<String, Object> contextParameters) This method returns theClientSideElement
referenced by the menu through its menu or gallery itemsThis method return the right that will be needed on client side.getScripts
(boolean ignoreRights, Map<String, Object> contextParameters) This method return the scripts that will be used on client side.void
service
(ServiceManager smanager) Methods inherited from class org.ametys.core.ui.StaticClientSideElement
_configureParameters, _configureScript, configureInitialParameters
Methods inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_configureDependencies, _configureImports, _configureRights, _configureRightsMode, getDependencies, getId, getPluginName, getScripts, hasRight, setPluginInfo, toString
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_ribbonControlManager
The ribbon control manager -
_smanager
The service manager -
_galleryItems
The gallery items -
_primaryMenuItem
The primary menu item -
_unresolvedMenuItems
The unresolved menu items
-
Constructor Details
-
SimpleMenu
public SimpleMenu()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classStaticFileImportsClientSideElement
- Throws:
ServiceException
-
configure
- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classStaticFileImportsClientSideElement
- Throws:
ConfigurationException
-
_configureClass
Description copied from class:StaticClientSideElement
Configure the js class name- Overrides:
_configureClass
in classStaticClientSideElement
- Parameters:
configuration
- The configuration on action tag- Returns:
- The js class name
- Throws:
ConfigurationException
- If an error occurs
-
_initializeGalleryItemManager
Initialize the gallery item manager -
_getGalleryItemManager
Get the gallery item manager- Returns:
- the gallery item manager
-
_getGalleryItems
Get the gallery items- Returns:
- the gallery items
-
getScripts
public List<ClientSideElement.Script> getScripts(boolean ignoreRights, Map<String, Object> contextParameters) Description copied from interface:ClientSideElement
This method return the scripts that will be used on client side. This class will be parametrized by initial and current parameters.- Specified by:
getScripts
in interfaceClientSideElement
- Overrides:
getScripts
in classStaticFileImportsClientSideElement
- Parameters:
ignoreRights
- True to ignore the rights verification.contextParameters
- Contextuals parameters transmitted by the environment.- Returns:
- The list of scripts or an empty list.
-
getRights
Description copied from interface:ClientSideElement
This method return the right that will be needed on client side. This class will be parametrized by initial and current parameters.- Specified by:
getRights
in interfaceClientSideElement
- Overrides:
getRights
in classStaticFileImportsClientSideElement
- Parameters:
contextParameters
- Contextuals parameters transmitted by the environment.- Returns:
- The rights in a Map of (rightId, context). Can be empty.
-
_getGalleryItems
protected void _getGalleryItems(Map<String, Object> parameters, Map<String, Object> contextualParameters) Get the gallery items- Parameters:
parameters
- Contextual the parameters given to the control script class.contextualParameters
- Contextual parameters transmitted by the environment.
-
_getMenuItems
protected void _getMenuItems(Map<String, Object> parameters, Map<String, Object> contextualParameters) Get the menu items- Parameters:
parameters
- Contextual the parameters given to the control script class.contextualParameters
- Contextual parameters transmitted by the environment.
-
getReferencedClientSideElements
public List<ClientSideElement> getReferencedClientSideElements(Map<String, Object> contextParameters) Description copied from interface:MenuClientSideElement
This method returns theClientSideElement
referenced by the menu through its menu or gallery items- Specified by:
getReferencedClientSideElements
in interfaceMenuClientSideElement
- Parameters:
contextParameters
- Contextuals parameters transmitted by the environment.- Returns:
- the referenced client side elements.
-
_configureGalleries
Configure the galleries- Parameters:
configuration
- the configuration- Throws:
ConfigurationException
- If the configuration has an issue
-
_configureGroupGallery
protected SimpleMenu.GalleryGroup _configureGroupGallery(Configuration configuration) throws ConfigurationException Configure a group gallery- Parameters:
configuration
- the configuration- Returns:
- The configured group gallery
- Throws:
ConfigurationException
- If the configuration has an issue
-
_configureItemsMenu
Configure the items menu- Parameters:
configuration
- the configuration- Throws:
ConfigurationException
- If the configuration has an issue
-
_addDependencies
protected void _addDependencies(Map<String, List<String>> additionalDependencies) throws ConfigurationExceptionAdd additional dependencies to the Menu, such as dependencies inherited from its menu items or gallery items.- Parameters:
additionalDependencies
- The dependencies to add- Throws:
ConfigurationException
- If an error occurs
-