Class ObservableLaunchConfigurationAdapter
- java.lang.Object
-
- org.palladiosimulator.commons.ui.launch.ObservableLaunchConfigurationAdapter
-
- All Implemented Interfaces:
ObservableLaunchConfigurationAttributeFactory
public class ObservableLaunchConfigurationAdapter extends Object implements ObservableLaunchConfigurationAttributeFactory
This class serves as generic bridge between Eclipse Launch Configurations and the Eclipse databinding framework. For details on its usage, please seeObservableLaunchConfigurationAttributeFactory.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.palladiosimulator.commons.ui.launch.ObservableLaunchConfigurationAttributeFactory
ObservableLaunchConfigurationAttributeFactory.AttributeExtractor<T>, ObservableLaunchConfigurationAttributeFactory.AttributeSetter<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Consumer<ILaunchConfigurationWorkingCopy>>defaultsprotected Map<String,Consumer<ILaunchConfigurationWorkingCopy>>lcUpdatesprotected Map<String,Consumer<ILaunchConfiguration>>mUpdatesprotected Map<String,IObservableValue<?>>observables
-
Constructor Summary
Constructors Constructor Description ObservableLaunchConfigurationAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IObservableValue<Boolean>createBooleanAttribute(String id, boolean defaultValue)Creates new observable boolean attribute.<T> IObservableValue<T>createFromStringAttribute(String id, T defaultValue, Function<String,T> fromLCConverter, Function<T,String> toLCConverter)Creates a new observable based on a string launch configuration attributeIObservableValue<Integer>createIntegerAttribute(String id, int defaultValue)Creates new observable integer attribute.<T> IObservableValue<T>createObservableAttribute(String id, T defaultValue, ObservableLaunchConfigurationAttributeFactory.AttributeSetter<T> setter, ObservableLaunchConfigurationAttributeFactory.AttributeExtractor<T> getter)Creates a new generic observable launch configuration attributeIObservableValue<String>createStringAttribute(String id, String defaultValue)Creates new observable string attribute.voidinitializeFrom(ILaunchConfiguration configuration)Initialize values fromILaunchConfiguration.voidnotifyWhenDirty(Runnable dirtyNotification)voidperformApply(ILaunchConfigurationWorkingCopy workingCopy)Apply changes toILaunchConfigurationWorkingCopyvoidsetDefaults(ILaunchConfigurationWorkingCopy configuration)Initialize launch configuration with defaults.
-
-
-
Field Detail
-
lcUpdates
protected final Map<String,Consumer<ILaunchConfigurationWorkingCopy>> lcUpdates
-
mUpdates
protected final Map<String,Consumer<ILaunchConfiguration>> mUpdates
-
defaults
protected final Map<String,Consumer<ILaunchConfigurationWorkingCopy>> defaults
-
observables
protected final Map<String,IObservableValue<?>> observables
-
-
Method Detail
-
notifyWhenDirty
public void notifyWhenDirty(Runnable dirtyNotification)
-
initializeFrom
public void initializeFrom(ILaunchConfiguration configuration)
Initialize values fromILaunchConfiguration.
-
performApply
public void performApply(ILaunchConfigurationWorkingCopy workingCopy)
Apply changes toILaunchConfigurationWorkingCopy
-
setDefaults
public void setDefaults(ILaunchConfigurationWorkingCopy configuration)
Initialize launch configuration with defaults.
-
createStringAttribute
public IObservableValue<String> createStringAttribute(String id, String defaultValue)
Description copied from interface:ObservableLaunchConfigurationAttributeFactoryCreates new observable string attribute.- Specified by:
createStringAttributein interfaceObservableLaunchConfigurationAttributeFactory- Parameters:
id- the id of the string attributedefaultValue- the default value- Returns:
- an observable string value
-
createIntegerAttribute
public IObservableValue<Integer> createIntegerAttribute(String id, int defaultValue)
Description copied from interface:ObservableLaunchConfigurationAttributeFactoryCreates new observable integer attribute.- Specified by:
createIntegerAttributein interfaceObservableLaunchConfigurationAttributeFactory- Parameters:
id- the id of the integer attributedefaultValue- the default value- Returns:
- an observable integer value
-
createBooleanAttribute
public IObservableValue<Boolean> createBooleanAttribute(String id, boolean defaultValue)
Description copied from interface:ObservableLaunchConfigurationAttributeFactoryCreates new observable boolean attribute.- Specified by:
createBooleanAttributein interfaceObservableLaunchConfigurationAttributeFactory- Parameters:
id- the id of the boolean attributedefaultValue- the default value- Returns:
- an observable boolean value
-
createFromStringAttribute
public <T> IObservableValue<T> createFromStringAttribute(String id, T defaultValue, Function<String,T> fromLCConverter, Function<T,String> toLCConverter)
Description copied from interface:ObservableLaunchConfigurationAttributeFactoryCreates a new observable based on a string launch configuration attribute- Specified by:
createFromStringAttributein interfaceObservableLaunchConfigurationAttributeFactory- Type Parameters:
T- the type of the observable object- Parameters:
id- the id of the string attributedefaultValue- the default valuefromLCConverter- the converter function from string to the observable object typetoLCConverter- the converter function from the object type to string- Returns:
- an observable value of the specified type
-
createObservableAttribute
public <T> IObservableValue<T> createObservableAttribute(String id, T defaultValue, ObservableLaunchConfigurationAttributeFactory.AttributeSetter<T> setter, ObservableLaunchConfigurationAttributeFactory.AttributeExtractor<T> getter)
Description copied from interface:ObservableLaunchConfigurationAttributeFactoryCreates a new generic observable launch configuration attribute- Specified by:
createObservableAttributein interfaceObservableLaunchConfigurationAttributeFactory- Type Parameters:
T- the type of the observable value- Parameters:
id- the id of the launch configuration attributedefaultValue- the default value, if the attribute is not setsetter- the function to store an instance of the observable value in the launch configuration objectgetter- the function to get an instance of the observable value from the launch configuration object- Returns:
- an observable value.
-
-