Package java.awt

Examples of java.awt.MenuItem


     * @see com.adito.agent.client.AgentClientGUI#init(com.adito.agent.client.Agent)
     */
    public void init(Agent agent) {
        super.init(agent);

        MenuItem open = new MenuItem(Messages.getString("GUI.menu.openBrowser")); //$NON-NLS-1$
        open.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                openBrowser(null);
            }
        });

        // #ifdef DEBUG
        MenuItem console = new MenuItem(Messages.getString("GUI.menu.debugConsole")); //$NON-NLS-1$
        console.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                getConsole().show();
            }
        });
        // #endif

        MenuItem ports = new MenuItem(Messages.getString("GUI.menu.tunnelMonitor")); //$NON-NLS-1$
        ports.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                getPortMonitor().setVisible(!getPortMonitor().isVisible());
            }
        });

        MenuItem exit = new MenuItem(Messages.getString("GUI.menu.exit")); //$NON-NLS-1$
        exit.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                getAgent().disconnect();
            }
        });

View Full Code Here


    public void addMenuItem(final String parentName, final AgentAction action) {
     
      Menu menu = parentName == null ? file : (Menu) menuLookup.get(parentName);
        if(menu==null)
          return;
        MenuItem item = new MenuItem(action.getAction());
        item.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                action.actionPerformed();
            }
        });
        menu.add(item);
View Full Code Here

  public static PopupMenu setupPopupMenu() {
    String label;
    // this is the popup menu
    PopupMenu menu = new PopupMenu();
    MenuItem menuItem;
   
    if(isIntegrated) return menu;
   
    // YaCy Search
    if (deutsch)
                    label = "YaCy Suche";
                else if (french)
                    label = "YaCy Recherche";
                else
                    label = "YaCy Search";
    menuItem = new MenuItem(label);
    menuItem.addActionListener(new ActionListener() {
      public void actionPerformed(final ActionEvent e) {
        openBrowser("");
      }
    });
    menu.add(menuItem);
   
    // Compare YaCy
    if (deutsch)
                    label = "Vergleichs-Suche";
                else if (french)
                    label = "Comparer YaCy";
                else
                    label = "Compare YaCy";
    menuItem = new MenuItem(label);
    menuItem.addActionListener(new ActionListener() {
      public void actionPerformed(final ActionEvent e) {
        openBrowser("compare_yacy.html");
      }
    });
    menu.add(menuItem);
   
    // Peer Administration
    if (deutsch)
                    label = "Peer Administration";
                else if (french)
                    label = "Peer Administration";
                else
                    label = "Peer Administration";
    menuItem = new MenuItem(label);
    menuItem.addActionListener(new ActionListener() {
      public void actionPerformed(final ActionEvent e) {
        openBrowser("Status.html");
      }
    });
    menu.add(menuItem);
   
    // Separator
    menu.addSeparator();

    // Quit
    if(deutsch)
                    label = "YaCy Beenden";
                else if(french)
                    label = "Arrêt YaCy";
                else
                    label = "Shutdown YaCy";
    menuItem = new MenuItem(label);
    menuItem.addActionListener(new ActionListener() {
      public void actionPerformed(final ActionEvent e) {
        sb.terminate("shutdown from tray");
      }
    });
    menu.add(menuItem);
View Full Code Here

    public String viewName() { return "TextView";}

    // I bet this isn't used anymore.
    public MenuItem getFontMenuItem() {
 
  MenuItem itema = new MenuItem("Gene Font...");
  itema.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent actionEvent)
    {
        FontSelector fontSelector = new FontSelector
      (TextView.this, "Select Fonts for Gene Info");
        fontSelector.showDialog(viewFrame);
View Full Code Here

      }
    });
    menu.add(psItem);
    */
   
    MenuItem bitmapItem = new MenuItem("Export to Image...");
    bitmapItem.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent actionEvent) {
       
        MapContainer initXmap, initYmap;
        if ((getArraySelection().getNSelectedIndexes() != 0) || (getGeneSelection().getNSelectedIndexes() != 0)){
          initXmap = getZoomXmap();
View Full Code Here

        for (int i = 0; i < m.length; i++) {
            if (m[i].equals("-")) {
                f.addSeparator();
            } else {
                MenuItem item = new MenuItem(m[i]);

                item.addActionListener(this);
                f.add(item);
            }
        }
    }
View Full Code Here

            return;
        }

        String   s = ev.getActionCommand();
        MenuItem i = new MenuItem();

        if (s == null) {
            if (ev.getSource() instanceof MenuItem) {
                i = (MenuItem) ev.getSource();
                s = i.getLabel();
            }
        }

        if (s == null) {}
View Full Code Here

        };

        addMenu(bar, "Tools", stools);

        Menu     hMenu = new Menu("Help");
        MenuItem aItem = new MenuItem("About");

        aItem.setShortcut(new MenuShortcut('A'));
        aItem.addActionListener(this);
        hMenu.add(aItem);

        MenuItem hItem = new MenuItem("Help");

        hItem.setShortcut(new MenuShortcut('H'));
        hItem.addActionListener(this);
        hMenu.add(hItem);

        //bar.add(hMenu);
        // Command above disabled only until a help display bug is fixed.
        fMain.setMenuBar(bar);
View Full Code Here

    }

    void addMenuItems(Menu f, String[] m) {

        for (int i = 0; i < m.length; i++) {
            MenuItem item = new MenuItem(m[i].substring(1));
            char     c    = m[i].charAt(0);

            if (c != '-') {
                item.setShortcut(new MenuShortcut(c));
            }

            item.addActionListener(this);
            f.add(item);
        }
    }
View Full Code Here

        String s = ev.getActionCommand();

        if (s == null) {
            if (ev.getSource() instanceof MenuItem) {
                MenuItem i;

                s = ((MenuItem) ev.getSource()).getLabel();
            }
        }
View Full Code Here

TOP

Related Classes of java.awt.MenuItem

Copyright © 2018 www.massapicom. 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.