Class ConfigurationTableEditorFactory.UIConfiguration
- java.lang.Object
-
- net.ssehub.easy.producer.ui.productline_editor.ConfigurationTableEditorFactory.UIConfiguration
-
- All Implemented Interfaces:
IModelListener<Project>
- Enclosing class:
- ConfigurationTableEditorFactory
public static class ConfigurationTableEditorFactory.UIConfiguration extends java.lang.Object implements IModelListener<Project>
A UI configuration class wrapping the internally used configuration instance. Please callrelease()for cleanup.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private GUIConfigurationconfigprivate java.util.Map<GUIVariable,GUIEditor>mapprivate java.util.Map<ConfigurationTableEditorFactory.UIParameter,java.lang.Object>parameterprivate IEASyEditorPageparent
-
Constructor Summary
Constructors Constructor Description UIConfiguration(Configuration config, IEASyEditorPage parent, java.util.Map<ConfigurationTableEditorFactory.UIParameter,java.lang.Object> parameter)Creates a configuration instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidadd(GUIVariable variable, GUIEditor editor)Adds a mapping between a GUI variable and a GUI editor.voidcommitValues(ConfigurationTableEditorFactory.UIChangeListener listener)Commits all UI values to the GUI variables and, thus, enacts the new configuration values.voiddeconfigure(org.eclipse.swt.widgets.Control control)Deconfigures the given control.voidfreezeAll()Causes to freeze all values.(package private) GUIConfigurationgetConfiguration()Returns the IVML configuration.org.eclipse.swt.widgets.ControlgetEditorFor(IDecisionVariable var)Returns the control (of the editor for)var.java.lang.ObjectgetParameter(ConfigurationTableEditorFactory.UIParameter key)Returns a configuration parameter.java.util.Map<ConfigurationTableEditorFactory.UIParameter,java.lang.Object>getParameters()Returns (a copy) of the configuration parameters.IEASyEditorPagegetParent()Returns the parent editor instance.voidnotifyReplaced(Project oldModel, Project newModel)Is called to notify thatoldModelis replaced bynewModel.voidrelease()Release the internal structures, in particular the mapping of variables and editor.voidresetValues()Resets all values in the GUI editors.voidupdateEditor(IDecisionVariable variable)Updates editors using variable that has recently been changed.
-
-
-
Field Detail
-
config
private GUIConfiguration config
-
parent
private IEASyEditorPage parent
-
map
private java.util.Map<GUIVariable,GUIEditor> map
-
parameter
private java.util.Map<ConfigurationTableEditorFactory.UIParameter,java.lang.Object> parameter
-
-
Constructor Detail
-
UIConfiguration
UIConfiguration(Configuration config, IEASyEditorPage parent, java.util.Map<ConfigurationTableEditorFactory.UIParameter,java.lang.Object> parameter)
Creates a configuration instance.- Parameters:
config- the IVML configurationparent- the editor parent instanceparameter- optional parameter (may be null)
-
-
Method Detail
-
getConfiguration
GUIConfiguration getConfiguration()
Returns the IVML configuration.- Returns:
- the configuration
-
getParent
public IEASyEditorPage getParent()
Returns the parent editor instance.- Returns:
- the parent editor instance
-
getParameter
public java.lang.Object getParameter(ConfigurationTableEditorFactory.UIParameter key)
Returns a configuration parameter.- Parameters:
key- the key to return the parameter for- Returns:
- the parameter or its default value, may be null if no parameters are specified,
keyis null or the key does not exist
-
getParameters
public java.util.Map<ConfigurationTableEditorFactory.UIParameter,java.lang.Object> getParameters()
Returns (a copy) of the configuration parameters.- Returns:
- the parameters (may be null)
-
freezeAll
public void freezeAll()
Causes to freeze all values.
-
resetValues
public void resetValues()
Resets all values in the GUI editors.
-
commitValues
public void commitValues(ConfigurationTableEditorFactory.UIChangeListener listener)
Commits all UI values to the GUI variables and, thus, enacts the new configuration values.- Parameters:
listener- a change listener to notify about changed variables (may be null)
-
updateEditor
public void updateEditor(IDecisionVariable variable)
Updates editors using variable that has recently been changed.- Parameters:
variable- the variable that has recently been changed
-
release
public void release()
Release the internal structures, in particular the mapping of variables and editor. This instance shall not be used afterwards.
-
add
void add(GUIVariable variable, GUIEditor editor)
Adds a mapping between a GUI variable and a GUI editor.- Parameters:
variable- the variable to be mappededitor- the editor
-
deconfigure
public void deconfigure(org.eclipse.swt.widgets.Control control)
Deconfigures the given control.- Parameters:
control- the control to be deconfigured
-
notifyReplaced
public void notifyReplaced(Project oldModel, Project newModel)
Description copied from interface:IModelListenerIs called to notify thatoldModelis replaced bynewModel. The listener registrations foroldModelwill be adjusted accordingly.
Do not modify the the listeners ofoldModelornewModelduring this method.- Specified by:
notifyReplacedin interfaceIModelListener<Project>- Parameters:
oldModel- the old model being replacednewModel- the new model (the replacement)
-
getEditorFor
public org.eclipse.swt.widgets.Control getEditorFor(IDecisionVariable var)
Returns the control (of the editor for)var.- Parameters:
var- the variable to search for- Returns:
- the control (may be null if not found)
-
-