Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] IOptionApplicability

Hi,

I'm trying to implement an IOptionApplicability class for an option
which should be enabled depending on the state of another (enum) option.

This is the method which tries to determine the state of the enum option:

>     private final boolean usingCustomLibraryConfig(IHoldsOptions holder,
>             IOption option)
>     {
>         IOption o = holder.getOptionById(OptionConstants.LIB_CONFIG_OPTION);
>         assert o != null;
>         try {
>             String s = o.getSelectedEnum();
> 
>             System.err.println("Selected enum: " + s);
> 
>             if (s.equals(OptionConstants.LIB_CONFIG_CUSTOM)) {
>                 return true;
>             } else {
>                 return false;
>             }
> 
>         } catch (BuildException e) {
>             e.printStackTrace();
>         }
>         return false;
> 
>     }

The problem is that the return value from getSelectedEnum() is always
the default value (which is != LIB_CONFIG_CUSTOM in this case),
regardless of the actual state of the combobox in the UI. So the method
always returns false, and the option is therefore always disabled.

What am I doing wrong?

-- 
/Jesper


Back to the top