Class Tab
- java.lang.Object
-
- org.ametys.core.ui.ribbonconfiguration.Tab
-
-
Field Summary
Fields Modifier and Type Field Description protected String_contextualColorThe color (between 1 and 6) for a contextual tabprotected String_contextualGroupThe id of the contextual group (can be null for single contextual tab)protected String_controlIdThe optional id of the contextual client side element determining the state of the ribbonprotected List<Group>_groupsThe list of groups in the tabprotected I18nizableText_labelThe label of the tabprotected org.slf4j.Logger_logLoggerprotected Object_orderThe tab orderprotected Boolean_orderBeforeTrue to order before a tab specified by _orderprotected Boolean_overrideTrue to override an existing tab instead of defining a new oneprotected RibbonElementsInjectionHelper<Group>_tabOverrideHelperhelper for group injection
-
Constructor Summary
Constructors Constructor Description Tab(Configuration tabConfiguration, RibbonManager ribbonManager, Integer defaultOrder, org.slf4j.Logger logger)Creates a tab
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void_configureGroups(Configuration tabConfiguration, RibbonManager ribbonManager)Configure tabs groupsprotected void_configureId(Configuration tabConfiguration)Configure tab optional idprivate void_configureOrder(Configuration tabConfiguration, Integer defaultOrder)protected void_generateTabControl(Configuration tabConfiguration, RibbonManager ribbonManager)Generate a new tab control on the flyList<Group>getGroups()Retrieve the list of configured groupsStringgetId()Get the id of this tab;StringgetLabel()Get the tab labelIntegergetOrderAsInteger()Get the order attribute of the tabStringgetOrderAsString()Get the order attribute of the tabvoidinjectGroups(List<Group> groups)Inject a list of groups into this tabvoidinjectGroupsOverride(List<Group> groups)Inject a list of overriding groups into this tabBooleanisContextual()Return true if the tab is contextualbooleanisOverride()Return true if this tab overrides an existing tabbooleanorderBefore()True if the tab should be ordered before the tab referenced by the attribute ordervoidsaxGroups(ContentHandler handler, List<Group> groups)Sax the configuration of the tab.voidsetOrder(Object order)Set the order attribute of the tabStringtoString()
-
-
-
Field Detail
-
_label
protected I18nizableText _label
The label of the tab
-
_controlId
protected String _controlId
The optional id of the contextual client side element determining the state of the ribbon
-
_contextualColor
protected String _contextualColor
The color (between 1 and 6) for a contextual tab
-
_contextualGroup
protected String _contextualGroup
The id of the contextual group (can be null for single contextual tab)
-
_orderBefore
protected Boolean _orderBefore
True to order before a tab specified by _order
-
_override
protected Boolean _override
True to override an existing tab instead of defining a new one
-
_tabOverrideHelper
protected RibbonElementsInjectionHelper<Group> _tabOverrideHelper
helper for group injection
-
_log
protected org.slf4j.Logger _log
Logger
-
-
Constructor Detail
-
Tab
public Tab(Configuration tabConfiguration, RibbonManager ribbonManager, Integer defaultOrder, org.slf4j.Logger logger) throws ConfigurationException
Creates a tab- Parameters:
tabConfiguration- The configuration of the tabribbonManager- The ribbon managerdefaultOrder- The default tab order, if not specified. Can be nulllogger- The logger- Throws:
ConfigurationException- if an error occurs in the configuration
-
-
Method Detail
-
isContextual
public Boolean isContextual()
Return true if the tab is contextual- Returns:
- true if the tab is contextual
-
_configureId
protected void _configureId(Configuration tabConfiguration) throws ConfigurationException
Configure tab optional id- Parameters:
tabConfiguration- One tab configuration- Throws:
ConfigurationException- if an error occurred
-
_generateTabControl
protected void _generateTabControl(Configuration tabConfiguration, RibbonManager ribbonManager) throws ConfigurationException
Generate a new tab control on the fly- Parameters:
tabConfiguration- The tab configurationribbonManager- The ribbon manager- Throws:
ConfigurationException- If an error occurs
-
_configureGroups
protected void _configureGroups(Configuration tabConfiguration, RibbonManager ribbonManager) throws ConfigurationException
Configure tabs groups- Parameters:
tabConfiguration- One tab configurationribbonManager- The ribbon manager- Throws:
ConfigurationException- if an error occurred
-
_configureOrder
private void _configureOrder(Configuration tabConfiguration, Integer defaultOrder)
-
getOrderAsString
public String getOrderAsString()
Get the order attribute of the tab- Returns:
- Return the order as a String, or null
-
getOrderAsInteger
public Integer getOrderAsInteger()
Get the order attribute of the tab- Returns:
- Return the order as an Integer, or null
-
setOrder
public void setOrder(Object order)
Set the order attribute of the tab- Parameters:
order- The new order value, either a String or an Integer
-
orderBefore
public boolean orderBefore()
True if the tab should be ordered before the tab referenced by the attribute order- Returns:
- True if the tab should be ordered before the tab referenced by the attribute order
-
getGroups
public List<Group> getGroups()
Retrieve the list of configured groups- Returns:
- The list of groups
-
isOverride
public boolean isOverride()
Return true if this tab overrides an existing tab- Returns:
- True if overrides
-
injectGroups
public void injectGroups(List<Group> groups)
Inject a list of groups into this tab- Parameters:
groups- The list of groups to inject
-
injectGroupsOverride
public void injectGroupsOverride(List<Group> groups)
Inject a list of overriding groups into this tab- Parameters:
groups- The list of groups to inject
-
saxGroups
public void saxGroups(ContentHandler handler, List<Group> groups) throws SAXException
Sax the configuration of the tab.- Parameters:
handler- The content handler where to saxgroups- The list of groups to sax- Throws:
SAXException- if an error occurs
-
-