org.eclipse.cdt.managedbuilder.core
Class ManagedOptionValueHandler

java.lang.Object
  extended by org.eclipse.cdt.managedbuilder.core.ManagedOptionValueHandler
All Implemented Interfaces:
IManagedOptionValueHandler

public class ManagedOptionValueHandler
extends java.lang.Object
implements IManagedOptionValueHandler

This class implements the default managed option value handler for MBS. It is also be intended to be used as a base class for other value handlers.


Field Summary
 
Fields inherited from interface org.eclipse.cdt.managedbuilder.core.IManagedOptionValueHandler
EVENT_APPLY, EVENT_CLOSE, EVENT_LOAD, EVENT_OPEN, EVENT_SETDEFAULT
 
Method Summary
static ManagedOptionValueHandler getManagedOptionValueHandler()
           
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getManagedOptionValueHandler

public static ManagedOptionValueHandler getManagedOptionValueHandler()

handleValue

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

Specified by:
handleValue in interface IManagedOptionValueHandler
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

public boolean isDefaultValue(IBuildObject configuration,
                              IHoldsOptions holder,
                              IOption option,
                              java.lang.String extraArgument)
Description copied from interface: IManagedOptionValueHandler
Checks whether the value of an option is its default value.

Specified by:
isDefaultValue in interface IManagedOptionValueHandler
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

public boolean isEnumValueAppropriate(IBuildObject configuration,
                                      IHoldsOptions holder,
                                      IOption option,
                                      java.lang.String extraArgument,
                                      java.lang.String enumValue)
Description copied from interface: IManagedOptionValueHandler
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.

Specified by:
isEnumValueAppropriate in interface IManagedOptionValueHandler
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.