Package javax.swing

Examples of javax.swing.JMenuItem$MenuItemFocusListener


      return button;
   }

   public static JMenuItem createMenuItem( Class resourceClass, String name, String imageResourceName, Action action )
    {
       JMenuItem item = new JMenuItem( action );
       item.setText( name );

       if( imageResourceName != null )
       {
          ImageIcon icon = getImageIcon( resourceClass, imageResourceName );
          item.setIcon( icon );
       }

       return item;
    }
View Full Code Here


    }
  };

  public MenuItem(Widget parent, String name) throws GUIException {
    super(parent, name);
    menuItem = new JMenuItem();
  }
View Full Code Here

        for (int i = 0; i < actionsArray.length; i++) {
            Action a = actionsArray[i];
            actions.put(a.getValue(Action.NAME), a);
        }

        JMenuItem menuUndo = ComponentFactory.getMenuItem(fld.getUndoListener().getUndoAction());
        JMenuItem menuRedo = ComponentFactory.getMenuItem(fld.getUndoListener().getRedoAction());
        JMenuItem menuCut = ComponentFactory.getMenuItem(IconLibrary._icoCut, DcResources.getText("lblCut"));
        JMenuItem menuCopy = ComponentFactory.getMenuItem(IconLibrary._icoCopy, DcResources.getText("lblCopy"));
        JMenuItem menuPaste = ComponentFactory.getMenuItem(IconLibrary._icoPaste, DcResources.getText("lblPaste"));
        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));
        menuPaste.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, InputEvent.CTRL_MASK));
        menuSelectAll.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, InputEvent.CTRL_MASK));
       
        add(menuCut);
        add(menuCopy);
        add(menuPaste);
        addSeparator();
View Full Code Here

public class FileRenamerMenu extends DcMenu {
   
    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

       
    private void build(DcPictureField pf) {
        JMenu menuFile = ComponentFactory.getMenu(DcResources.getText("lblFile"));
        JMenu menuEdit = ComponentFactory.getMenu(DcResources.getText("lblEdit"));

        JMenuItem miSaveAs = ComponentFactory.getMenuItem(DcResources.getText("lblSaveAs"));
        JMenuItem miOpenFromFile = ComponentFactory.getMenuItem(DcResources.getText("lblOpenFromFile"));
        JMenuItem miOpenFromURL = ComponentFactory.getMenuItem(DcResources.getText("lblOpenFromURL"));
        JMenuItem miOpenFromClipboard = ComponentFactory.getMenuItem(DcResources.getText("lblOpenFromClipboard"));
       
        JMenuItem miRotateRight = ComponentFactory.getMenuItem(IconLibrary._icoRotateRight, DcResources.getText("lblRotateRight"));
        JMenuItem miRotateLeft = ComponentFactory.getMenuItem(IconLibrary._icoRotateLeft, DcResources.getText("lblRotateLeft"));
       
        JMenuItem miGrayscale = ComponentFactory.getMenuItem(IconLibrary._icoGrayscale, DcResources.getText("lblGrayscale"));
        JMenuItem miSharpen = ComponentFactory.getMenuItem(DcResources.getText("lblSharpen"));
        JMenuItem miBlur = ComponentFactory.getMenuItem(DcResources.getText("lblBlur"));
       
        JMenuItem miDelete = ComponentFactory.getMenuItem(DcResources.getText("lblDelete"));
       
        miRotateRight.setActionCommand("rotate_right");
        miRotateRight.addActionListener(pf);

        miRotateLeft.setActionCommand("rotate_left");
        miRotateLeft.addActionListener(pf);

        miGrayscale.setActionCommand("grayscale");
        miGrayscale.addActionListener(pf);

        miSharpen.setActionCommand("sharpen");
        miSharpen.addActionListener(pf);
       
        miBlur.setActionCommand("blur");
        miBlur.addActionListener(pf);

        miOpenFromFile.setActionCommand("open_from_file");
        miOpenFromFile.addActionListener(pf);

        miOpenFromURL.setActionCommand("open_from_url");
        miOpenFromURL.addActionListener(pf);

        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

    }
   
    private JMenu createMenu() {
        JMenu menu = ComponentFactory.getMenu("Edit");
       
        JMenuItem menuSelectAll = ComponentFactory.getMenuItem(DcResources.getText("lblSelectAll"));
        JMenuItem menuUnselectAll = ComponentFactory.getMenuItem(DcResources.getText("lblUnselectAll"));
        JMenuItem menuInvertSelection = ComponentFactory.getMenuItem(DcResources.getText("lblInvertSelection"));

        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));
       
        menu.add(menuSelectAll);
        menu.add(menuUnselectAll);
        menu.addSeparator();
        menu.add(menuInvertSelection);
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);
                miMove.setActionCommand("moveFile");
                miMove.setEnabled(file.exists());

                JMenuItem miLocateHP = ComponentFactory.getMenuItem(IconLibrary._icoDriveScanner, DcResources.getText("lblLocateFile", DcResources.getText("lblMatchOnHashAndSize")));
                miLocateHP.addActionListener(this);
                miLocateHP.setActionCommand("locateFileHP");
                miLocateHP.setEnabled(!file.exists() && dco.isFilled(DcObject._SYS_FILEHASH) && dco.isFilled(DcObject._SYS_FILESIZE));
               
                JMenuItem miLocateMP = ComponentFactory.getMenuItem(IconLibrary._icoDriveScanner, DcResources.getText("lblLocateFile", DcResources.getText("lblMatchOnFilenameAndSize")));
                miLocateMP.addActionListener(this);
                miLocateMP.setActionCommand("locateFileMP");
                miLocateMP.setEnabled(!file.exists() && dco.isFilled(DcObject._SYS_FILESIZE));           

                JMenuItem miLocateLP = ComponentFactory.getMenuItem(IconLibrary._icoDriveScanner, DcResources.getText("lblLocateFile", DcResources.getText("lblMatchOnFilename")));
                miLocateLP.addActionListener(this);
                miLocateLP.setActionCommand("locateFileLP");
                miLocateLP.setEnabled(!file.exists());       
               
                menuFile.add(miDelete);
                menuFile.add(miMove);
                menuFile.add(miLocateHP);
                menuFile.add(miLocateMP);
                menuFile.add(miLocateLP);
               
                addSeparator();
                add(menuFile);
            }           
           
        } else {
            PluginHelper.add(this, "RemoveRow", DcModules.getCurrent().getIndex());
            PluginHelper.add(this, "AddRow", DcModules.getCurrent().getIndex());
        }  
       
        if (viewType == View._TYPE_SEARCH &&
            module.getIndex() == DcModules._USER &&
            SecurityCentre.getInstance().getUser().isAuthorized("SetPassword")) {

            addSeparator();
            PluginHelper.add(this, "SetPassword", "", dco, null, viewType, DcModules.getCurrent().getIndex());
        }

        if (!DcModules.getCurrent().isAbstract()) {
            addSeparator();
            PluginHelper.add(this, "ItemExporterWizard", "", dco, null, viewIdx, dco.getModule().getIndex());
        }
       
        if (viewType == View._TYPE_SEARCH && DcModules.getCurrent().hasReports()) {
            PluginHelper.add(this, "Report", "", dco, null, viewIdx, DcModules.getCurrent().getIndex());
        }
       
        addSeparator();
        PluginHelper.add(this, "Sort");
       
        if viewType == View._TYPE_SEARCH &&
            module.canBeLend() &&
            SecurityCentre.getInstance().getUser().isAuthorized("Loan")) {
         
            addSeparator();
            PluginHelper.add(this, "Loan");
        }

        addSeparator();

        JMenu menuAdmin = ComponentFactory.getMenu(IconLibrary._icoModuleTypeProperty16, DcResources.getText("lblAdministration"));
       
        Collection<DcPropertyModule> modules = new ArrayList<DcPropertyModule>();
        for (DcFieldDefinition definition : module.getFieldDefinitions().getDefinitions()) {
            DcField field = module.getField(definition.getIndex());
            DcPropertyModule pm = DcModules.getPropertyModule(field);
           
            if (pm != null && !modules.contains(pm))
                modules.add(pm);
        }

        for (DcModule pm : modules) {
            try {
                Plugin plugin = Plugins.getInstance().get("ManageItem", dco, null, viewIdx,  pm.getIndex());
                if (    plugin != null &&SecurityCentre.getInstance().getUser().isAuthorized(plugin) &&
                        UserMode.isCorrectXpLevel(plugin.getXpLevel())) {
                   
                    JMenuItem item = ComponentFactory.getMenuItem(plugin);
                    item.setEnabled(plugin.isEnabled());
                    item.setIcon(plugin.getIcon());
                   
                    menuAdmin.add(item);
                }
            } catch (InvalidPluginException e) {
                logger.error(e, e);
View Full Code Here

    }
   
    public class PopupMenu extends DcPopupMenu implements ActionListener {

        public PopupMenu() {
            JMenuItem menuToggleLabels = new JMenuItem(DcResources.getText("lblToggleMenuLabels"));

            menuToggleLabels.addActionListener(this);
            menuToggleLabels.setActionCommand("toggleLabels");
            this.add(menuToggleLabels);
        }
View Full Code Here

    private DcMinimalisticItemView form;
   
    public DcPropertyViewPopupMenu(DcMinimalisticItemView form) {
        this.form = form;

        JMenuItem menuOpen = new JMenuItem(DcResources.getText("lblOpenItem", ""), IconLibrary._icoOpen);
        JMenuItem menuDelete = new JMenuItem(DcResources.getText("lblDelete"), IconLibrary._icoDelete);
       
        menuOpen.addActionListener(this);
        menuOpen.setActionCommand("open");
       
        menuDelete.addActionListener(this);
        menuDelete.setActionCommand("delete");

        add(menuOpen);
        add(menuDelete);
    }
View Full Code Here

                    Rectangle rect = shape.getBounds();

                    Vector vec = new Vector();
                    vec.add(new JSeparator());

                    JMenuItem done = new JMenuItem("Done");
                    done.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent ae) {
                            deactivate();
                        }
                    });
                    vec.add(done);
View Full Code Here

TOP

Related Classes of javax.swing.JMenuItem$MenuItemFocusListener

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.