Project: Eclipse_Platform_UI
Bug 208830 [Preferences] Need ability to get at property page details without using internal code
Reported: 2007-11-05 18:46:01 | Status: verified fixed

Hi... In DTP and ODA, we need the ability to get at property page details without using internal API. We're trying to clean up a variety of access warnings and this is the last major one to clean up. The list of classes we'd like access to either through a public utility or by making certain internal classes public includes: * PropertyPageContributorManager - we want to use this to determine if a given object has property pages (in our case it's typically connection profiles, but it could be anything visible in the DSE) public static boolean hasContributors(Object selected) { if (selected == null || !(selected instanceof IAdaptable)) return false; Collection contributors = PropertyPageContributorManager. getManager().getApplicableContributors(selected); return contributors != null && contributors.size() > 0; } * PropertyPageManager and PropertyDialog - these we use with the PropertyPageContributorManager to pop up a dialog with the applicable property pages. We need a handle to the dialog so we can manage it's size and position using mementos. Object selected = getSelectedObject(); if (selected == null || !(selected instanceof IAdaptable)) return; IAdaptable adaptable = (IAdaptable) selected; PropertyPageManager pageManager = new PropertyPageManager(); String title = ConnectivityUIPlugin.getDefault().getResourceString( "properties.dialog"); //$NON-NLS-1$ // load pages for the selection // fill the manager with contributions from the matching contributors PropertyPageContributorManager.getManager().contribute(pageManager, adaptable); PropertyDialog propertyDialog = new PropertyDialog(mViewer.getControl() .getShell(), pageManager, mViewer.getSelection()); propertyDialog.create();

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/PreferencesUtil.java