Examples of AbstractAction


Examples of javax.swing.AbstractAction

                }
            });

        //if the press enter, send the message
        Action sendMessageAction =
            new AbstractAction() {
                public void actionPerformed(ActionEvent e) {
                    sendHandler(null);
                }
            };

        Action shiftEnterAction =
            new AbstractAction() {
                public void actionPerformed(ActionEvent e) {
                    int pos = textEntryArea.getCaretPosition();
                    if (pos < 0) {
                        pos = 0;
                    }

                    textEntryArea.insert("\n", pos);

                    try {
                        textEntryArea.setCaretPosition(pos + 1);
                    } catch (IllegalArgumentException ex) {
                    }
                }
            };

        Action checkCloseAction =
            new AbstractAction() {
                public void actionPerformed(ActionEvent e) {
                    checkCloseHandler();
                }
            };

        Action closeAction =
            new AbstractAction() {
                public void actionPerformed(ActionEvent e) {
                    closeHandler();
                }
            };
View Full Code Here

Examples of javax.swing.AbstractAction

   }


   private void installEscapeClose()
   {
      AbstractAction closeAction = new AbstractAction()
      {
      private static final long serialVersionUID = 1L;

      public void actionPerformed(ActionEvent actionEvent)
         {
View Full Code Here

Examples of javax.swing.AbstractAction

        helpBut.setMargin(new Insets(0, 0, 0, 0));
        tf.setPreferredSize(new Dimension(1,tf.getPreferredSize().height));
       
        tf.setName("tf");
    // add action to reset-button. resets tf and requests focus
    reset.addActionListener(new AbstractAction() {
      public void actionPerformed(ActionEvent event) {
        tf.setText("");
        new FocusRequester(tf);
      }
    });
View Full Code Here

Examples of javax.swing.AbstractAction

  setTransferHandler(th);
        panel.setTransferHandler(th);

        // Add an input/action pair for deleting entries:
        getInputMap().put(KeyStroke.getKeyStroke("DELETE"), "delete");
        getActionMap().put("delete", new AbstractAction() {
            public void actionPerformed(ActionEvent actionEvent) {
                int row = getSelectedRow();
                removeEntries();
                row = Math.min(row, getRowCount()-1);
                if (row >= 0)
                    setRowSelectionInterval(row, row);
            }
        });

        // Add an input/action pair for inserting an entry:
        getInputMap().put(KeyStroke.getKeyStroke("INSERT"), "insert");
        getActionMap().put("insert", new AbstractAction() {

            public void actionPerformed(ActionEvent actionEvent) {
                addEntry();
            }
        });
View Full Code Here

Examples of javax.swing.AbstractAction

        contentPane.setTopComponent(sp);
        contentPane.setBottomComponent(preview);

        // Key bindings:
        AbstractAction closeAction = new AbstractAction() {
          public void actionPerformed(ActionEvent e) {
            diag.dispose();
          }
        };
        ActionMap am = contentPane.getActionMap();
View Full Code Here

Examples of javax.swing.AbstractAction

                Globals.prefs.putInt("importInspectionDialogWidth", getSize().width);
                Globals.prefs.putInt("importInspectionDialogHeight", getSize().height);
            }
        });
        // Key bindings:
        AbstractAction closeAction = new AbstractAction() {
          public void actionPerformed(ActionEvent e) {
            dispose();
          }
        };
        ActionMap am = contentPane.getActionMap();
View Full Code Here

Examples of javax.swing.AbstractAction

        entries.getReadWriteLock().writeLock().lock();
        glTable.repaint();
    }

    public void insertNodes(JMenu menu, GroupTreeNode node) {
        final AbstractAction action = getAction(node);

        if (node.getChildCount() == 0) {
            menu.add(action);
            if (action.isEnabled())
                menu.setEnabled(true);
            return;
        }

        JMenu submenu = null;
        if (node.getGroup() instanceof AllEntriesGroup) {
            for (int i = 0; i < node.getChildCount(); ++i) {
                insertNodes(menu, (GroupTreeNode) node.getChildAt(i));
            }
        } else {
            submenu = new JMenu("[" + node.getGroup().getName() + "]");
            // setEnabled(true) is done above/below if at least one menu
            // entry (item or submenu) is enabled
            submenu.setEnabled(action.isEnabled());
            submenu.add(action);
            submenu.add(new JPopupMenu.Separator());
            for (int i = 0; i < node.getChildCount(); ++i)
                insertNodes(submenu, (GroupTreeNode) node.getChildAt(i));
            menu.add(submenu);
View Full Code Here

Examples of javax.swing.AbstractAction

                menu.setEnabled(true);
        }
    }

    protected AbstractAction getAction(GroupTreeNode node) {
        AbstractAction action = new AddToGroupAction(node);
        AbstractGroup group = node.getGroup();
        action.setEnabled(group.supportsAdd());
        return action;
    }
View Full Code Here

Examples of javax.swing.AbstractAction

          boolean firstMenuItem = true;
          // Fill menu dynamically with a menu item for the frame of each application home
          for (Home home : homeApplication.getHomes()) {
            final JFrame applicationFrame = homeApplication.getHomeFrame(home);
            JCheckBoxMenuItem windowMenuItem = new JCheckBoxMenuItem(
                new AbstractAction(applicationFrame.getTitle()) {
                    public void actionPerformed(ActionEvent ev) {
                      applicationFrame.toFront();
                    }
                  });
             
View Full Code Here

Examples of javax.swing.AbstractAction

        Box result = Box.createVerticalBox();
        myExporterToggles = new ButtonGroup();
        for (int i = 0; i < choiceChangeActions.length; i++) {
            final int selectedIndex = i;
            final Action nextRealAction = choiceChangeActions[i];
            Action nextWrapperAction = new AbstractAction(String
                    .valueOf(nextRealAction.getValue(Action.NAME))) {
                public void actionPerformed(ActionEvent e) {
                    nextRealAction.actionPerformed(e);
                    updateSelectionUI(selectedIndex);
                }
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.