Interface ObservableLaunchConfigurationAttributeFactory

  • All Known Implementing Classes:
    ObservableLaunchConfigurationAdapter

    public interface ObservableLaunchConfigurationAttributeFactory
    This factory interface provides the required capabilities to define mappings between launch configuration attributes and observable variables. It simplifies creating launch configuration dialogs, as it enables you to use eclipse databindings in your editor logic.
    • Method Detail

      • createObservableAttribute

        <T> IObservableValue<T> createObservableAttribute​(String id,
                                                          T defaultValue,
                                                          ObservableLaunchConfigurationAttributeFactory.AttributeSetter<T> setter,
                                                          ObservableLaunchConfigurationAttributeFactory.AttributeExtractor<T> getter)
        Creates a new generic observable launch configuration attribute
        Type Parameters:
        T - the type of the observable value
        Parameters:
        id - the id of the launch configuration attribute
        defaultValue - the default value, if the attribute is not set
        setter - the function to store an instance of the observable value in the launch configuration object
        getter - the function to get an instance of the observable value from the launch configuration object
        Returns:
        an observable value.
      • createStringAttribute

        IObservableValue<String> createStringAttribute​(String id,
                                                       String defaultValue)
        Creates new observable string attribute.
        Parameters:
        id - the id of the string attribute
        defaultValue - the default value
        Returns:
        an observable string value
      • createIntegerAttribute

        IObservableValue<Integer> createIntegerAttribute​(String id,
                                                         int defaultValue)
        Creates new observable integer attribute.
        Parameters:
        id - the id of the integer attribute
        defaultValue - the default value
        Returns:
        an observable integer value
      • createBooleanAttribute

        IObservableValue<Boolean> createBooleanAttribute​(String id,
                                                         boolean defaultValue)
        Creates new observable boolean attribute.
        Parameters:
        id - the id of the boolean attribute
        defaultValue - the default value
        Returns:
        an observable boolean value
      • createFromStringAttribute

        <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 attribute
        Type Parameters:
        T - the type of the observable object
        Parameters:
        id - the id of the string attribute
        defaultValue - the default value
        fromLCConverter - the converter function from string to the observable object type
        toLCConverter - the converter function from the object type to string
        Returns:
        an observable value of the specified type