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
Nested ClassesModifier and TypeClassDescriptionclassClass representing a gallery groupclassClass representing a gallery itemprotected classThe unresolved itemNested classes/interfaces inherited from interface org.ametys.core.ui.ClientSideElement
ClientSideElement.Script, ClientSideElement.ScriptFile -
Field Summary
FieldsModifier 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 ClientSideElementThe primary menu itemprotected RibbonControlsManagerThe ribbon control managerprotected ServiceManagerThe 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
Constructors -
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 voidGet the gallery itemsprotected voidGet the menu itemsprotected voidInitialize the gallery item managervoidconfigure(Configuration configuration) getReferencedClientSideElements(Map<String, Object> contextParameters) This method returns theClientSideElementreferenced 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.voidservice(ServiceManager smanager) Methods inherited from class org.ametys.core.ui.StaticClientSideElement
_configureParameters, _configureScript, configureInitialParametersMethods inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_configureDependencies, _configureImports, _configureRights, _configureRightsMode, getDependencies, getId, getPluginName, getScripts, hasRight, setPluginInfo, toStringMethods 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:
servicein interfaceServiceable- Overrides:
servicein classStaticFileImportsClientSideElement- Throws:
ServiceException
-
configure
- Specified by:
configurein interfaceConfigurable- Overrides:
configurein classStaticFileImportsClientSideElement- Throws:
ConfigurationException
-
_configureClass
Description copied from class:StaticClientSideElementConfigure the js class name- Overrides:
_configureClassin 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:ClientSideElementThis method return the scripts that will be used on client side. This class will be parametrized by initial and current parameters.- Specified by:
getScriptsin interfaceClientSideElement- Overrides:
getScriptsin 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:ClientSideElementThis method return the right that will be needed on client side. This class will be parametrized by initial and current parameters.- Specified by:
getRightsin interfaceClientSideElement- Overrides:
getRightsin 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:MenuClientSideElementThis method returns theClientSideElementreferenced by the menu through its menu or gallery items- Specified by:
getReferencedClientSideElementsin 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
-