Revision: 15208
          http://gate.svn.sourceforge.net/gate/?rev=15208&view=rev
Author:   markagreenwood
Date:     2012-01-24 17:22:54 +0000 (Tue, 24 Jan 2012)
Log Message:
-----------
fixed the generation of the tools menu, as it was always getting it wrong as 
the separator was always removed no matter what tools were loaded

Modified Paths:
--------------
    gate/trunk/src/gate/gui/MainFrame.java

Modified: gate/trunk/src/gate/gui/MainFrame.java
===================================================================
--- gate/trunk/src/gate/gui/MainFrame.java      2012-01-24 15:35:30 UTC (rev 
15207)
+++ gate/trunk/src/gate/gui/MainFrame.java      2012-01-24 17:22:54 UTC (rev 
15208)
@@ -1061,14 +1061,7 @@
       new JCheckBoxMenuItem(new VerboseModeCorpusEvalToolAction());
     corpusEvalMenu.add(verboseModeItem);
 
-    // add separator.  plugin menu items will appear after this separator
-    toolsMenu.addSeparator();
-    toolsMenu.staticItemsAdded();
-    if (toolsMenu.getMenuComponent(toolsMenu.getMenuComponentCount()-1)
-        instanceof JSeparator) { // remove separator if no tools
-      toolsMenu.remove(toolsMenu.getMenuComponentCount()-1);
-    }
-
+    toolsMenu.staticItemsAdded();    
     menuBar.add(toolsMenu);
 
     JMenu helpMenu = new XJMenu("Help", null, MainFrame.this);
@@ -4322,7 +4315,7 @@
           }
           // if we get to here, we didn't find a menu to use - add one
           XJMenu newMenu = new XJMenu(pathElement, pathElement, this.listener);
-          menuToUse.add(newMenu);
+          menuToUse.insert(newMenu,Math.max(i-1, firstIndex));
           firstIndex = 0;
           menuToUse = newMenu;
         }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to