Class ConfigurationTableEditorFactory
- java.lang.Object
-
- net.ssehub.easy.producer.ui.productline_editor.ConfigurationTableEditorFactory
-
- All Implemented Interfaces:
ConfigurationEditorFactory.IConfigurationEditorCreator
public class ConfigurationTableEditorFactory extends java.lang.Object implements ConfigurationEditorFactory.IConfigurationEditorCreator
An UI element factory (preliminary).- Author:
- Holger Eichelberger
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classConfigurationTableEditorFactory.ConfigTableEditorJust for now as the constructor of the target class is protected.private static classConfigurationTableEditorFactory.DelegatingGuiVariableImplements a delegating GuiVariable for externally created editors, so that they can be handled like EASy variables.static interfaceConfigurationTableEditorFactory.IEditorCreatorAn extensible editor creator for tailoring the general EASy mechanism.static interfaceConfigurationTableEditorFactory.UIChangeListenerA listener called when variables are changed.static classConfigurationTableEditorFactory.UIConfigurationA UI configuration class wrapping the internally used configuration instance.static classConfigurationTableEditorFactory.UIParameterDefines a simple UI parameter with name and default value.
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Map<java.lang.String,ConfigurationTableEditorFactory.IEditorCreator>CREATORS
-
Constructor Summary
Constructors Constructor Description ConfigurationTableEditorFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.jface.viewers.ViewerFiltercreateAttributeFilter(java.lang.String attributeNameRegEx, java.lang.String valueRegEx, boolean showAllNestedElements)Creates a simple attribute filter.static org.eclipse.jface.viewers.CellEditorcreateCellEditor(ConfigurationTableEditorFactory.UIConfiguration config, IDecisionVariable variable)Creates a cell editor element for the given decision variable.static org.eclipse.jface.viewers.CellEditorcreateCellEditor(ConfigurationTableEditorFactory.UIConfiguration config, IDecisionVariable variable, java.util.List<IRangeRestriction> restrictors)Creates a cell editor element for the given decision variable.private static org.eclipse.jface.viewers.CellEditorcreateCellEditor(ConfigurationTableEditorFactory.UIConfiguration config, IDecisionVariable variable, ConfigurationTableEditorFactory.IEditorCreator creator)Tries to create a form editor control from an editor creator.static ConfigurationTableEditorFactory.UIConfigurationcreateConfiguration(Configuration config, IEASyEditorPage parent)Creates a configuration instance holding UI configuration elements without parameters.static ConfigurationTableEditorFactory.UIConfigurationcreateConfiguration(Configuration config, IEASyEditorPage parent, java.util.Map<ConfigurationTableEditorFactory.UIParameter,java.lang.Object> parameter)Creates a configuration instance holding UI configuration elements.static org.eclipse.jface.viewers.TreeViewercreateConfigurationTableEditor(Configuration configuration, IEASyEditorPage parent)Creates a configuration table editor.static org.eclipse.swt.widgets.ControlcreateEditor(ConfigurationTableEditorFactory.UIConfiguration config, IDecisionVariable variable)Creates a form editor element for the given decision variable.static org.eclipse.swt.widgets.ControlcreateEditor(ConfigurationTableEditorFactory.UIConfiguration config, IDecisionVariable variable, java.util.List<IRangeRestriction> restrictors)Creates a form editor element for the given decision variable.private static org.eclipse.swt.widgets.ControlcreateEditor(ConfigurationTableEditorFactory.UIConfiguration config, IDecisionVariable variable, ConfigurationTableEditorFactory.IEditorCreator creator)Tries to create a form editor control from an editor creator.org.eclipse.jface.viewers.TreeViewercreateEditor(Configuration config, org.eclipse.swt.widgets.Composite parent)Creates a configuration editor.org.eclipse.jface.viewers.ViewerFiltercreateNameFilter(java.lang.String nameRegEx, boolean showAllNestedElements)Creates a name filter.org.eclipse.jface.viewers.ViewerFiltercreateNonFrozenFilter(boolean showAllNestedElements)Creates a filter that shows only non-frozen elements.static voidcreateUpdatableCellEditors(boolean updatable)Defines whether updatable cell editors shall be created if possible.static DisplayNameProvidergetDisplayNameProvider()Returns the current display name provider.static voidregisterEditorCreator(java.lang.String key, ConfigurationTableEditorFactory.IEditorCreator creator)Registers an editor creator, i.e., a plugin that supersedes the EASy way of creating editors for specific cases.static voidsetDisplayNameProvider(DisplayNameProvider provider)Changes the display name provider.
-
-
-
Field Detail
-
CREATORS
private static final java.util.Map<java.lang.String,ConfigurationTableEditorFactory.IEditorCreator> CREATORS
-
-
Method Detail
-
createConfigurationTableEditor
public static final org.eclipse.jface.viewers.TreeViewer createConfigurationTableEditor(Configuration configuration, IEASyEditorPage parent)
Creates a configuration table editor.- Parameters:
configuration- the configuration to be displayed / manipulatedparent- the parent instance- Returns:
- the configuration table editor
-
createConfiguration
public static final ConfigurationTableEditorFactory.UIConfiguration createConfiguration(Configuration config, IEASyEditorPage parent)
Creates a configuration instance holding UI configuration elements without parameters. The returned instance may be used to create multiple editors.- Parameters:
config- the IVML configurationparent- the editor parent instance- Returns:
- the UI configuration
-
createConfiguration
public static final ConfigurationTableEditorFactory.UIConfiguration createConfiguration(Configuration config, IEASyEditorPage parent, java.util.Map<ConfigurationTableEditorFactory.UIParameter,java.lang.Object> parameter)
Creates a configuration instance holding UI configuration elements. The returned instance may be used to create multiple editors.- Parameters:
config- the IVML configurationparent- the editor parent instanceparameter- optional parameter (may be null)- Returns:
- the UI configuration
-
createEditor
public static final org.eclipse.swt.widgets.Control createEditor(ConfigurationTableEditorFactory.UIConfiguration config, IDecisionVariable variable)
Creates a form editor element for the given decision variable.- Parameters:
config- the UI configuration containingvariablevariable- the variable to return the editor for- Returns:
- the editor
-
createEditor
public static final org.eclipse.swt.widgets.Control createEditor(ConfigurationTableEditorFactory.UIConfiguration config, IDecisionVariable variable, java.util.List<IRangeRestriction> restrictors)
Creates a form editor element for the given decision variable.- Parameters:
config- the UI configuration containingvariablevariable- the variable to return the editor forrestrictors- Optional list to restrict values of drop down editors- Returns:
- the editor
-
createCellEditor
public static final org.eclipse.jface.viewers.CellEditor createCellEditor(ConfigurationTableEditorFactory.UIConfiguration config, IDecisionVariable variable)
Creates a cell editor element for the given decision variable.- Parameters:
config- the UI configuration containingvariablevariable- the variable to return the editor for- Returns:
- the editor
-
createCellEditor
public static final org.eclipse.jface.viewers.CellEditor createCellEditor(ConfigurationTableEditorFactory.UIConfiguration config, IDecisionVariable variable, java.util.List<IRangeRestriction> restrictors)
Creates a cell editor element for the given decision variable.- Parameters:
config- the UI configuration containingvariablevariable- the variable to return the editor forrestrictors- Optional list to restrict values of drop down editors- Returns:
- the editor
-
createEditor
private static final org.eclipse.swt.widgets.Control createEditor(ConfigurationTableEditorFactory.UIConfiguration config, IDecisionVariable variable, ConfigurationTableEditorFactory.IEditorCreator creator)
Tries to create a form editor control from an editor creator.- Parameters:
config- the UI configurationvariable- the variable to create the editor forcreator- the creator to ask for the creation (may be null)- Returns:
- the editor or null if the given creator does not create the editor
-
createCellEditor
private static final org.eclipse.jface.viewers.CellEditor createCellEditor(ConfigurationTableEditorFactory.UIConfiguration config, IDecisionVariable variable, ConfigurationTableEditorFactory.IEditorCreator creator)
Tries to create a form editor control from an editor creator.- Parameters:
config- the UI configurationvariable- the variable to create the editor forcreator- the creator to ask for the creation (may be null)- Returns:
- the editor or null if the given creator does not create the editor
-
registerEditorCreator
public static final void registerEditorCreator(java.lang.String key, ConfigurationTableEditorFactory.IEditorCreator creator)Registers an editor creator, i.e., a plugin that supersedes the EASy way of creating editors for specific cases. Empty keys, null keys or null creators are ignored.- Parameters:
key- (qualified) name or type to react oncreator- the editor creator to register with
-
setDisplayNameProvider
public static final void setDisplayNameProvider(DisplayNameProvider provider)
Changes the display name provider. [convenience]- Parameters:
provider- the new name provider (considered only if not null)
-
getDisplayNameProvider
public static final DisplayNameProvider getDisplayNameProvider()
Returns the current display name provider. [convenience]- Returns:
- the current display name provider
-
createUpdatableCellEditors
public static final void createUpdatableCellEditors(boolean updatable)
Defines whether updatable cell editors shall be created if possible.- Parameters:
updatable- iftrue, updatable cell editors shall be created,falsefor usual ones
-
createEditor
public org.eclipse.jface.viewers.TreeViewer createEditor(Configuration config, org.eclipse.swt.widgets.Composite parent)
Description copied from interface:ConfigurationEditorFactory.IConfigurationEditorCreatorCreates a configuration editor.- Specified by:
createEditorin interfaceConfigurationEditorFactory.IConfigurationEditorCreator- Parameters:
config- the configuration to be shown in the editorparent- the UI parent- Returns:
- the editor
-
createNameFilter
public org.eclipse.jface.viewers.ViewerFilter createNameFilter(java.lang.String nameRegEx, boolean showAllNestedElements)Description copied from interface:ConfigurationEditorFactory.IConfigurationEditorCreatorCreates a name filter.- Specified by:
createNameFilterin interfaceConfigurationEditorFactory.IConfigurationEditorCreator- Parameters:
nameRegEx- a regular expression for including namesshowAllNestedElements- if all nested elements or only the selected ones shall be displayed- Returns:
- the name filter
-
createAttributeFilter
public org.eclipse.jface.viewers.ViewerFilter createAttributeFilter(java.lang.String attributeNameRegEx, java.lang.String valueRegEx, boolean showAllNestedElements)Description copied from interface:ConfigurationEditorFactory.IConfigurationEditorCreatorCreates a simple attribute filter.- Specified by:
createAttributeFilterin interfaceConfigurationEditorFactory.IConfigurationEditorCreator- Parameters:
attributeNameRegEx- the name of the attribute as regular expressionvalueRegEx- a regular expression to be applied on the text representation of valuesshowAllNestedElements- if all nested elements or only the selected ones shall be displayed- Returns:
- the name filter
-
createNonFrozenFilter
public org.eclipse.jface.viewers.ViewerFilter createNonFrozenFilter(boolean showAllNestedElements)
Description copied from interface:ConfigurationEditorFactory.IConfigurationEditorCreatorCreates a filter that shows only non-frozen elements.- Specified by:
createNonFrozenFilterin interfaceConfigurationEditorFactory.IConfigurationEditorCreator- Parameters:
showAllNestedElements- if all nested elements or only the selected ones shall be displayed- Returns:
- the non-frozen filter
-
-