|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.sim.kiem.config.managers.AbstractManager
de.cau.cs.kieler.sim.kiem.config.managers.ConfigurationManager
public final class ConfigurationManager
Handles the default and currently running configuration.
Method Summary | |
---|---|
void |
addProperty(KiemProperty prop)
Add a new property to the default configuration. |
String |
findProperty(String propertyKey)
Try to find a specific property value. |
String |
findPropertyValue(KiemPropertyKeyWrapper key,
String defaultValue)
Try to find a specific property value. |
List<KiemPropertyKeyWrapper> |
getAllKeys()
Get all keys in the default configuration. |
ConfigDataComponent |
getCurrentConfig()
Returns the configuration of the currently running schedule. |
ConfigDataComponent |
getDefaultConfig()
Get the default configuration. |
KiemProperty[] |
getExternalDefaultProperties()
Get all default properties that were created by the user. |
static ConfigurationManager |
getInstance()
Returns the singleton instance of this manager. |
KiemProperty[] |
getInternalDefaultProperties()
Get all default properties that are used by the KIEM itself and that can be changed through more convenient means than a table. |
void |
initWithDefaults(AbstractDataComponent dataComponent)
Initialize a data component with the default values. |
void |
load()
Load the saved data from the plugin's preference store. |
void |
removeProperty(KiemPropertyKeyWrapper key)
Removes properties with the specified key. |
void |
restoreDefaultEditorDefaults()
Restore the default editor to the coded defaults. |
void |
restoreDefaults()
Restore the default settings. |
void |
save()
Save the default configuration to the eclipse preferences. |
void |
updateCurrentProperty(KiemPropertyKeyWrapper propertyId,
String value)
Updates the property in the currently loaded configuration. |
void |
updateCurrentProperty(String key,
String value)
Update a property in the current configuration. |
void |
updateDefaultProperty(String key,
String value)
Update a property in the default configuration. |
Methods inherited from class de.cau.cs.kieler.sim.kiem.config.managers.AbstractManager |
---|
addEventListener, load, notifyListeners, remove, removeEventListener, save, saveAll |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ConfigurationManager getInstance()
public List<KiemPropertyKeyWrapper> getAllKeys()
public ConfigDataComponent getCurrentConfig()
public ConfigDataComponent getDefaultConfig()
public KiemProperty[] getExternalDefaultProperties()
public KiemProperty[] getInternalDefaultProperties()
This does not include the default editor name and key as that can be modified through another dialog by selection from list.
public void addProperty(KiemProperty prop)
prop
- The property to be added.public String findProperty(String propertyKey) throws KiemPropertyException
This method can be called from another plug-in and is part of the KIEM Configurations API.
One place to add values that can be retrieved by this method is the User Defined Properties page in the KIEM preference pages.
propertyKey
- the key of the property
KiemPropertyException
- if the value could not be foundpublic String findPropertyValue(KiemPropertyKeyWrapper key, String defaultValue) throws KiemPropertyException
First the method tries to look for the key in the currently loaded configuration unless the key is in the list of keys where the default configuration should be used anyway. If finding the key in the current configuration fails the method continues to look for it in the default configuration. If the property is found it is added to the currently running configuration and returned.
If the property is not and a non-null default value is supplied the property is added to the default and currently running configuration. If no default value is supplied an exception is thrown.
key
- The key to look for.defaultValue
- the default value to assign if the property is not found, not
used if it is null
KiemPropertyException
- if no property could be found. Can not happen if defaultValue
is not null.public void removeProperty(KiemPropertyKeyWrapper key)
key
- the key of the properties that will be removed.public void updateCurrentProperty(KiemPropertyKeyWrapper propertyId, String value)
propertyId
- the key of the property to changevalue
- the new value of the propertypublic void updateCurrentProperty(String key, String value)
If the key doesn't exist a new property is created. If the key already exists the value in the existing property is updated with the new value.
This method can be called from another plug-in and is part of the KIEM Configurations API.
These saved properties can be accessed by findProperty(String)
key
- a unique non-null key for the added propertyvalue
- the value for the added propertypublic void updateDefaultProperty(String key, String value)
If the key doesn't exist a new property is created. If the key already exists the value in the existing property is updated with the new value.
This method can be called from another plug-in and is part of the KIEM Configurations API.
These saved properties can be accessed by findProperty(String)
key
- a unique non-null key for the added propertyvalue
- the value for the added propertypublic void initWithDefaults(AbstractDataComponent dataComponent)
dataComponent
- the data componentpublic void restoreDefaultEditorDefaults()
public void restoreDefaults()
public void load()
load
in class AbstractManager
public void save()
save
in class AbstractManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |