1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-09 18:15:23 +02:00

[180562] not implementing ISystemContextMenuConstants

This commit is contained in:
David McKnight 2007-04-03 16:25:10 +00:00
parent e52bdbba6e
commit e32350ca18

View file

@ -40,8 +40,7 @@ import org.eclipse.rse.ui.actions.SystemBaseSubMenuAction;
* Only exposes core set of MenuManager methods. Rest can be * Only exposes core set of MenuManager methods. Rest can be
* accessed by calling getMenuManger(). * accessed by calling getMenuManger().
*/ */
public class SystemMenuManager //implements IMenuManager public class SystemMenuManager
implements ISystemContextMenuConstants
{ {
private IMenuManager mgr; private IMenuManager mgr;
private IMenuManager newSubMenu, expandtoSubMenu, openwithSubMenu, browsewithSubMenu, comparewithSubMenu, replacewithSubMenu, workwithSubMenu, viewSubMenu, serverSubMenu; private IMenuManager newSubMenu, expandtoSubMenu, openwithSubMenu, browsewithSubMenu, comparewithSubMenu, replacewithSubMenu, workwithSubMenu, viewSubMenu, serverSubMenu;
@ -69,8 +68,8 @@ public class SystemMenuManager //implements IMenuManager
* Method declared on IContributionManager. * Method declared on IContributionManager.
* Add an action to this menu. * Add an action to this menu.
* COMMENTED OUT TO PREVENT CALLING IT. YOU SHOULD EXPLICITLY * COMMENTED OUT TO PREVENT CALLING IT. YOU SHOULD EXPLICITLY
* DECIDE WHAT GROUP EACH ACTION SHOULD BE ADDED TO, SO WE FORCE * DECIDE WHAT ISystemContextMenuConstants.GROUP EACH ACTION SHOULD BE ADDED TO, SO WE FORCE
* YOU TO CALL APPENDTOGROUP! * YOU TO CALL APPENDTOISystemContextMenuConstants.GROUP!
* *
public void add(IAction action) public void add(IAction action)
{ {
@ -143,7 +142,7 @@ public class SystemMenuManager //implements IMenuManager
/** /**
* Add a separator. * Add a separator.
* HOPEFULLY THIS IS NEVER CALLED. RATHER, BY USING GROUPS AND DECIDING PER GROUP IF THERE * HOPEFULLY THIS IS NEVER CALLED. RATHER, BY USING ISystemContextMenuConstants.GROUPS AND DECIDING PER ISystemContextMenuConstants.GROUP IF THERE
* SHOULD BE SEPARATORS, WE AVOID HARDCODING SEPARATORS LIKE THIS. * SHOULD BE SEPARATORS, WE AVOID HARDCODING SEPARATORS LIKE THIS.
*/ */
public void addSeparator() public void addSeparator()
@ -214,104 +213,104 @@ public class SystemMenuManager //implements IMenuManager
menuCreated = false; menuCreated = false;
if (groupName!=null) if (groupName!=null)
{ {
if (groupName.equals(GROUP_NEW)) if (groupName.equals(ISystemContextMenuConstants.GROUP_NEW))
{ {
if (newSubMenu == null) if (newSubMenu == null)
{ {
newSubMenu = (new SystemCascadingNewAction()).getSubMenu(); newSubMenu = (new SystemCascadingNewAction()).getSubMenu();
mgr.appendToGroup(GROUP_NEW, newSubMenu); mgr.appendToGroup(ISystemContextMenuConstants.GROUP_NEW, newSubMenu);
menuCreated = true; menuCreated = true;
} }
subMenu = newSubMenu; subMenu = newSubMenu;
} }
/* /*
else if (groupName.equals(GROUP_GOTO)) else if (groupName.equals(ISystemContextMenuConstants.GROUP_GOTO))
{ {
if (gotoSubMenu == null) if (gotoSubMenu == null)
{ {
gotoSubMenu = (new SystemCascadingGoToAction()).getSubMenu(); gotoSubMenu = (new SystemCascadingGoToAction()).getSubMenu();
mgr.appendToGroup(GROUP_GOTO, gotoSubMenu); mgr.appendToGroup(ISystemContextMenuConstants.GROUP_GOTO, gotoSubMenu);
menuCreated = true; menuCreated = true;
} }
subMenu = gotoSubMenu; subMenu = gotoSubMenu;
} }
*/ */
else if (groupName.equals(GROUP_EXPANDTO)) else if (groupName.equals(ISystemContextMenuConstants.GROUP_EXPANDTO))
{ {
if (expandtoSubMenu == null) if (expandtoSubMenu == null)
{ {
expandtoSubMenu = (new SystemCascadingExpandToAction()).getSubMenu(); expandtoSubMenu = (new SystemCascadingExpandToAction()).getSubMenu();
mgr.appendToGroup(GROUP_EXPANDTO, expandtoSubMenu); mgr.appendToGroup(ISystemContextMenuConstants.GROUP_EXPANDTO, expandtoSubMenu);
menuCreated = true; menuCreated = true;
} }
subMenu = expandtoSubMenu; subMenu = expandtoSubMenu;
} }
else if (groupName.equals(GROUP_OPENWITH)) else if (groupName.equals(ISystemContextMenuConstants.GROUP_OPENWITH))
{ {
if (openwithSubMenu == null) if (openwithSubMenu == null)
{ {
openwithSubMenu = (new SystemCascadingOpenWithAction()).getSubMenu(); openwithSubMenu = (new SystemCascadingOpenWithAction()).getSubMenu();
mgr.appendToGroup(GROUP_OPENWITH, openwithSubMenu); mgr.appendToGroup(ISystemContextMenuConstants.GROUP_OPENWITH, openwithSubMenu);
menuCreated = true; menuCreated = true;
} }
subMenu = openwithSubMenu; subMenu = openwithSubMenu;
} }
else if (groupName.equals(GROUP_BROWSEWITH)) else if (groupName.equals(ISystemContextMenuConstants.GROUP_BROWSEWITH))
{ {
if (browsewithSubMenu == null) if (browsewithSubMenu == null)
{ {
browsewithSubMenu = (new SystemCascadingBrowseWithAction()).getSubMenu(); browsewithSubMenu = (new SystemCascadingBrowseWithAction()).getSubMenu();
mgr.appendToGroup(GROUP_BROWSEWITH, browsewithSubMenu); mgr.appendToGroup(ISystemContextMenuConstants.GROUP_BROWSEWITH, browsewithSubMenu);
menuCreated = true; menuCreated = true;
} }
subMenu = browsewithSubMenu; subMenu = browsewithSubMenu;
} }
else if (groupName.equals(GROUP_COMPAREWITH)) else if (groupName.equals(ISystemContextMenuConstants.GROUP_COMPAREWITH))
{ {
if (comparewithSubMenu == null) if (comparewithSubMenu == null)
{ {
comparewithSubMenu = (new SystemCascadingCompareWithAction()).getSubMenu(); comparewithSubMenu = (new SystemCascadingCompareWithAction()).getSubMenu();
mgr.appendToGroup(GROUP_COMPAREWITH, comparewithSubMenu); mgr.appendToGroup(ISystemContextMenuConstants.GROUP_COMPAREWITH, comparewithSubMenu);
menuCreated = true; menuCreated = true;
} }
subMenu = comparewithSubMenu; subMenu = comparewithSubMenu;
} }
else if (groupName.equals(GROUP_REPLACEWITH)) else if (groupName.equals(ISystemContextMenuConstants.GROUP_REPLACEWITH))
{ {
if (replacewithSubMenu == null) if (replacewithSubMenu == null)
{ {
replacewithSubMenu = (new SystemCascadingReplaceWithAction()).getSubMenu(); replacewithSubMenu = (new SystemCascadingReplaceWithAction()).getSubMenu();
mgr.appendToGroup(GROUP_REPLACEWITH, replacewithSubMenu); mgr.appendToGroup(ISystemContextMenuConstants.GROUP_REPLACEWITH, replacewithSubMenu);
menuCreated = true; menuCreated = true;
} }
subMenu = replacewithSubMenu; subMenu = replacewithSubMenu;
} }
else if (groupName.equals(GROUP_WORKWITH)) else if (groupName.equals(ISystemContextMenuConstants.GROUP_WORKWITH))
{ {
if (workwithSubMenu == null) if (workwithSubMenu == null)
{ {
workwithSubMenu = (new SystemCascadingWorkWithAction()).getSubMenu(); workwithSubMenu = (new SystemCascadingWorkWithAction()).getSubMenu();
mgr.appendToGroup(GROUP_WORKWITH, workwithSubMenu); mgr.appendToGroup(ISystemContextMenuConstants.GROUP_WORKWITH, workwithSubMenu);
menuCreated = true; menuCreated = true;
} }
subMenu = workwithSubMenu; subMenu = workwithSubMenu;
} }
else if (groupName.equals(GROUP_VIEWER_SETUP)) else if (groupName.equals(ISystemContextMenuConstants.GROUP_VIEWER_SETUP))
{ {
if (viewSubMenu == null) if (viewSubMenu == null)
{ {
viewSubMenu = (new SystemCascadingViewAction()).getSubMenu(); viewSubMenu = (new SystemCascadingViewAction()).getSubMenu();
mgr.appendToGroup(GROUP_VIEWER_SETUP, viewSubMenu); mgr.appendToGroup(ISystemContextMenuConstants.GROUP_VIEWER_SETUP, viewSubMenu);
menuCreated = true; menuCreated = true;
} }
subMenu = viewSubMenu; subMenu = viewSubMenu;
} }
else if (groupName.equals(GROUP_STARTSERVER)) else if (groupName.equals(ISystemContextMenuConstants.GROUP_STARTSERVER))
{ {
if (serverSubMenu == null) if (serverSubMenu == null)
{ {
serverSubMenu = (new SystemCascadingRemoteServersAction()).getSubMenu(); serverSubMenu = (new SystemCascadingRemoteServersAction()).getSubMenu();
mgr.appendToGroup(GROUP_STARTSERVER, serverSubMenu); mgr.appendToGroup(ISystemContextMenuConstants.GROUP_STARTSERVER, serverSubMenu);
menuCreated = true; menuCreated = true;
} }
subMenu = serverSubMenu; subMenu = serverSubMenu;
@ -327,24 +326,24 @@ public class SystemMenuManager //implements IMenuManager
menuCreated = false; menuCreated = false;
if (menuID!=null) if (menuID!=null)
{ {
if (menuID.equals(MENU_NEW)) if (menuID.equals(ISystemContextMenuConstants.MENU_NEW))
groupName = GROUP_NEW; groupName = ISystemContextMenuConstants.GROUP_NEW;
else if (menuID.equals(MENU_GOTO)) else if (menuID.equals(ISystemContextMenuConstants.MENU_GOTO))
groupName = GROUP_GOTO; groupName = ISystemContextMenuConstants.GROUP_GOTO;
else if (menuID.equals(MENU_EXPANDTO)) else if (menuID.equals(ISystemContextMenuConstants.MENU_EXPANDTO))
groupName = GROUP_EXPANDTO; groupName = ISystemContextMenuConstants.GROUP_EXPANDTO;
else if (menuID.equals(MENU_OPENWITH)) else if (menuID.equals(ISystemContextMenuConstants.MENU_OPENWITH))
groupName = GROUP_OPENWITH; groupName = ISystemContextMenuConstants.GROUP_OPENWITH;
else if (menuID.equals(MENU_BROWSEWITH)) else if (menuID.equals(ISystemContextMenuConstants.MENU_BROWSEWITH))
groupName = GROUP_BROWSEWITH; groupName = ISystemContextMenuConstants.GROUP_BROWSEWITH;
else if (menuID.equals(MENU_COMPAREWITH)) else if (menuID.equals(ISystemContextMenuConstants.MENU_COMPAREWITH))
groupName = GROUP_COMPAREWITH; groupName = ISystemContextMenuConstants.GROUP_COMPAREWITH;
else if (menuID.equals(MENU_REPLACEWITH)) else if (menuID.equals(ISystemContextMenuConstants.MENU_REPLACEWITH))
groupName = GROUP_REPLACEWITH; groupName = ISystemContextMenuConstants.GROUP_REPLACEWITH;
else if (menuID.equals(MENU_WORKWITH)) else if (menuID.equals(ISystemContextMenuConstants.MENU_WORKWITH))
groupName = GROUP_WORKWITH; groupName = ISystemContextMenuConstants.GROUP_WORKWITH;
else if (menuID.equals(MENU_STARTSERVER)) else if (menuID.equals(ISystemContextMenuConstants.MENU_STARTSERVER))
groupName = GROUP_STARTSERVER; groupName = ISystemContextMenuConstants.GROUP_STARTSERVER;
if (groupName != null) if (groupName != null)
subMenu = getSpecialSubMenu(groupName); subMenu = getSpecialSubMenu(groupName);