de.cau.cs.kieler.sim.kiem
Interface IKiemConfigurationProvider

All Known Implementing Classes:
ConfigurationProvider

public interface IKiemConfigurationProvider

Components implementing this interface can provide configuration information for KIEM. For example change the aimed step duration and be notified if the user changes it in one of the components.

Whenever the value of a configuration element is needed by the plugin it will start to ask all configuration providers for a value through the changeProperty(propertyId) method. Providers that do not wish to provide a value or can't provide one should throw an Exception. The plugin will take the value from the first provider that does not throw an Exception. All other providers will be ignored.

When a property is changed through the user interface the plugin will inform all providers of the change through a (key, value) pair.

The extension point only supports String values as that is the format that is easiest to store in the PreferenceScope. This implementation might later be changed to support general Objects that must at least implement the Serializable interface.

For a list of supported properties see: KiemPlugin

For an implementation example see: KiemPlugin.getAimedStepDuration() KiemPlugin.setAimedStepDuration(int)

Rating proposed yellow
(2010-02-03)

Method Summary
 String changeProperty(String propertyId)
          Ask the component to give a new value for the property specified by the id.
 void propertyChanged(String propertyId, String value)
          Notify the listener that the user changed the property specified by the id.
 

Method Detail

changeProperty

String changeProperty(String propertyId)
                      throws KiemPropertyException
Ask the component to give a new value for the property specified by the id. If multiple components are registered on this extension point only the first value that was successfully retrieved will be used. All other providers will not be asked.

Parameters:
propertyId - the id of the property to change.
Returns:
the new value of the property.
Throws:
KiemPropertyException - if the propertyId was not found.

propertyChanged

void propertyChanged(String propertyId,
                     String value)
Notify the listener that the user changed the property specified by the id.

Parameters:
propertyId - the id of the property.
value - the new value of the property.