1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-04 15:45:25 +02:00

[225506][api][breaking] Move RSEUIPlugin#getShowPreferencePageActions() to internal

This commit is contained in:
Martin Oberhuber 2008-04-09 20:20:26 +00:00
parent 080b1790a5
commit 5e6868fa1c
2 changed files with 37 additions and 40 deletions

View file

@ -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<prefPageActions.length; idx++)
@ -84,5 +110,5 @@ public class SystemCascadingPreferencesAction
}
}
setBusyCursor(false);
}
}
}

View file

@ -55,8 +55,6 @@ import org.eclipse.rse.internal.core.model.SystemProfileManager;
import org.eclipse.rse.internal.core.model.SystemRegistry;
import org.eclipse.rse.internal.ui.RSESystemTypeAdapterFactory;
import org.eclipse.rse.internal.ui.RSEUIInitJob;
import org.eclipse.rse.internal.ui.SystemResources;
import org.eclipse.rse.internal.ui.actions.SystemShowPreferencesPageAction;
import org.eclipse.rse.internal.ui.subsystems.SubSystemConfigurationProxyAdapterFactory;
import org.eclipse.rse.internal.ui.view.SubSystemConfigurationAdapterFactory;
import org.eclipse.rse.internal.ui.view.SystemViewAdapterFactory;
@ -88,7 +86,6 @@ public class RSEUIPlugin extends SystemBasePlugin
private Vector viewSuppliers = new Vector();
private SystemViewAdapterFactory svaf; // for fastpath access
private SystemTeamViewResourceAdapterFactory svraf; // for fastpath
private SystemShowPreferencesPageAction[] showPrefPageActions = null;
private boolean loggingSystemMessageLine = false;
/**
@ -606,32 +603,6 @@ public class RSEUIPlugin extends SystemBasePlugin
return RSECorePlugin.isTheSystemRegistryActive();
}
/**
* 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
*/
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;
}
/**
* @return The URL to the message file DTD. Null if it is not found.
*/