Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] cdt-dev Digest, Vol 108, Issue 32

On 02/20/2014 02:00 PM, cdt-dev-request@xxxxxxxxxxx wrote:
Send cdt-dev mailing list submissions to

To subscribe or unsubscribe via the World Wide Web, visit
or, via email, send a message with subject or body 'help' to

You can reach the person managing the list at

When replying, please edit your Subject line so it is more specific
than "Re: Contents of cdt-dev digest..."

Today's Topics:

    1. Re: Getting Code Analysis preferences of a project
       (Andrew Eidsness)


Message: 1
Date: Thu, 20 Feb 2014 11:41:59 -0500
From: Andrew Eidsness <eclipse@xxxxxxxxxx>
To: cdt-dev@xxxxxxxxxxx
Subject: Re: [cdt-dev] Getting Code Analysis preferences of a project
Message-ID: <53063057.2030508@xxxxxxxxxx>
Content-Type: text/plain; charset=ISO-8859-1

On 14-02-20 11:34 AM, Roberto Oliveira wrote:

In the project's preferences,C/C++ General > Code Analysis, there are two options for CODAN. One is  "Use workspace
Settings" and the other is "Use project Settings". (like in picture bellow)

Is there a way to programmatically  get what option is selected for a specific project?if is selected "use workspace
settings" or "use project settings" ?
Based on the code in CheckersRegistry.getResourceProfile, I think you want to do:

	IProject project;
	Preferences projectNode = CodanPreferencesLoader.getProjectNode(project);
	boolean useProjectPrefs
		=  projectNode != null
		&& !projectNode.getBoolean(PreferenceConstants.P_USE_PARENT, true));

I.e., is looks like the ProjectScope preferences store a boolean preference "useParentScope" when the project-specific
settings should be ignored.

Thanks a lot, it worked fine..I just had to change the "Preferences" by "IEclipsePreferences" and it worked.

Another issue that I have is how can I open that Code Analysis preference of a Specific Project programmatically?

    To open workspace Code Analysis preferences I can use something like:

Shell activeShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); PreferenceDialog pref = PreferencesUtil.createPreferenceDialogOn(activeShell, "org.eclipse.cdt.codan.ui.preferences.CodanPreferencePage", null, null);

    Thanks again.


cdt-dev mailing list

End of cdt-dev Digest, Vol 108, Issue 32

Back to the top