Package javax.swing

Examples of javax.swing.JMenu.removeAll()


        return result;
    }

    private void rebuildMenus() {
        JMenu browseMenu = browseButton.getMenu();
        browseMenu.removeAll();
        for (String dir : prefDirectories) {
            JMenuItem dirItem = new DeletableMenuItem(dir, browseMenu);
            dirItem.addActionListener(handler);
            browseMenu.add(dirItem);
        }
View Full Code Here


        }
    }

    private void reloadPaths() {
        JMenu menu = getMenu();
        menu.removeAll();
       
        Iterator recentItems = loggingModel.getRecentPaths().iterator();
        while (recentItems.hasNext()) {
            String path = (String) recentItems.next();
            JMenuItem itemToAdd = new JMenuItem(path);
View Full Code Here

    JMenuItem menuItem;
    String    val;
    PropertyKey tKey = PropertyKey.ROOT;
    boolean enableMenu = false;

    addTemplateMenu.removeAll(); // clear the JMenu

//    System.out.println("Update:" + id);
    for (int ii = 0; ii < templates.getNumChildren (tKey); ii++) {
      p = templates.pget (templates.getChildKey (tKey, ii));
                                // ensure tList includes the current ID
View Full Code Here

        final JMenu showStatisticsMenu = _resources.createMenu(MssqlResources.IMenuResourceKeys.SHOW_STATISTICS);
        showStatisticsMenu.addMenuListener(new MenuListener() {
            public void menuSelected(MenuEvent e) {
                final JMenu menu = (JMenu) e.getSource();
                menu.removeAll();
                removeActionsOfType(coll,ShowStatisticsAction.class);
                iterateIndexes(new IndexIterationListener() {
                    public void indexSpotted(final ITableInfo tableInfo, final String indexName) {
                        final ShowStatisticsAction showStatisticsAction = new ShowStatisticsAction(app,_resources,plugin,tableInfo,indexName);
                        showStatisticsAction.setSession(_session);
View Full Code Here

       
        final JMenu indexDefragMenu = _resources.createMenu(MssqlResources.IMenuResourceKeys.INDEXDEFRAG);
        indexDefragMenu.addMenuListener(new MenuListener() {
            public void menuSelected(MenuEvent e) {
                final JMenu menu = (JMenu) e.getSource();
                menu.removeAll();
                removeActionsOfType(coll,IndexDefragAction.class);
                app.getThreadPool().addTask(new IteratorIndexesTask(menu));
            }
            public void menuDeselected(MenuEvent e) { }
            public void menuCanceled(MenuEvent e) { }
View Full Code Here

       
        final JMenu shrinkDBFileMenu = _resources.createMenu(MssqlResources.IMenuResourceKeys.SHRINKDBFILE);
        shrinkDBFileMenu.addMenuListener(new MenuListener() {
            public void menuSelected(MenuEvent e) {
                final JMenu menu = (JMenu) e.getSource();
                menu.removeAll();
                removeActionsOfType(coll,ShrinkDatabaseFileAction.class);
               
                final ObjectTreeNode[] nodes = _treeAPI.getSelectedNodes();
                if (nodes.length != 1)
                    return;
View Full Code Here

  }

  private void updateMoveMenu() {
    int activeDet = Manager.getGame().getActiveDetectiveIndex();
    JMenu detectiveMenu = (JMenu) PanelRepository.get(PanelRepository.MOVE_MENU);
    detectiveMenu.removeAll();
    TreeSet<Move> possibleMoves = board.getDetectives()[activeDet].getPossibleMoves();
    JMenuItem undo = new JMenuItem("Undo move");
    undo.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent arg0) {
        undoMove();
View Full Code Here

    }
  }

  private void cleanMoveMenu() {
    JMenu detectiveMenu = (JMenu) PanelRepository.get(PanelRepository.MOVE_MENU);
    detectiveMenu.removeAll();
    JMenuItem item = null;
    detectiveMenu.add(item = new JMenuItem("no move available"));
    item.setEnabled(false);
  }
View Full Code Here

            public void intervalRemoved(ListDataEvent e) {
            }

            @Override
            public void contentsChanged(ListDataEvent e) {
                menu.removeAll();
                ButtonGroup group = new ButtonGroup();
                for (int i = 0; i < comboBoxModel.getSize(); i++) {
                    final Object o = comboBoxModel.getElementAt(i);
                    JRadioButtonMenuItem item = new JRadioButtonMenuItem(o.toString());
                    group.add(item);
View Full Code Here

        JMenu menu = oldMenu;
        if (menu == null) {
            menu = new JMenu(label);
            parentMenu.add(menu);
        } else if (clearMenu) {
            menu.removeAll();
        }

        if (dir == null) {
            System.out.println("XXX null config file");
            return menu;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.