< prev index next >

src/com/sun/javatest/tool/HelpMenu.java

Print this page
rev 145 : 7902237: Fixing raw use of parameterized class
Reviewed-by: jjg


 101         }
 102         else {
 103             for (int i = 0; i < tools.length; i++) {
 104                 TestSuite[] tss = tools[i].getLoadedTestSuites();
 105                 if (tss != null) {
 106                     loadedTestSuites.addAll(Arrays.asList(tss));
 107                 }
 108             }
 109         }
 110 
 111 
 112         // locate insert point after last separator
 113         int insertPoint = getItemCount() - 1;
 114         while (insertPoint > 0 && (getItem(insertPoint - 1) != null)) {
 115             insertPoint--;
 116         }
 117 
 118         // for the active test suites, add any available help sets to the menu
 119         // e.g. those specified in the testsuite.jtt
 120         int count = 0;
 121         for (Iterator iter = loadedTestSuites.iterator(); iter.hasNext(); ) {
 122             TestSuite ts = (TestSuite) (iter.next());
 123             JMenuItem[] menuItems = getMenuItems(ts, count);
 124             if (menuItems != null && menuItems.length > 0) {
 125                 for (int i = 0; i < menuItems.length; i++) {
 126                     JMenuItem mi = menuItems[i];
 127                     // mark the entry as a dynamic entry
 128                     mi.putClientProperty(getClass(), this);
 129                     insert(mi, insertPoint++);
 130                 }
 131 
 132                 Separator sep = new Separator();
 133                 sep.putClientProperty(getClass(), this);
 134                 JPopupMenu p = getPopupMenu();
 135                 p.insert(sep, insertPoint++);
 136                 count += menuItems.length + 1;
 137             }
 138         }
 139 
 140         // add custom menus (as GUI components)
 141         // e.g. those that come from exec tool
 142         // this is suboptimal/wrong if the test suite uses both




 101         }
 102         else {
 103             for (int i = 0; i < tools.length; i++) {
 104                 TestSuite[] tss = tools[i].getLoadedTestSuites();
 105                 if (tss != null) {
 106                     loadedTestSuites.addAll(Arrays.asList(tss));
 107                 }
 108             }
 109         }
 110 
 111 
 112         // locate insert point after last separator
 113         int insertPoint = getItemCount() - 1;
 114         while (insertPoint > 0 && (getItem(insertPoint - 1) != null)) {
 115             insertPoint--;
 116         }
 117 
 118         // for the active test suites, add any available help sets to the menu
 119         // e.g. those specified in the testsuite.jtt
 120         int count = 0;
 121         for (Iterator<TestSuite> iter = loadedTestSuites.iterator(); iter.hasNext(); ) {
 122             TestSuite ts = (iter.next());
 123             JMenuItem[] menuItems = getMenuItems(ts, count);
 124             if (menuItems != null && menuItems.length > 0) {
 125                 for (int i = 0; i < menuItems.length; i++) {
 126                     JMenuItem mi = menuItems[i];
 127                     // mark the entry as a dynamic entry
 128                     mi.putClientProperty(getClass(), this);
 129                     insert(mi, insertPoint++);
 130                 }
 131 
 132                 Separator sep = new Separator();
 133                 sep.putClientProperty(getClass(), this);
 134                 JPopupMenu p = getPopupMenu();
 135                 p.insert(sep, insertPoint++);
 136                 count += menuItems.length + 1;
 137             }
 138         }
 139 
 140         // add custom menus (as GUI components)
 141         // e.g. those that come from exec tool
 142         // this is suboptimal/wrong if the test suite uses both


< prev index next >