1

I have a little experience using Activities with Eclipse RCP to hide plugin UI components, but this one is stumping me. I used the Eclipse Plug-in Selection Spy to try and see which plugin provides the import/export buttons at the bottom of the default Preferences page, and it seems to point to org.eclipse.ui.workbench. At least, that's what comes up when I can actually click on the Preferences dialog. When I do Alt + Shift + F1 and try to click on the Export button, for example, the cursor turns back into a regular pointer and the Plug-in Spy window comes up empty when I click.

The class that provides the default Preferences page is org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog. This class extends org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog, which has a method that adds the import/export buttons to the dialog upon calling open().

So, I looked in the org.eclipse.ui.workbench plugin to try and find something to put in my activityPatternBinding that would hide these buttons. I tried using

<activityPatternBinding
    activityId="my_hidden_activity"
    isEqualityPattern="true"
    pattern="org.eclipse.ui.workbench/org.eclipse.ui.internal.wizards.preferences.PreferencesImportWizard">
</activityPatternBinding>

to prevent the import class from being shown and maybe that would stop the button from showing up, but that did not work.

Does anyone know how to get rid of these icons without completely rewriting the default Preferences dialog?

greg-449
  • 109,219
  • 232
  • 102
  • 145
jcurley
  • 66
  • 5

1 Answers1

1

You can only hide items if the code that creates them calls the activity manager to check if they are being filtered - usually by calling WorkbenchActivityHelper.filterItem.

The import / export code in FilteredPreferenceDialog doesn't make this call so it cannot be removed with activities. I don't see any way to suppress these buttons.

greg-449
  • 109,219
  • 232
  • 102
  • 145