Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Common toolchain options

Hi John,

The reason you are seeing the ".<integer_number>" appended to the oprion's ID is the following: when the "default" option value specified in the plugin.xml file gets modified for some configuration a new instance of the option is created having the "extension" options (the one defined in the plugin.xml) as a super-class (see IOption.getSuperClass()) and the ID="<option_superclass_ID>.<integer_number>"

You could use the following logic in your value handler to determine whether the given option is the one representing the "extension.option.id" extension option:

Public boolean handleValue(IBuildObject configuration, 
                    IHoldsOptions holder, 
                    IOption option,
                    String extraArgument, 
                    int event){
	IOption neededOption = holder.getOptionBySuperClassId(extension.option.id");
	if(neededOption == option){
		//process the option
	}

}

Regards,
Mikhail

>-----Original Message-----
>From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On
>Behalf Of John MOULE
>Sent: Tuesday, November 13, 2007 8:31 PM
>To: lagarcia@xxxxxxxxxx; CDT General developers list.
>Subject: Re: [cdt-dev] Common toolchain options
>
>Hi,
>
>I'm having trouble implementing my own IManagedOptionValueHandler.
>
>I've partly implemented the example shown in the link below and
>uncommented out the code in handleValue():
>
>http://www.koders.com/java/fidFABDBCEFC7D7B59A060EFB0C4565C5CC4D9BB170.aspx
>?s=idef%3Aconfiguration
>
>I changed the singleton instantiation to use just a normal public
>constructor so I could play around with the code. When I run I get
>EVENT_OPEN & EVENT_APPLY events for my correct options but with random
>numbers at the end of the option IDs. I assume this is because multiple
>instances of the class are being created. But how am I supposed to use
>this? How should the handler be instantiated by my plugin?
>
>
>Thanks for any advice.
>
>rgds john
>
>
>
>
>Leonardo Augusto GuimarĂ£es Garcia wrote:
>> Hi,
>>
>> djlynott@xxxxxxxxxxxxxxxxxxx wrote:
>>>
>>> I'm trying to add support for a GCC based cross development toolchain
>>> with CDT 4.0. Many projects I work with are mixed language and have C
>>> and C++ sources. While the current GCC based toolchains support this,
>>> they force me to enter include paths and other settings separately for
>>> each tool.
>>>
>>> When developing my plug-in I would like to have a number of options
>>> like include paths that are shared between tools. Is this possible
>>> from a UI and model perspective (the MBS extensibility document
>>> indicates an option can have only one tool).
>>>
>> If you would like to share exactly the same option values between two
>> options from different tools in the same tool-chain you can use the
>> IManagedOptionValueHandler interface and valueHandler attribute of the
>> option element on the buildDefinitions extension-point. This way, when
>> the value of one of the options change, you can programmatically sync
>> the value of the other option.
>>> Since many of the toolchains I want to support are cross development
>>> toolchains, I think the current "Manage configurations" dialog is a
>>> bit naive at present. It should select a toolchain and then offer
>>> existing and default configurations that match the toolchain vs.
>>> assume the existing toolchain that is selected for the project (or at
>>> least allow me to override it in that dialog). I know our
>>> configurations are quite complex and I think my users are going to
>>> want the ability to import configurations external to a given project
>>> as well.
>>>
>>> I'd like to make minimal changes to support the above use-cases or at
>>> least know that CDT development will align with my needs before
>>> expending a bunch of work. Are these type of things planned? Are they
>>> there already and I just don't know how to take advantage of them? I
>>> could use some guidance.
>>>
>>>
>>> Thanks,
>>> -- Dave
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> cdt-dev mailing list
>>> cdt-dev@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>>>
>>
>> Leonardo Garcia
>> IDE Software Engineer - Linux on Cell
>> Linux Technology Center Brazil
>> Phone: +55-19-2132-2068 (T/L: 839-2068)
>> lagarcia@xxxxxxxxxx
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> cdt-dev mailing list
>> cdt-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>
>_______________________________________________
>cdt-dev mailing list
>cdt-dev@xxxxxxxxxxx
>https://dev.eclipse.org/mailman/listinfo/cdt-dev
--------------------------------------------------------------------
Closed Joint Stock Company Intel A/O
Registered legal address: 125252, Moscow, Russian Federation, 
Chapayevsky Per, 14.

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


Back to the top