Examples of JMenu


Examples of javax.swing.JMenu

    if (menus != null && menus.length > 0)
    {
      final JMenuBar menuBar = new JMenuBar();
      for (int i = 0; i < menus.length; i++)
      {
        final JMenu menu = menus[i];
        menuBar.add(menu);
      }
      setJMenuBar(menuBar);
    }
    else
View Full Code Here

Examples of javax.swing.JMenu

        if (menus != null && menus.length > 0)
        {
          final JMenuBar menuBar = new JMenuBar();
          for (int i = 0; i < menus.length; i++)
          {
            final JMenu menu = menus[i];
            menuBar.add(menu);
          }
          setJMenuBar(menuBar);
        }
        else
View Full Code Here

Examples of javax.swing.JMenu

    if (menus != null && menus.length > 0)
    {
      final JMenuBar menuBar = new JMenuBar();
      for (int i = 0; i < menus.length; i++)
      {
        final JMenu menu = menus[i];
        menuBar.add(menu);
      }
      setJMenuBar(menuBar);
    }
    else
View Full Code Here

Examples of javax.swing.JMenu

    if (menus != null && menus.length > 0)
    {
      final JMenuBar menuBar = new JMenuBar();
      for (int i = 0; i < menus.length; i++)
      {
        final JMenu menu = menus[i];
        menuBar.add(menu);
      }
      setJMenuBar(menuBar);
    }
    else
View Full Code Here

Examples of javax.swing.JMenu

        if (menus != null && menus.length > 0)
        {
          final JMenuBar menuBar = new JMenuBar();
          for (int i = 0; i < menus.length; i++)
          {
            final JMenu menu = menus[i];
            menuBar.add(menu);
          }
          setJMenuBar(menuBar);
        }
        else
View Full Code Here

Examples of javax.swing.JMenu

  {
  }

  public static JMenu createMenu(final ActionCategory cat)
  {
    final JMenu menu = new JMenu();
    menu.setText(cat.getDisplayName());
    final Integer mnemonicKey = cat.getMnemonicKey();
    if (mnemonicKey != null)
    {
      menu.setMnemonic(mnemonicKey.intValue());
    }
    final String toolTip = cat.getShortDescription();
    if (toolTip != null && toolTip.length() > 0)
    {
      menu.setToolTipText(toolTip);
    }
    return menu;
  }
View Full Code Here

Examples of javax.swing.JMenu

        }

        insertedUserDefinedActions = true;
      }

      final JMenu menu = PreviewPaneUtilities.createMenu(cat);
      zoomActions.put(cat, PreviewPaneUtilities.buildMenu(menu, plugins, this));
      menus.put(cat, menu);
    }

    final ActionCategory[] categories = (ActionCategory[])
        collectedCategories.toArray(new ActionCategory[collectedCategories.size()]);
    final CategoryTreeItem[] categoryTreeItems =
        PreviewPaneUtilities.buildMenuTree(categories);

    final ArrayList menuList = new ArrayList();
    for (int i = 0; i < categoryTreeItems.length; i++)
    {
      final CategoryTreeItem item = categoryTreeItems[i];
      final JMenu menu = (JMenu) menus.get(item.getCategory());
      // now connect all menus ..
      final CategoryTreeItem[] childs = item.getChilds();
      Arrays.sort(childs);
      for (int j = 0; j < childs.length; j++)
      {
        final CategoryTreeItem child = childs[j];
        final JMenu childMenu = (JMenu) menus.get(child.getCategory());
        if (childMenu != null)
        {
          menu.add(childMenu);
        }
      }

      if (item.getParent() == null)
      {
        menuList.add(item);
      }
    }

    Collections.sort(menuList);
    final ArrayList retval = new ArrayList();
    for (int i = 0; i < menuList.size(); i++)
    {
      final CategoryTreeItem item = (CategoryTreeItem) menuList.get(i);
      final JMenu menu = (JMenu) menus.get(item.getCategory());
      if (item.getCategory().isUserDefined() || menu.getItemCount() > 0)
      {
        retval.add(menu);
      }
    }
View Full Code Here

Examples of javax.swing.JMenu

    final JPanel contentPane = new JPanel();
    contentPane.setLayout(new BorderLayout());
    contentPane.add(new JScrollPane(expressionsTable), BorderLayout.CENTER);
    setContentPane(contentPane);

    final JMenu actionsMenu = new JMenu("Actions");
    final SortAction sortAction = new SortAction();
    actionsMenu.add(sortAction);
    actionsMenu.add(new EditExpressionAction());
    actionsMenu.add(new ShowPropertiesAction());
    actionsMenu.add(new ShowModifiedAction());
    actionsMenu.addSeparator();
    actionsMenu.add(exitAction);

    final JMenuBar menuBar = new JMenuBar();
    menuBar.add(actionsMenu);
    setJMenuBar(menuBar);
View Full Code Here

Examples of javax.swing.JMenu

    menuInfo.setSupportsAnchor(false);
  };

  public Menu(Widget parent, String name) throws GUIException {
    super(parent, name);
    menu = new JMenu();
  }
View Full Code Here

Examples of javax.swing.JMenu

  protected JMenuBar createMenuBar()
  {
    final JMenuBar menuBar = new JMenuBar();

//Set up the lone menu.
    final JMenu menu = new JMenu("Document");
    menu.setMnemonic(KeyEvent.VK_D);
    menuBar.add(menu);

    menu.add(new ActionMenuItem(new NewFrameAction()));
    menu.add(new ActionMenuItem(getPreviewAction()));
    menu.addSeparator();
    menu.add(new ActionMenuItem(getCloseAction()));

    final JMenu helpmenu = new JMenu("Help");
    helpmenu.setMnemonic(KeyEvent.VK_H);
    helpmenu.add(new ActionMenuItem(getAboutAction()));
    return menuBar;
  }
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.