Revision: 271 http://svn.sourceforge.net/cishell/?rev=271&view=rev Author: bh2 Date: 2006-10-11 13:54:35 -0700 (Wed, 11 Oct 2006) Log Message: ----------- Updated the workspace plugin to make sure the top level menus show up in the order we would like to see File, Preprocessing, Modeling, Analysis, Visualization, Converters, Toolkits, Tools, Help Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.workspace/src/org/cishell/reference/gui/workspace/ApplicationActionBarAdvisor.java Modified: trunk/clients/gui/org.cishell.reference.gui.workspace/src/org/cishell/reference/gui/workspace/ApplicationActionBarAdvisor.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.workspace/src/org/cishell/reference/gui/workspace/ApplicationActionBarAdvisor.java 2006-10-11 20:46:08 UTC (rev 270) +++ trunk/clients/gui/org.cishell.reference.gui.workspace/src/org/cishell/reference/gui/workspace/ApplicationActionBarAdvisor.java 2006-10-11 20:54:35 UTC (rev 271) @@ -49,8 +49,18 @@ IWorkbenchActionConstants.M_FILE); MenuManager helpMenu = createMenu("&Help", IWorkbenchActionConstants.M_HELP); + + menuBar.add(fileMenu); - menuBar.add(fileMenu); + //Pre-adding menus so they show up in this order... + createAndAddMenu(menuBar, "Preprocessing", "preprocessing"); + createAndAddMenu(menuBar, "Modeling", "modeling"); + createAndAddMenu(menuBar, "Analysis", "analysis"); + createAndAddMenu(menuBar, "Visualization", "visualization"); + createAndAddMenu(menuBar, "Converters", "converters"); + createAndAddMenu(menuBar, "Toolkits", "toolkits"); + createAndAddMenu(menuBar, "Tools", "tools"); + menuBar.add(new GroupMarker("start")); menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); menuBar.add(new GroupMarker("end")); @@ -64,6 +74,11 @@ helpMenu.add(aboutAction); } + private void createAndAddMenu(IMenuManager menuBar, String text, String id) { + MenuManager menu = createMenu(text, id); + menuBar.add(menu); + } + private MenuManager createMenu(String text, String id) { MenuManager menu = new MenuManager(text, id); menu.add(new GroupMarker("start")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 383 http://svn.sourceforge.net/cishell/?rev=383&view=rev Author: huangb Date: 2007-04-25 21:47:41 -0700 (Wed, 25 Apr 2007) Log Message: ----------- remove code that initializes the top level menus Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.workspace/src/org/cishell/reference/gui/workspace/ApplicationActionBarAdvisor.java Modified: trunk/clients/gui/org.cishell.reference.gui.workspace/src/org/cishell/reference/gui/workspace/ApplicationActionBarAdvisor.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.workspace/src/org/cishell/reference/gui/workspace/ApplicationActionBarAdvisor.java 2007-04-04 22:54:11 UTC (rev 382) +++ trunk/clients/gui/org.cishell.reference.gui.workspace/src/org/cishell/reference/gui/workspace/ApplicationActionBarAdvisor.java 2007-04-26 04:47:41 UTC (rev 383) @@ -1,10 +1,7 @@ package org.cishell.reference.gui.workspace; -import org.eclipse.jface.action.GroupMarker; + import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.ui.IWorkbenchActionConstants; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.actions.ActionFactory; import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction; @@ -22,7 +19,7 @@ // them in the fill methods. This ensures that the actions aren't recreated // when fillActionBars is called with FILL_PROXY. private IWorkbenchAction exitAction; - private IWorkbenchAction aboutAction; + private IWorkbenchAction aboutAction; public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) { super(configurer); @@ -39,52 +36,12 @@ register(exitAction); aboutAction = ActionFactory.ABOUT.create(window); - register(aboutAction); + register(aboutAction); } protected void fillMenuBar(IMenuManager menuBar) { CIShellApplication.setMenuManager(menuBar); - - MenuManager fileMenu = createMenu("&File", - IWorkbenchActionConstants.M_FILE); - MenuManager helpMenu = createMenu("&Help", - IWorkbenchActionConstants.M_HELP); - menuBar.add(fileMenu); - - //Pre-adding menus so they show up in this order... - createAndAddMenu(menuBar, "Preprocessing", "preprocessing"); - createAndAddMenu(menuBar, "Modeling", "modeling"); - createAndAddMenu(menuBar, "Analysis", "analysis"); - createAndAddMenu(menuBar, "Visualization", "visualization"); - createAndAddMenu(menuBar, "Converters", "converters"); - createAndAddMenu(menuBar, "Toolkits", "toolkits"); - createAndAddMenu(menuBar, "Tools", "tools"); - - menuBar.add(new GroupMarker("start")); - menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); - menuBar.add(new GroupMarker("end")); - menuBar.add(helpMenu); - - //File menu items - fileMenu.add(exitAction); - - //Help menu items - helpMenu.add(new Separator()); - helpMenu.add(aboutAction); } - private void createAndAddMenu(IMenuManager menuBar, String text, String id) { - MenuManager menu = createMenu(text, id); - menuBar.add(menu); - } - - private MenuManager createMenu(String text, String id) { - MenuManager menu = new MenuManager(text, id); - menu.add(new GroupMarker("start")); - menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); - menu.add(new GroupMarker("end")); - - return menu; - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tea...@us...> - 2007-05-14 13:18:43
|
Revision: 397 http://svn.sourceforge.net/cishell/?rev=397&view=rev Author: teakettle22 Date: 2007-05-14 06:18:33 -0700 (Mon, 14 May 2007) Log Message: ----------- The modified code for menu construction. Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.workspace/src/org/cishell/reference/gui/workspace/ApplicationActionBarAdvisor.java Modified: trunk/clients/gui/org.cishell.reference.gui.workspace/src/org/cishell/reference/gui/workspace/ApplicationActionBarAdvisor.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.workspace/src/org/cishell/reference/gui/workspace/ApplicationActionBarAdvisor.java 2007-05-10 20:23:36 UTC (rev 396) +++ trunk/clients/gui/org.cishell.reference.gui.workspace/src/org/cishell/reference/gui/workspace/ApplicationActionBarAdvisor.java 2007-05-14 13:18:33 UTC (rev 397) @@ -1,7 +1,11 @@ package org.cishell.reference.gui.workspace; +import org.eclipse.jface.action.GroupMarker; import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.action.Separator; +import org.eclipse.ui.IWorkbenchActionConstants; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.actions.ActionFactory; import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction; @@ -13,7 +17,7 @@ * the actions added to a workbench window. Each window will be populated with * new actions. */ -public class ApplicationActionBarAdvisor extends ActionBarAdvisor { +public class ApplicationActionBarAdvisor extends ActionBarAdvisor{ // Actions - important to allocate these only in makeActions, and then use // them in the fill methods. This ensures that the actions aren't recreated @@ -41,7 +45,42 @@ protected void fillMenuBar(IMenuManager menuBar) { CIShellApplication.setMenuManager(menuBar); - + /* + * If we don't create the File and the Help menus at initialization, they don't show up correctly. I create the file and the help + * menus and add them. Later the default_menu.xml file is parse and the additional menus are added in between + * the File and the Help menus. + * + * The File menu is created normally, as we modify it again in the MenuAdapter code. The Help menu is created as having + * three divisions, start, additions, and end. The File menu later adds these divisions so that additional packages will be added + * between the Test submenu and the Exit item. The Help menu adds additional packages before the configuration and update items. + * + * Modified by: Tim Kelley + * Date: May, 8-9, 2007 + * Additional Code found in: org.cishell.reference.gui.menumanager.MenuAdapter.java + */ + + + + MenuManager fileMenu = new MenuManager("&File", IWorkbenchActionConstants.M_FILE); //Create File menu as a normal Menu + menuBar.add(fileMenu); //add it to the MenuBar + MenuManager helpMenu = createMenu("&Help", IWorkbenchActionConstants.M_HELP); //Create the Help Menu with start, end, and additions as divisions + helpMenu.add(new Separator()); //Add a separator and then add the "About" MenuItem. + helpMenu.appendToGroup("end",aboutAction); + menuBar.add(new GroupMarker("start")); //Add divisions to the MenuBar so we can add + //additional menus to the MenuBar between File and Help menus //the File and Help menus. + menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); + menuBar.add(new GroupMarker("end")); + + menuBar.add(helpMenu); //Add the Help menu after the divisions. } + + private MenuManager createMenu(String text, String id) { + MenuManager menu = new MenuManager(text, id); + menu.add(new GroupMarker("start")); + menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); + menu.add(new GroupMarker("end")); + //System.out.println(IWorkbenchActionConstants.MB_ADDITIONS); + return menu; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |