Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Preferences

Probably there is misunderstanding from my side. Preferences are workspace-specific, properties - resource-specific. If "whatever" is a correct object that represents existing resource, its method getProject() never returns null, does not matter from where it was called from. Opposite to properties which can be stored in resource belonged to project (such as .cdtproject) preferences should be stored in metadata (usually in the plugin storage) and can be accessed via plugin class methods such as getPluginPreferences(). Sorry if I'm writing things well known for you, I'm just trying to extract your problem.

Chris Moller wrote:

Thanks for the reply, but where do you get the "project" arg for getCProjectDescription(project, false)? So far as I can figure out, the only circumstance under which any variation of whatever.getProject() returns anything but null is from inside the a PropertyPage extension. There has to be a way to communicate preferences out of the PropertyPage class, but damned if I can find it.

Chris Moller

Alex Chapiro wrote:

I use for that  ICDescriptor class instance

ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(project, false);
       Element element = descriptor.getProjectData(SECTION_ID);

And then move through DOM elements tree:


       for(Node child = element.getFirstChild();
           null != child;
           child = child.getNextSibling()) {
           if(!(child instanceof Element))
               continue;
           if(MyName.equals(child.getNodeName())) {
               doSomething();
           }                   }



Chris Moller wrote:

A question for the world at large:

In CDT, I've written a plugin that, as part of what it does, sets up a PropertyPage that ultimately stores info in the per-project .cdtproject file. Now, how do I retreive that info from elsewhere in the plugin?

Any hints would be appreciated.

Chris Moller
Senior Hacker
Red Hat, Inc.

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/cdt-dev




Back to the top