diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/actions/SystemCascadingPreferencesAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/actions/SystemCascadingPreferencesAction.java index 54aa80f4d41..32a2828cd09 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/actions/SystemCascadingPreferencesAction.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/actions/SystemCascadingPreferencesAction.java @@ -7,10 +7,10 @@ * * Initial Contributors: * The following IBM employees contributed to the Remote System Explorer - * component that contains this file: David McKnight, Kushal Munir, - * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. - * + * * Contributors: * {Name} (company) - description of contribution. *******************************************************************************/ @@ -32,12 +32,13 @@ import org.eclipse.swt.widgets.Shell; * A cascading menu action for "Preferences->". * @see org.eclipse.rse.internal.ui.actions.SystemShowPreferencesPageAction */ -public class SystemCascadingPreferencesAction +public class SystemCascadingPreferencesAction extends SystemBaseSubMenuAction implements IMenuListener { - + private static SystemShowPreferencesPageAction[] showPrefPageActions = null; + /** - * Constructor + * Constructor */ public SystemCascadingPreferencesAction(Shell shell) { @@ -46,23 +47,48 @@ public class SystemCascadingPreferencesAction setCreateMenuEachTime(false); setPopulateMenuEachTime(false); setSelectionSensitive(false); - + setHelp(RSEUIPlugin.HELPPREFIX+"actnpref"); //$NON-NLS-1$ } + /** + * Return an array of action objects to show for the "Preferences..." + * submenu of the RSE System View. For contributing a fastpath action to + * jump to your preferences page, from the local pulldown menu of the Remote + * Systems view. This may return null if no such actions are registered. + * + * @deprecated will be moved to using command/hander extension point as per + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=186769 + */ + public SystemShowPreferencesPageAction[] getShowPreferencePageActions() { + if (showPrefPageActions == null) { + // add our own preferences page action hardcoded + SystemShowPreferencesPageAction action = new SystemShowPreferencesPageAction(); + action.setPreferencePageID("org.eclipse.rse.ui.preferences.RemoteSystemsPreferencePage"); //$NON-NLS-1$ + // action.setPreferencePageCategory(preferencePageCategory) + // action.setImageDescriptor(id); + action.setText(SystemResources.ACTION_SHOW_PREFERENCEPAGE_LABEL); + action.setToolTipText(SystemResources.ACTION_SHOW_PREFERENCEPAGE_TOOLTIP); + action.setHelp("org.eclipse.rse.ui.aprefrse"); //$NON-NLS-1$ + showPrefPageActions = new SystemShowPreferencesPageAction[1]; + showPrefPageActions[0] = action; + } + return showPrefPageActions; + } + /** * @see SystemBaseSubMenuAction#getSubMenu() */ public IMenuManager populateSubMenu(IMenuManager ourSubMenu) { - // WE DON'T WANT TO FIRE UP ALL PLUGINS THAT USE OUR EXTENSION POINT, + // WE DON'T WANT TO FIRE UP ALL PLUGINS THAT USE OUR EXTENSION POINT, // AT THE TIEM WE ARE CREATING OUR VIEW! SO WE DEFER IT UNTIL THIS CASCADING // MENU IS FIRST EXPANDED... ourSubMenu.addMenuListener(this); ourSubMenu.setRemoveAllWhenShown(true); //menu.setEnabled(true); ourSubMenu.add(new SystemBaseAction("dummy",null)); //$NON-NLS-1$ - + return ourSubMenu; } @@ -74,7 +100,7 @@ public class SystemCascadingPreferencesAction //System.out.println("In menuAboutToShow!"); setBusyCursor(true); ourSubMenu.add(new Separator(ISystemContextMenuConstants.GROUP_ADDITIONS)); // user or BP/ISV additions - SystemShowPreferencesPageAction[] prefPageActions = RSEUIPlugin.getDefault().getShowPreferencePageActions(); + SystemShowPreferencesPageAction[] prefPageActions = getShowPreferencePageActions(); if (prefPageActions!=null) { for (int idx=0; idx