Class Tab
- java.lang.Object
-
- org.ametys.core.ui.ribbonconfiguration.Tab
-
-
Field Summary
Fields Modifier and Type Field Description protected String
_contextualColor
The color (between 1 and 6) for a contextual tabprotected String
_contextualGroup
The id of the contextual group (can be null for single contextual tab)protected String
_controlId
The optional id of the contextual client side element determining the state of the ribbonprotected List<Group>
_groups
The list of groups in the tabprotected I18nizableText
_label
The label of the tabprotected org.slf4j.Logger
_log
Loggerprotected Object
_order
The tab orderprotected Boolean
_orderBefore
True to order before a tab specified by _orderprotected Boolean
_override
True to override an existing tab instead of defining a new oneprotected RibbonElementsInjectionHelper<Group>
_tabOverrideHelper
helper 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 groupsString
getId()
Get the id of this tab;String
getLabel()
Get the tab labelInteger
getOrderAsInteger()
Get the order attribute of the tabString
getOrderAsString()
Get the order attribute of the tabvoid
injectGroups(List<Group> groups)
Inject a list of groups into this tabvoid
injectGroupsOverride(List<Group> groups)
Inject a list of overriding groups into this tabBoolean
isContextual()
Return true if the tab is contextualboolean
isOverride()
Return true if this tab overrides an existing tabboolean
orderBefore()
True if the tab should be ordered before the tab referenced by the attribute ordervoid
saxGroups(ContentHandler handler, List<Group> groups)
Sax the configuration of the tab.void
setOrder(Object order)
Set the order attribute of the tabString
toString()
-
-
-
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
-
-