org.eclipse.cdt.managedbuilder.core
Interface IManagedOptionValueHandler

All Known Implementing Classes:
ManagedOptionValueHandler

public interface IManagedOptionValueHandler

This interface represents an option value handler in the managed build system. It is used to enable a tool integrator to use the MBS configuration GUI, while linking to an alternative back-end.

Since:
3.0

Field Summary
static int EVENT_APPLY
          The default value option::defaultValue has been set.
static int EVENT_CLOSE
          The option is opened, i.e. its UI element is created.
static int EVENT_LOAD
          The option has been set by pressing the Apply button (or the OK button).
static int EVENT_OPEN
           
static int EVENT_SETDEFAULT
          The option is closed. i.e. its value has been destroyed when a configuration/resource gets deleted.
 
Method Summary
 boolean handleValue(IBuildObject configuration, IHoldsOptions holder, IOption option, java.lang.String extraArgument, int event)
          Handles transfer between values between UI element and back-end in different circumstances.
 boolean isDefaultValue(IBuildObject configuration, IHoldsOptions holder, IOption option, java.lang.String extraArgument)
          Checks whether the value of an option is its default value.
 boolean isEnumValueAppropriate(IBuildObject configuration, IHoldsOptions holder, IOption option, java.lang.String extraArgument, java.lang.String enumValue)
          Checks whether an enumeration value of an option is currently a valid choice.
 

Field Detail

EVENT_OPEN

static final int EVENT_OPEN
See Also:
Constant Field Values

EVENT_CLOSE

static final int EVENT_CLOSE
The option is opened, i.e. its UI element is created. The valueHandler can override the value of the option. If it does not, the last persisted value is used.

See Also:
Constant Field Values

EVENT_SETDEFAULT

static final int EVENT_SETDEFAULT
The option is closed. i.e. its value has been destroyed when a configuration/resource gets deleted. The valuehandler can do various things assocaited with destroying the option such as freeing the memory associated with this option callback, if needed.

See Also:
Constant Field Values

EVENT_APPLY

static final int EVENT_APPLY
The default value option::defaultValue has been set. The handleValue callback is called afterwards to give the handler a chance to override the value or to update the value in its back-end. Typically this event will be called when the Restore Defaults button is pressed.

See Also:
Constant Field Values

EVENT_LOAD

static final int EVENT_LOAD
The option has been set by pressing the Apply button (or the OK button). The valueHandler can transfer the value of the option to its own back-end.

See Also:
Constant Field Values
Method Detail

handleValue

boolean handleValue(IBuildObject configuration,
                    IHoldsOptions holder,
                    IOption option,
                    java.lang.String extraArgument,
                    int event)
Handles transfer between values between UI element and back-end in different circumstances.

Parameters:
configuration - build configuration of option (may be IConfiguration or IResourceConfiguration)
holder - contains the holder of the option
option - the option that is handled
extraArgument - extra argument for handler
event - event to be handled
Returns:
True when the event was handled, false otherwise. This enables default event handling can take place.

isDefaultValue

boolean isDefaultValue(IBuildObject configuration,
                       IHoldsOptions holder,
                       IOption option,
                       java.lang.String extraArgument)
Checks whether the value of an option is its default value.

Parameters:
configuration - build configuration of option (may be IConfiguration or IResourceConfiguration)
holder - contains the holder of the option
option - the option that is handled
extraArgument - extra argument for handler The additional options besides configuration are supplied to provide enough information for querying the default value from a potential data storage back-end.
Returns:
True if the options value is its default value and False otherwise. This enables that default event handling can take place.

isEnumValueAppropriate

boolean isEnumValueAppropriate(IBuildObject configuration,
                               IHoldsOptions holder,
                               IOption option,
                               java.lang.String extraArgument,
                               java.lang.String enumValue)
Checks whether an enumeration value of an option is currently a valid choice. The use-case for this method is the case, where the set of valid enumerations in the plugin.xml file changes. The UI will remove entries from selection lists if the value returns false.

Parameters:
configuration - build configuration of option (may be IConfiguration or IResourceConfiguration)
holder - contains the holder of the option
option - the option that is handled
extraArgument - extra argument for handler
enumValue - enumeration value that is to be checked The additional options besides configuration are supplied to provide enough information for querying information from a a potential data storage back-end.
Returns:
True if the enumeration value is valid and False otherwise.