Package javax.swing

Examples of javax.swing.JMenuItem.addActionListener()


          final ProgramReceiveTarget target = receiveProxy.getProgramReceiveTargets()[0];
          JMenuItem item = new JMenuItem(target.getTargetName());
          item.setFont(MenuUtil.CONTEXT_MENU_PLAINFONT);
          item.setIcon(internalProxy.getIcon());
          menu.add(item);
          item.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e) {
              Program[] programs = collectProgramsFromNode(node);
              if ((programs != null) &&(programs.length > 0)) {
                receiveProxy.receivePrograms(programs, target);
              }
View Full Code Here


            Icon icon = plugin.getPluginIcon();

            item.setIcon(icon != null ? icon : null);
            menu.add(item);
            item.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                Program[] programs = collectProgramsFromNode(node);
                if ((programs != null) && (programs.length > 0)) {
                  plugin.receivePrograms(programs, ProgramReceiveTarget.createDefaultTargetForProgramReceiveIfId(plugin.getId()));
                }
View Full Code Here

            item.setIcon(icon != null ? icon : null);
            menu.add(item);

            final ProgramReceiveTarget target = targets[0];

            item.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                Program[] programs = collectProgramsFromNode(node);
                if ((programs != null) && (programs.length > 0)) {
                  plugin.receivePrograms(programs, target);
                }
View Full Code Here

              if (o == null || !o.equals(target)) {
                JMenuItem item = new JMenuItem(target.toString());
                item.setFont(MenuUtil.CONTEXT_MENU_PLAINFONT);
                subMenu.add(item);

                item.addActionListener(new ActionListener() {
                  public void actionPerformed(ActionEvent e) {
                    Program[] programs = collectProgramsFromNode(node);
                    if ((programs != null) && (programs.length > 0)) {
                      plugin.receivePrograms(programs, target);
                    }
View Full Code Here

    final KeyStroke accelerator = bundleSupport.getKeyStroke("system-properties-panel.popup-menu.copy.accelerator");

    final JMenuItem copyMenuItem = new JMenuItem(label);
    copyMenuItem.setAccelerator(accelerator);
    copyMenuItem.getAccessibleContext().setAccessibleDescription(label);
    copyMenuItem.addActionListener(new CopyAction());
    this.copyPopupMenu.add(copyMenuItem);

    // add popup Listener to the table
    final PopupListener copyPopupListener = new PopupListener();
    this.table.addMouseListener(copyPopupListener);
View Full Code Here

        JMenuItem menuSelectAll = ComponentFactory.getMenuItem(DcResources.getText("lblSelectAll"));

        menuCut.addActionListener(actions.get(DefaultEditorKit.cutAction));
        menuCopy.addActionListener(actions.get(DefaultEditorKit.copyAction));
        menuPaste.addActionListener(actions.get(DefaultEditorKit.pasteAction));
        menuSelectAll.addActionListener(actions.get(DefaultEditorKit.selectAllAction));
       
        menuUndo.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Z, InputEvent.CTRL_MASK));
        menuRedo.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y, InputEvent.CTRL_MASK));
        menuCut.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_MASK));
        menuCopy.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK));
View Full Code Here

    public FileRenamerMenu(FileRenamerPreviewDialog listener) {
        super(DcResources.getText("lblEdit"));
       
        JMenuItem menuRemove = ComponentFactory.getMenuItem(DcResources.getText("lblRemove"));
        menuRemove.setActionCommand("remove");
        menuRemove.addActionListener(listener);
        add(menuRemove);
    }
}
View Full Code Here

        miOpenFromClipboard.setActionCommand("open_from_clipboard");
        miOpenFromClipboard.addActionListener(pf);
       
        miDelete.setActionCommand("delete");
        miDelete.addActionListener(pf);
       
        miSaveAs.setActionCommand("Save as");
        miSaveAs.addActionListener(pf);
       
        menuFile.add(miOpenFromFile);
View Full Code Here

        menuSelectAll.addActionListener(this);
        menuSelectAll.setActionCommand("selectAll");
        menuUnselectAll.addActionListener(this);
        menuUnselectAll.setActionCommand("unselectAll");
        menuInvertSelection.addActionListener(this);
        menuInvertSelection.setActionCommand("invertSelection");
       
        menuSelectAll.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.CTRL_MASK));
        menuUnselectAll.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_U, InputEvent.CTRL_MASK));
        menuInvertSelection.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I, InputEvent.CTRL_MASK));
View Full Code Here

            if (file != null && SecurityCentre.getInstance().getUser().isAdmin() && dco.getModule().isFileBacked()) {
               
                JMenu menuFile = ComponentFactory.getMenu(IconLibrary._icoDriveManager, DcResources.getText("lblFile"));
               
                JMenuItem miDelete = ComponentFactory.getMenuItem(IconLibrary._icoDelete, DcResources.getText("lblDeleteFile"));
                miDelete.addActionListener(this);
                miDelete.setActionCommand("deleteFile");
                miDelete.setEnabled(file.exists());

                JMenuItem miMove = ComponentFactory.getMenuItem(DcResources.getText("lblMoveFile"));
                miMove.addActionListener(this);
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.