public class RibbonConfigurationManager extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RibbonConfigurationManager.CONTROLSIZE
Size constants for controls
|
static class |
RibbonConfigurationManager.LAYOUTALIGN
Size constants for controls
|
Modifier and Type | Field and Description |
---|---|
protected Set<String> |
_controlsReferences
The controls referenced by the ribbon
|
private boolean |
_initialized |
private static Logger |
_logger |
private static Pattern |
_PLUGINNAMEPATTERN |
protected SourceResolver |
_resolver
The excalibur source resolver
|
protected RibbonConfiguration |
_ribbonConfig
The ribbon configuration, as read from the configuration source
|
protected RibbonControlsManager |
_ribbonControlManager
The ribbon controls manager
|
protected RibbonImportManager |
_ribbonImportManager
The ribbon import manager
|
protected RibbonManager |
_ribbonManager
The ribbon control manager
|
protected RibbonTabsManager |
_ribbonTabManager
The ribbon tab extension point
|
protected SAXClientSideElementHelper |
_saxClientSideElementHelper
The sax clientside element helper
|
protected Set<String> |
_tabsReferences
The tabs referenced by the ribbon
|
Constructor and Description |
---|
RibbonConfigurationManager(RibbonControlsManager ribbonControlManager,
RibbonManager ribbonManager,
RibbonTabsManager ribbonTabManager,
RibbonImportManager ribbonImportManager,
SAXClientSideElementHelper saxClientSideElementHelper,
SourceResolver resolver,
ClientSideElementDependenciesManager dependenciesManager,
RibbonManagerCache ribbonManagerCache,
Source config,
String workspaceName)
Constructor
|
Modifier and Type | Method and Description |
---|---|
private void |
_checkLayoutsConsistency(List<Layout> layoutsBuffer,
GroupSize group) |
private void |
_checkLayoutsMerge(List<Layout> layoutsBuffer,
int elementsPerLayout,
Layout layout,
List<Element> elements,
int layoutSize,
GroupSize group) |
private Layout |
_checkLayoutsOverflow(RibbonConfigurationManager.CONTROLSIZE size,
int elementsPerLayout,
Layout layout,
List<Element> elements,
int currentSize) |
private void |
_checkTabConsistency(GroupSize group) |
private void |
_checkTabConsistency(Map<Tab,List<Group>> tabGroups) |
private void |
_configure(Source config,
ClientSideElementDependenciesManager dependenciesManager,
RibbonManagerCache ribbonManagerCache,
String workspaceName) |
private void |
_configureExcluded(Configuration configuration,
Map<String,Map<String,Object>> imports,
Map<RibbonExclude.EXCLUDETYPE,List<RibbonExclude>> excluded,
String workspaceName) |
private void |
_configureExcludeFromImports(Configuration configuration,
Map<String,Map<String,Object>> imports,
Map<RibbonExclude.EXCLUDETYPE,List<RibbonExclude>> excluded) |
private void |
_configureExcludeFromImports(String url,
Map<String,Map<String,Object>> imports,
Map<RibbonExclude.EXCLUDETYPE,List<RibbonExclude>> excluded) |
private void |
_configureImport(ClientSideElementDependenciesManager dependenciesManager,
Map<String,Long> importValidity,
String url,
Map<String,Map<String,Object>> imports,
Map<RibbonExclude.EXCLUDETYPE,List<RibbonExclude>> excludedList) |
private void |
_configureRibbon(Configuration configuration,
ClientSideElementDependenciesManager dependenciesManager,
Map<String,Map<String,Object>> imports,
Map<String,Long> importValidity,
Map<RibbonExclude.EXCLUDETYPE,List<RibbonExclude>> excludedList,
String url) |
private void |
_configureRibbonMenu(Configuration configuration,
RibbonMenu ribbonMenu,
List<RibbonExclude> excludedList,
Map<String,Object> properties,
String url) |
private void |
_configureTabOrder(Map<String,Tab> labelMapping) |
private void |
_configureTabOverride(Map<String,Tab> labelMapping) |
private Group |
_createGroupForUser(Group ribbonGroup,
Map<String,Object> contextualParameters)
Create a contextualised group for the current user, based on the ribbon configuration group
|
private void |
_generateGroupSizes(List<Element> largeElements,
List<Element> groupSizeElements,
boolean generateSmallSize,
int groupTotalSize) |
private Map<Tab,List<Group>> |
_generateTabGroups(Map<String,Object> contextualParameters)
Generate the tab groups for the current user and contextual parameters, based on the ribbon configured tab list _tabs.
|
private List<ClientSideElement> |
_getMenuControls(MenuClientSideElement menu) |
private boolean |
_isFileExcluded(Map<String,Object> properties,
List<RibbonExclude> excludedList,
String url) |
private boolean |
_isTabExcluded(Tab tab,
Map<RibbonExclude.EXCLUDETYPE,List<RibbonExclude>> excludedList) |
private void |
_lazyInitialize()
Check that the configuration was correct
|
private void |
_lazyInitialize(GroupSize groupSize) |
private void |
_lazyInitialize(List<Element> elements) |
private void |
_processControlRefsQueue(List<ControlRef> controlsQueue,
List<Element> groupSizeElements,
int groupTotalSize,
boolean generateSmallSize) |
private void |
_removeExcludedControls(List<Element> elements,
List<String> excludedList) |
private void |
_removeExcludedControls(Tab tab,
List<String> excludedList) |
private List<Element> |
_resolveReferences(Map<String,Object> contextualParameters,
List<Element> elements)
Resolve all the controls references into the real ids for the contextual parameters, and the current user rights.
|
private void |
_saxReferencedControl(MenuClientSideElement menu,
ContentHandler handler,
Map<String,Object> contextualParameters) |
List<ClientSideElement> |
getControls()
Retrieve the list of controls referenced by the ribbon
|
List<ClientSideElement> |
getTabs()
Retrieve the list of tabs referenced by the ribbon
|
void |
saxRibbonDefinition(ContentHandler handler,
Map<String,Object> contextualParameters)
Sax the the initial configuration of the ribbon.
|
private static Pattern _PLUGINNAMEPATTERN
protected RibbonManager _ribbonManager
protected RibbonTabsManager _ribbonTabManager
protected SAXClientSideElementHelper _saxClientSideElementHelper
protected SourceResolver _resolver
protected RibbonConfiguration _ribbonConfig
protected Set<String> _controlsReferences
protected Set<String> _tabsReferences
protected RibbonControlsManager _ribbonControlManager
protected RibbonImportManager _ribbonImportManager
private boolean _initialized
public RibbonConfigurationManager(RibbonControlsManager ribbonControlManager, RibbonManager ribbonManager, RibbonTabsManager ribbonTabManager, RibbonImportManager ribbonImportManager, SAXClientSideElementHelper saxClientSideElementHelper, SourceResolver resolver, ClientSideElementDependenciesManager dependenciesManager, RibbonManagerCache ribbonManagerCache, Source config, String workspaceName)
ribbonControlManager
- The ribbon control managerribbonManager
- The ribbon manager for this configribbonTabManager
- the ribbon tab managerribbonImportManager
- The ribbon import managersaxClientSideElementHelper
- the helper to SAX client side elementresolver
- the excalibur source resolverdependenciesManager
- The dependencies managerribbonManagerCache
- The ribbon manager cache helperconfig
- the ribbon configurationworkspaceName
- The current workspace nameRuntimeException
- if an error occurredprivate void _configure(Source config, ClientSideElementDependenciesManager dependenciesManager, RibbonManagerCache ribbonManagerCache, String workspaceName) throws Exception
Exception
private void _configureExcluded(Configuration configuration, Map<String,Map<String,Object>> imports, Map<RibbonExclude.EXCLUDETYPE,List<RibbonExclude>> excluded, String workspaceName) throws ConfigurationException
ConfigurationException
private void _configureExcludeFromImports(String url, Map<String,Map<String,Object>> imports, Map<RibbonExclude.EXCLUDETYPE,List<RibbonExclude>> excluded) throws ConfigurationException
ConfigurationException
private void _configureExcludeFromImports(Configuration configuration, Map<String,Map<String,Object>> imports, Map<RibbonExclude.EXCLUDETYPE,List<RibbonExclude>> excluded) throws ConfigurationException
ConfigurationException
private void _configureRibbon(Configuration configuration, ClientSideElementDependenciesManager dependenciesManager, Map<String,Map<String,Object>> imports, Map<String,Long> importValidity, Map<RibbonExclude.EXCLUDETYPE,List<RibbonExclude>> excludedList, String url) throws ConfigurationException
ConfigurationException
private void _configureRibbonMenu(Configuration configuration, RibbonMenu ribbonMenu, List<RibbonExclude> excludedList, Map<String,Object> properties, String url) throws ConfigurationException
ConfigurationException
private void _configureImport(ClientSideElementDependenciesManager dependenciesManager, Map<String,Long> importValidity, String url, Map<String,Map<String,Object>> imports, Map<RibbonExclude.EXCLUDETYPE,List<RibbonExclude>> excludedList) throws ConfigurationException
ConfigurationException
private boolean _isFileExcluded(Map<String,Object> properties, List<RibbonExclude> excludedList, String url)
private boolean _isTabExcluded(Tab tab, Map<RibbonExclude.EXCLUDETYPE,List<RibbonExclude>> excludedList)
private void _removeExcludedControls(Tab tab, List<String> excludedList)
private void _removeExcludedControls(List<Element> elements, List<String> excludedList)
private void _configureTabOverride(Map<String,Tab> labelMapping)
private void _configureTabOrder(Map<String,Tab> labelMapping)
private void _lazyInitialize()
IllegalStateException
- if an item does not existprivate void _lazyInitialize(GroupSize groupSize)
private void _lazyInitialize(List<Element> elements)
public List<ClientSideElement> getControls()
public List<ClientSideElement> getTabs()
private List<ClientSideElement> _getMenuControls(MenuClientSideElement menu)
public void saxRibbonDefinition(ContentHandler handler, Map<String,Object> contextualParameters) throws SAXException
handler
- The content handler where to saxcontextualParameters
- Contextuals parameters transmitted by the environment.SAXException
- if an error occursprivate Map<Tab,List<Group>> _generateTabGroups(Map<String,Object> contextualParameters)
contextualParameters
- The contextual parametersprivate void _checkTabConsistency(Map<Tab,List<Group>> tabGroups)
private void _checkTabConsistency(GroupSize group)
private void _checkLayoutsConsistency(List<Layout> layoutsBuffer, GroupSize group)
private Layout _checkLayoutsOverflow(RibbonConfigurationManager.CONTROLSIZE size, int elementsPerLayout, Layout layout, List<Element> elements, int currentSize)
private void _checkLayoutsMerge(List<Layout> layoutsBuffer, int elementsPerLayout, Layout layout, List<Element> elements, int layoutSize, GroupSize group)
private Group _createGroupForUser(Group ribbonGroup, Map<String,Object> contextualParameters)
ribbonGroup
- The group form the initial ribbon configurationcontextualParameters
- The contextual parametersprivate List<Element> _resolveReferences(Map<String,Object> contextualParameters, List<Element> elements)
contextualParameters
- The contextual parameterselements
- The elements to resolveprivate void _generateGroupSizes(List<Element> largeElements, List<Element> groupSizeElements, boolean generateSmallSize, int groupTotalSize)
private void _processControlRefsQueue(List<ControlRef> controlsQueue, List<Element> groupSizeElements, int groupTotalSize, boolean generateSmallSize)
private void _saxReferencedControl(MenuClientSideElement menu, ContentHandler handler, Map<String,Object> contextualParameters) throws SAXException
SAXException