Package javax.swing

Examples of javax.swing.AbstractAction


    @Override
    public JMenuItem getMenuPresenter() {
        JMenu menu = new JMenu(NbBundle.getMessage(LanguageAction.class, "CTL_LanguageAction"));
        for (final Language lang : Language.values()) {
            JMenuItem menuItem = new JMenuItem(new AbstractAction(lang.getName()) {

                public void actionPerformed(ActionEvent e) {
                    String msg = NbBundle.getMessage(LanguageAction.class, "ChangeLang.Confirm.message" + (Utilities.isMac() || Utilities.isUnix() ? ".mac" : ""));
                    String title = NbBundle.getMessage(LanguageAction.class, "ChangeLang.Confirm.title");
                    DialogDescriptor.Confirmation dd = new DialogDescriptor.Confirmation(msg, title, DialogDescriptor.YES_NO_OPTION);
View Full Code Here


            public void actionPerformed(ActionEvent e) {
                updatePageSize();
            }
        });
        unitLink.setAction(new AbstractAction() {

            public void actionPerformed(ActionEvent e) {
                millimeter = !millimeter;
                refreshUnit(true);
            }
View Full Code Here

        doAddGPSHandler();

        // If we use m_table the shortcut will appear in the tooltips !?!
        m_imgScrollPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_F4, 0), "slideshow_startstop");
        m_imgScrollPane.getActionMap().put("slideshow_startstop", new AbstractAction()
        {
            public void actionPerformed(ActionEvent event)
            {
                doStartStopSlideShow();
            }
        });

        m_imgScrollPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0), "slideshow_pause");
        m_imgScrollPane.getActionMap().put("slideshow_pause", new AbstractAction()
        {
            public void actionPerformed(ActionEvent event)
            {
                doSlideShowPause();
            }
        });

        // If we use m_table the shortcut will appear in the tooltips !?!
        m_imgScrollPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), "del");
        m_imgScrollPane.getActionMap().put("del", new AbstractAction()
        {
            public void actionPerformed(ActionEvent event)
            {
                doDel(-1);
            }
        })
        m_imgScrollPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_R, InputEvent.CTRL_DOWN_MASK), "ctrl_r");
        m_imgScrollPane.getActionMap().put("ctrl_r", new AbstractAction()
        {
            public void actionPerformed(ActionEvent event)
            {
                doRename();
            }
        })

        m_imgScrollPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_P, InputEvent.CTRL_DOWN_MASK), "ctrl_p");
        m_imgScrollPane.getActionMap().put("ctrl_p", new AbstractAction()
        {
            public void actionPerformed(ActionEvent event)
            {
                doCopy(-1, false);
            }
        })

        m_imgScrollPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_M, InputEvent.CTRL_DOWN_MASK), "ctrl_m");
        m_imgScrollPane.getActionMap().put("ctrl_m", new AbstractAction()
        {
            public void actionPerformed(ActionEvent event)
            {
                doMove();
            }
        })
        m_imgScrollPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "down");
        m_imgScrollPane.getActionMap().put("down", new AbstractAction()
        {
            public void actionPerformed(ActionEvent event)
            {
                int index;
                if ((index = m_table.getSelectedRow()) >= 0 && m_table.getRowCount() < index+1)
View Full Code Here

      headerButton.setSize(new java.awt.Dimension(10,10));
    } else {
      headerButton = new JButton();
    }

    headerButton.addActionListener(new AbstractAction() {
        public void actionPerformed(ActionEvent e) {
          javax.swing.table.DefaultTableModel model = (javax.swing.table.DefaultTableModel) customHeaderTable.getModel();
          model.addRow(new Vector());
        }
      });
View Full Code Here

        loadSamples();
        loadPrefs();
    }

    private void initAction() {
        openAction = new AbstractAction("", ImageUtilities.loadImageIcon("org/gephi/desktop/welcome/resources/gephifile20.png", false)) {

            public void actionPerformed(ActionEvent e) {
                JXHyperlink link = (JXHyperlink) e.getSource();
                File file = (File) link.getClientProperty(LINK_PATH);
                FileObject fileObject = FileUtil.toFileObject(file);
View Full Code Here

                String s = samplePath[i];
                String tooltip = sampleTooltip[i];
                final InputStream stream = WelcomeTopComponent.class.getResourceAsStream(s);
                String fileName = s.substring(s.lastIndexOf('/') + 1, s.length());
                final String importer = fileName.substring(fileName.lastIndexOf('.'), fileName.length());
                JXHyperlink fileLink = new JXHyperlink(new AbstractAction() {

                    public void actionPerformed(ActionEvent e) {
                        try {
                            stream.reset();
                        } catch (IOException ex) {
View Full Code Here

        MostRecentFiles mru = Lookup.getDefault().lookup(MostRecentFiles.class);
        for (String filePath : mru.getMRUFileList()) {
            final File file = new File(filePath);
            if (file.exists()) {
                final String fileName = file.getName();
                JMenuItem menuItem = new JMenuItem(new AbstractAction(fileName) {

                    @Override
                    public void actionPerformed(ActionEvent e) {
                        FileObject fileObject = FileUtil.toFileObject(file);
                        if (fileObject.hasExt(GEPHI_EXTENSION)) {
View Full Code Here

        public void setVirtualBallEnabled(boolean virtualBallEnabled) {
            this.virtualBallEnabled = virtualBallEnabled;
        }

        public Action[] actions() {
            return new Action[] { new AbstractAction("Delete") {
                public void actionPerformed(ActionEvent e) {
                    getBeanContext().remove(VirtualSettings.this);
                }
            }};
        }
View Full Code Here

        @Override public ObjectSettings[] toArray() {
            return (ObjectSettings[])toArray(new ObjectSettings[size()]);
        }

        public Action[] actions() {
            return new Action[] { new AbstractAction("New ObjectSettings") {
                public void actionPerformed(ActionEvent e) {
                    ObjectSettings os = new ObjectSettings();
                    os.setName("ObjectSettings " + size());
                    add(os);
                }
View Full Code Here

            return (VirtualSettings[])toArray(new VirtualSettings[size()]);
        }

        public Action[] actions() {
            return new Action[] {
                new AbstractAction("New VirtualSettings") {
                    public void actionPerformed(ActionEvent e) {
                        VirtualSettings vs = new VirtualSettings();
                        vs.setName("VirtualSettings " + size());
                        add(vs);
                    }
                },
                new AbstractAction("Delete") {
                    public void actionPerformed(ActionEvent e) {
                        getBeanContext().remove(ObjectSettings.this);
                    }
                }
            };
View Full Code Here

TOP

Related Classes of javax.swing.AbstractAction

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.