org.eclipse.nebula.widgets.nattable.config
Class ConfigRegistry

java.lang.Object
  extended by org.eclipse.nebula.widgets.nattable.config.ConfigRegistry
All Implemented Interfaces:
IConfigRegistry

public class ConfigRegistry
extends Object
implements IConfigRegistry


Constructor Summary
ConfigRegistry()
           
 
Method Summary
<T> T
getConfigAttribute(ConfigAttribute<T> configAttribute, String targetDisplayMode, List<String> configLabels)
           
<T> T
getConfigAttribute(ConfigAttribute<T> configAttribute, String targetDisplayMode, String... configLabels)
          If retrieving registered values
 IDisplayModeOrdering getDisplayModeOrdering()
           
<T> T
getSpecificConfigAttribute(ConfigAttribute<T> configAttribute, String displayMode, String configLabel)
           
<T> void
registerConfigAttribute(ConfigAttribute<T> configAttribute, T attributeValue)
          Register a configuration attribute.
<T> void
registerConfigAttribute(ConfigAttribute<T> configAttribute, T attributeValue, String displayMode)
          Register a configuration attribute against a DisplayMode.
<T> void
registerConfigAttribute(ConfigAttribute<T> configAttribute, T attributeValue, String displayMode, String configLabel)
          Register an attribute against a DisplayMode and configuration label (applied to cells)
 void setDisplayModeOrdering(IDisplayModeOrdering displayModeOrdering)
           
<T> void
unregisterConfigAttribute(ConfigAttribute<T> configAttributeType)
          Unregister the given configuration attribute.
<T> void
unregisterConfigAttribute(ConfigAttribute<T> configAttributeType, String displayMode)
          Unregister the given configuration attribute for the given DisplayMode.
<T> void
unregisterConfigAttribute(ConfigAttribute<T> configAttributeType, String displayMode, String configLabel)
          Unregister the given configuration attribute for the given DisplayMode that was registered against the given configuration label.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigRegistry

public ConfigRegistry()
Method Detail

getConfigAttribute

public <T> T getConfigAttribute(ConfigAttribute<T> configAttribute,
                                String targetDisplayMode,
                                String... configLabels)
Description copied from interface: IConfigRegistry
If retrieving registered values

Example 1:

configRegistry.getConfigAttribute(attribute, DisplayMode.EDIT);

  1. It will look for an attribute registered using the EDIT display mode
  2. If it can't find that it will try and find an attribute under the NORMAL mode
  3. If it can't find one it will try and find one registered without a display mode IConfigRegistry.registerConfigAttribute(ConfigAttribute, Object)
Example 2:

configRegistry.getConfigAttribute(attribute, DisplayMode.NORMAL, "testLabel", "testLabel_1");

  1. It will look for an attribute registered by display mode NORMAL and "testLabel"
  2. It will look for an attribute registered by display mode NORMAL and "testLabel_1"

Specified by:
getConfigAttribute in interface IConfigRegistry
Type Parameters:
T - Type of the attribute
Parameters:
configAttribute - to be registered
targetDisplayMode - display mode the cell needs to be in, for this attribute to be returned
configLabels - the cell needs to have, for this attribute to be returned
Returns:
the configAttribute, if the display mode and the configLabels match

getConfigAttribute

public <T> T getConfigAttribute(ConfigAttribute<T> configAttribute,
                                String targetDisplayMode,
                                List<String> configLabels)
Specified by:
getConfigAttribute in interface IConfigRegistry
See Also:
IConfigRegistry.getConfigAttribute(ConfigAttribute, String, String...)

getSpecificConfigAttribute

public <T> T getSpecificConfigAttribute(ConfigAttribute<T> configAttribute,
                                        String displayMode,
                                        String configLabel)
Specified by:
getSpecificConfigAttribute in interface IConfigRegistry
See Also:
IConfigRegistry.getConfigAttribute(ConfigAttribute, String, String...)

registerConfigAttribute

public <T> void registerConfigAttribute(ConfigAttribute<T> configAttribute,
                                        T attributeValue)
Description copied from interface: IConfigRegistry
Register a configuration attribute.

Specified by:
registerConfigAttribute in interface IConfigRegistry
Parameters:
configAttribute - The ConfigAttribute for which a value should be registered.
attributeValue - The value that should be set for the given The ConfigAttribute.

registerConfigAttribute

public <T> void registerConfigAttribute(ConfigAttribute<T> configAttribute,
                                        T attributeValue,
                                        String displayMode)
Description copied from interface: IConfigRegistry
Register a configuration attribute against a DisplayMode.

Specified by:
registerConfigAttribute in interface IConfigRegistry
Parameters:
configAttribute - The ConfigAttribute for which a value should be registered.
attributeValue - The value that should be set for the given The ConfigAttribute.
displayMode - The DisplayMode for which the ConfigAttribute should be registered.

registerConfigAttribute

public <T> void registerConfigAttribute(ConfigAttribute<T> configAttribute,
                                        T attributeValue,
                                        String displayMode,
                                        String configLabel)
Description copied from interface: IConfigRegistry
Register an attribute against a DisplayMode and configuration label (applied to cells)

Specified by:
registerConfigAttribute in interface IConfigRegistry
Parameters:
configAttribute - The ConfigAttribute for which a value should be registered.
attributeValue - The value that should be set for the given The ConfigAttribute.
displayMode - The DisplayMode for which the ConfigAttribute should be registered.
configLabel - The configuration label against which the ConfigAttribute should be registered.

unregisterConfigAttribute

public <T> void unregisterConfigAttribute(ConfigAttribute<T> configAttributeType)
Description copied from interface: IConfigRegistry
Unregister the given configuration attribute.

Specified by:
unregisterConfigAttribute in interface IConfigRegistry
Parameters:
configAttributeType - The ConfigAttribute to unregister.

unregisterConfigAttribute

public <T> void unregisterConfigAttribute(ConfigAttribute<T> configAttributeType,
                                          String displayMode)
Description copied from interface: IConfigRegistry
Unregister the given configuration attribute for the given DisplayMode.

Specified by:
unregisterConfigAttribute in interface IConfigRegistry
Parameters:
configAttributeType - The ConfigAttribute to unregister.
displayMode - The DisplayMode for which the ConfigAttribute should be unregistered.

unregisterConfigAttribute

public <T> void unregisterConfigAttribute(ConfigAttribute<T> configAttributeType,
                                          String displayMode,
                                          String configLabel)
Description copied from interface: IConfigRegistry
Unregister the given configuration attribute for the given DisplayMode that was registered against the given configuration label.

Specified by:
unregisterConfigAttribute in interface IConfigRegistry
Parameters:
configAttributeType - The ConfigAttribute to unregister.
displayMode - The DisplayMode for which the ConfigAttribute should be unregistered.
configLabel - The configuration label against which the ConfigAttribute was registered.

getDisplayModeOrdering

public IDisplayModeOrdering getDisplayModeOrdering()
Specified by:
getDisplayModeOrdering in interface IConfigRegistry
Returns:
The IDisplayModeOrdering which is used to specify in which order to search through the IConfigRegistry for DisplayMode.

setDisplayModeOrdering

public void setDisplayModeOrdering(IDisplayModeOrdering displayModeOrdering)


Copyright © 2014. All rights reserved.