Hi Roman,
> The reason for this complexity is the fact that
there
is no easy way to find out different options from the
same configuration. And also the circumstance that all
saved/modified options IDs have some numeric suffixes
(e.g. bla.bla.option_x.12345) added by CDT makes it is
more difficult, since it is not possible any more to
search for something using the ID, because it does not
match the base part of the option ID (i.e.
bla.bla.option_x) any more.
[Mikhail] You can easily
obtain the option you need knowing its holder and the super-class ID. The IHoldsOptions.getOptionBySuperClassId(String
superClassId) will return the actual option you need based on the super-class
Id you provide.
The CDT 3.0.2 and later will
also define the IConfiguration.getToolsBySuperClassId() method to do the same
things with tools. This code is already in CVS, so you could use CDT sources
from HEAD or 3.0 branch to take advantage of this new facility.
>It is also not known
inside the handleValue method, if the value of the
option was updated or if it is just the "apply"
button, may be even without modifications.
[Mikhail] Try using the
IOption.isDirty() method to figure out whether the option value was changed or
not.
>May be an
additional boolean parameter "isUpdated" could be
useful here?
>Is it really so complex, or do I miss something?
>[Roman] Here I have a lot of problems. I
need to
add all possible enumeration values dynamically. So, I
do intercept the EVENT_OPEN. But how can I modify the
list of possible values of the enumerated type option
if there are no public methods in the Option classes
that would allow me to update/modify the enumList or
any other enumeration related fields. There is only
getEnumCommand, getEnumeratedId, getEnumName. The lack
of update APIs for enumeraed options makes it very
difficult if not impossible to implement what I need.
Can you please help me a bit further and explain in
more detail how your proposed solution can be
implemented?
[Mikhail] You are right,
there is no way currently to update the list of option enums.
I suppose this functionality
was not implemented because the usual tool would not require this, but I think
it could be useful for the tool-chain options that usually used to control/modify
some tool-chain wide behavior, or for the use-cases like yours.
Please raise a bugzilla
request and we will consider implementing this.
Regards,
Mikhail