Question

I am developing an Eclipse plugin which would create a new Java project and few classes inside it. Once the plugin wizard closes (after I click finish in the final page), i need the Project Properties window of this particular project to be opened automatically.

I must achieve that through code, any examples please?

Was it helpful?

Solution 2

I got the final answer. This is how it goes:

Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
MessageDialog.openInformation(shell, "Project Proeperties", "Properties window will open next");

String propertyPageId = "org.eclipse.jdt.ui.propertyPages.BuildPathsPropertyPage";
PreferenceDialog dialog = PreferencesUtil.createPropertyDialogOn(shell, iProject, propertyPageId, null, null);
    dialog.open();

OTHER TIPS

Use org.eclipse.ui.dialogs.PreferencesUtil

PreferencesUtil.createPropertyDialogOn(shell, element, null, null, null).open();

will display the full Properties dialog. The parameters allow you to choose the initial page and filter the pages shown.

The element parameter would be the IProject for the project.

You can find existing property page ids using the Eclipse Search dialog. Select the Plug-in Search tab and enter the property page extension point id org.eclipse.ui.propertyPages in the Search string. Set Search For to Extension Point, set Limit To to References and Scope to Workspace. Search dialog

Perform the search to get the plug-ins which use this extension point. Opening a search result will open the plugin.xml for the plugin at the extension point.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top