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?

Are you trying to add pre-processor symbols?

There's not enough context in the snippet you've provided, but you
need to create options expected by the tool / toolchain you're

An alternative is to go through the project model. Any symbols + paths
you add there will be automatically stored by the MBS and added to the
correct tool options. You can do this by:
  1)  ICConfigurationDescription#getResourceDescriptions()
   This will return all the 'resource descriptions' which are some
path in the project + custom settings. It's assumed that if a resource
doesn't have a description it inherits from the parent in the resource
tree. So for most projects there'll be just one of these corresponding
to the settings stored on the project.
  2) Get the language specific settings from the resource description:
  3) If the ICLanguageSetting#supportsEntryKind(ICSettingEntry#MACRO)
[if macros are what you're trying to add]
        ICSettingEntry[] oldEntries =
        ICSettingEntry[] newEntries = oldEntries + my_new_entries;
        ICLanguageSetting#setSettingsEntries(ICSettingEntry#MACRO, newEntries);
  4) Save the project description.

Your macros / paths / whatever will now be available to the core model
and visible in the MBS UI.

Hope this helps.


On 26 May 2010 09:07, Flo Menier <josieenfrance@xxxxxxxxxxx> wrote:
> I don't know if it's a question about UI or not, so I send to all.
> apparently, symbols are added sucessfully, but when I check it in the
> property of project, no symbol appeared in UI.
> newSymbol = tool.createOption(null, "symbolTest","SymbolTestName",
> true);
> newSymbol.setValueType(IOption.STRING);
> try {
> newSymbol.setValue("symbolTestValue");
> } catch (BuildException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> IOption symbolCheck= ManagedBuildManager.getExtensionOption("symbolTest");
> System.out.println("symbol value: "+symbolCheck.getValue());
> UI can detect the changes automatically, if not, how can do it?
> thanks in advance,
> cheers
> ________________________________
> 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

Back to the top