Package org.ametys.core.ui
Class SimpleMenu
-
- All Implemented Interfaces:
ClientSideElement
,MenuClientSideElement
,LogEnabled
,PluginAware
,Configurable
,Serviceable
- Direct Known Subclasses:
AbstractEditorStyleMenu
,AbstractPageMenu
,ApogeeSimpleMenu
,ContentPrivacyMenu
,ContentTypesGallery
,ContentTypesMenuItem
,DesignsMenu
,DevModeClientSideElement
,FormEditionModeMenu
,FormsContentClientSideElement
,ImportModelClientSideElement
,ImportSkinClientSideElement
,LanguageMenu
,ModelsMenu
,ODFPilotageSimpleMenuClientSideElement
,SetContentViewMenu
,ShareableCourseMenuItemClientSideElement
,SkinLanguageMenu
,TemplatesMenu
,ThemeColorsMenu
,ThesaurusGallery
public class SimpleMenu extends StaticClientSideElement implements MenuClientSideElement
This element creates a control button with a menu
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
SimpleMenu.GalleryGroup
Class representing a gallery groupclass
SimpleMenu.GalleryItem
Class representing a gallery itemprotected class
SimpleMenu.UnresolvedItem
The unresolved item-
Nested classes/interfaces inherited from interface org.ametys.core.ui.ClientSideElement
ClientSideElement.Script, ClientSideElement.ScriptFile
-
-
Field Summary
Fields Modifier and Type Field Description private ThreadSafeComponentManager<ClientSideElement>
_galleryItemManager
The client side element component manager for gallery items.protected List<SimpleMenu.GalleryItem>
_galleryItems
The gallery itemsprotected ThreadSafeComponentManager<ClientSideElement>
_menuItemManager
The client side element component manager for menu items.protected List<ClientSideElement>
_menuItems
The menu itemsprotected ClientSideElement
_primaryMenuItem
The primary menu itemprotected RibbonControlsManager
_ribbonControlManager
The ribbon control managerprotected ServiceManager
_smanager
The service managerprotected List<SimpleMenu.UnresolvedItem>
_unresolvedMenuItems
The unresolved menu items-
Fields inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_currentUserProvider, _dependencies, _featureName, _id, _pluginName, _rightManager, _rights, _rightsMode, _script
-
-
Constructor Summary
Constructors Constructor Description SimpleMenu()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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>
_getGalleryItemManager()
Get the gallery item managerprotected List<SimpleMenu.GalleryItem>
_getGalleryItems()
Get the gallery itemsprotected void
_getGalleryItems(Map<String,Object> parameters, Map<String,Object> contextualParameters)
Get the gallery itemsprotected void
_getMenuItems(Map<String,Object> parameters, Map<String,Object> contextualParameters)
Get the menu itemsprivate void
_resolveGalleryItems()
private void
_resolveMenuItems()
void
configure(Configuration configuration)
List<ClientSideElement>
getReferencedClientSideElements()
This method returns theClientSideElement
referenced by the menu through its menu or gallery itemsMap<String,String>
getRights(Map<String,Object> contextParameters)
This method return the right that will be needed on client side.List<ClientSideElement.Script>
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 Detail
-
_menuItemManager
protected ThreadSafeComponentManager<ClientSideElement> _menuItemManager
The client side element component manager for menu items.
-
_ribbonControlManager
protected RibbonControlsManager _ribbonControlManager
The ribbon control manager
-
_smanager
protected ServiceManager _smanager
The service manager
-
_menuItems
protected List<ClientSideElement> _menuItems
The menu items
-
_galleryItems
protected List<SimpleMenu.GalleryItem> _galleryItems
The gallery items
-
_primaryMenuItem
protected ClientSideElement _primaryMenuItem
The primary menu item
-
_unresolvedMenuItems
protected List<SimpleMenu.UnresolvedItem> _unresolvedMenuItems
The unresolved menu items
-
_galleryItemManager
private ThreadSafeComponentManager<ClientSideElement> _galleryItemManager
The client side element component manager for gallery items.
-
-
Constructor Detail
-
SimpleMenu
public SimpleMenu()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classStaticFileImportsClientSideElement
- Throws:
ServiceException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classStaticFileImportsClientSideElement
- Throws:
ConfigurationException
-
_configureClass
protected String _configureClass(Configuration configuration) throws ConfigurationException
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
-
_getGalleryItemManager
protected ThreadSafeComponentManager<ClientSideElement> _getGalleryItemManager()
Get the gallery item manager- Returns:
- the gallery item manager
-
_getGalleryItems
protected List<SimpleMenu.GalleryItem> _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
public Map<String,String> getRights(Map<String,Object> contextParameters)
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()
Description copied from interface:MenuClientSideElement
This method returns theClientSideElement
referenced by the menu through its menu or gallery items- Specified by:
getReferencedClientSideElements
in interfaceMenuClientSideElement
- Returns:
- the referenced client side elements.
-
_configureGalleries
protected void _configureGalleries(Configuration configuration) throws ConfigurationException
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
protected void _configureItemsMenu(Configuration configuration) throws ConfigurationException
Configure the items menu- Parameters:
configuration
- the configuration- Throws:
ConfigurationException
- If the configuration has an issue
-
_resolveMenuItems
private void _resolveMenuItems() throws Exception
- Throws:
Exception
-
_resolveGalleryItems
private void _resolveGalleryItems()
-
_addDependencies
protected void _addDependencies(Map<String,List<String>> additionalDependencies) throws ConfigurationException
Add 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
-
-