Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] symbols added don't appear in UI?

Use CMacroEntry rather than creating your own. Apart from anything
else you've got the kind wrong.  Add tracing on which resource
description you're adding the entries on, and check in the ui for
those resources for the macro entry.

James

On 26 May 2010 13:48, Flo Menier <josieenfrance@xxxxxxxxxxx> wrote:
> Sorry about the previous message.
> Can you verify my program please? I did not get the symbols in UI :(
>
> IWorkspace workspace = ResourcesPlugin.getWorkspace();
> IProject[] projects = workspace.getRoot().getProjects();
> ICProjectDescription prjDesc;
> for (IProject project : projects) {
> prjDesc = CoreModel.getDefault().getProjectDescription(project);
> ICConfigurationDescription[] descs = prjDesc.getConfigurations();
> for (ICConfigurationDescription desc : descs) {
> for( ICFolderDescription filedes : desc.getFolderDescriptions()){
> //for (ICResourceDescription rsc: desc.getResourceDescriptions()){
> for(ICLanguageSetting lang:
> filedes.getLanguageSettings())//;//.getLanguageSettings();
> {
> ICLanguageSettingEntry[] oldEntries =
> lang.getSettingEntries(ICLanguageSetting.SETTING_LANGUAGE);//getSettingEntries(ICSettingEntry.MACRO);
> ICLanguageSettingEntry test = new ICLanguageSettingEntry() {
> @Override
> public boolean isResolved() {
> // TODO Auto-generated method stub
> return false;
> }
> @Override
> public boolean isReadOnly() {
> // TODO Auto-generated method stub
> return false;
> }
> @Override
> public boolean isBuiltIn() {
> // TODO Auto-generated method stub
> return true;
> }
> @Override
> public String getValue() {
> // TODO Auto-generated method stub
> return "SymbolTestValue";
> }
> @Override
> public String getName() {
> // TODO Auto-generated method stub
> return "SymbolTestName";
> }
> @Override
> public int getKind() {
> // TODO Auto-generated method stub
> return 2;
> }
> @Override
> public int getFlags() {
> // TODO Auto-generated method stub
> return 0;
> }
> @Override
> public boolean equalsByName(ICSettingEntry entry) {
> // TODO Auto-generated method stub
> return false;
> }
> @Override
> public boolean equalsByContents(ICSettingEntry entry) {
> // TODO Auto-generated method stub
> return false;
> }
> };
> ICLanguageSettingEntry[] newEntries = new ICLanguageSettingEntry[1];
> newEntries[0] = test;
> lang.setSettingEntries(ICSettingEntry.MACRO, newEntries);
> }
> }
> try {
> CoreModel.getDefault().setProjectDescription(project, prjDesc);// save the
> description for the project
> } catch (CoreException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
>> Date: Wed, 26 May 2010 13:19:40 +0100
>> Subject: Re: [cdt-dev] symbols added don't appear in UI?
>> From: jamesblackburn@xxxxxxxxx
>> To: cdt-dev@xxxxxxxxxxx
>>
>> On 26 May 2010 13:13, Flo Menier <josieenfrance@xxxxxxxxxxx> wrote:
>> > That helps me a lot :)
>> > one more question:
>> > In step 3, ICLanguageSetting#setSettingsEntries(ICSettingEntry#MACRO,
>> > newEntries); this method require a ICLanguageSettingEntry[] type for the
>> > second parameter. I created ICSettingEntry[] newEntries.
>>
>> What's the question?
>>
>> >> Date: Wed, 26 May 2010 10:57:41 +0100
>> >> Subject: Re: [cdt-dev] symbols added don't appear in UI?
>> >> From: jamesblackburn@xxxxxxxxx
>> >> To: cdt-dev@xxxxxxxxxxx
>> >>
>> >> On 26 May 2010 10:43, Flo Menier <josieenfrance@xxxxxxxxxxx> wrote:
>> >> > Thanks James for the response. Yes, I'am trying to add pre-processor
>> >> > symbols. I created a plugin based on custom C project with given
>> >> > makefiles. The problem is, when the project is created, some symbols
>> >> > defined
>> >> > in makefile are desired to be added to this project before the
>> >> > compilation
>> >> > for example.
>> >>
>> >> I believe if you follow the steps I outlined that will work.
>> >>
>> >> Note this is what Paths & Symbols UI does, take a look at
>> >> AbstractLangListTab. The MBS ToolSettingsTab is the equivalent tab
>> >> in the build system which modifies the IConfigurations directly.
>> >> The other thing you can do is register an External setting provider
>> >> which can be called back to provide settings for the build:
>> >>
>> >>
>> >> http://wiki.eclipse.org/CDT/Developer/FAQ#How_do_I_contribute_Include_.26_Library_paths_to_a_project_configuration.3F
>> >>
>> >> Cheers,
>> >> James
>> >> _______________________________________________
>> >> cdt-dev mailing list
>> >> cdt-dev@xxxxxxxxxxx
>> >> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>> >
>> > ________________________________
>> > Hotmail : un service de messagerie gratuit, fiable et complet
>> > Profitez-en
>> > _______________________________________________
>> > 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
>
> ________________________________
> Votre messagerie et bien plus où que vous soyez. Passez à Windows Live
> Hotmail, c'est gratuit ! Inscrivez-vous
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>
>


Back to the top