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 14-02-20 12:15 PM, Roberto Oliveira wrote:

> 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);

I haven't used that before, but from the code in CodanPreferencePage and PreferencesUtil, I think you just need to pass
the project to the page during construction.  It looks like PreferencesUtil.createPropertyDialogOn does that, so maybe:

    PreferenceDialog pref
        = PreferencesUtil.createPropertyDialogOn(
            activeShell,
            project,
            "org.eclipse.cdt.codan.ui.preferences.CodanPreferencePage",
            null, null);

-Andrew


Back to the top