Package javax.swing

Examples of javax.swing.AbstractAction


        table.getActionMap().put("properties", myPropertiesAction);
        table.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), "delete");
        table.getActionMap().put("delete", myDeleteAssignmentAction);
        table.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(GPAction.getKeyStroke("newArtifact.shortcut")
                , "newHuman");
        table.getActionMap().put("newHuman", new AbstractAction() {
      public void actionPerformed(ActionEvent e) {
        prj.newHumanResource();
      }
        });
        if (!prj.isOnlyViewer) {
View Full Code Here


        });
        return result;
    }

    private Component createButtonComponent(GPOptionGroup optionGroup) {
        Action action = new AbstractAction(myi18n.getAdvancedActionTitle()) {
            public void actionPerformed(ActionEvent e) {
                System.err
                        .println("[OptionsPageBuilder] createButtonComponent: ");
            }
           
View Full Code Here

        return result;
    }

    private Component createColorComponent(final ColorOption option) {
        final JButton colorButton = new JButton();
        Action action = new AbstractAction(myi18n.getColorButtonText(option)) {
            public void actionPerformed(ActionEvent e) {
                ActionListener onOkPressing = new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        Color color = ourColorChooser.getColor();
                        colorButton.setBackground(color);
View Full Code Here

        final DefaultStringOption servernameOption = (DefaultStringOption) ftpGroup.getOption(DocumentCreator.SERVERNAME_OPTION_ID);
        final DefaultStringOption dirnameOption = (DefaultStringOption) ftpGroup.getOption(DocumentCreator.DIRECTORYNAME_OPTION_ID);
        final DefaultStringOption passwordOption = (DefaultStringOption) ftpGroup.getOption(DocumentCreator.PASSWORD_OPTION_ID);
        final JComponent optionsPane = builder.buildPage(project.getDocumentManager().getNetworkOptionGroups(), getPageID());
        final Action testConnectionAction = new AbstractAction() {
            {
                putValue(Action.NAME, GanttLanguage.getInstance().getText("testFTPConnection"));
                setEnabled(canEnableTestAction(ftpGroup));
            }
            public void actionPerformed(ActionEvent e) {
                StringBuffer urlString = new StringBuffer();
                urlString.append("ftp://");
                urlString.append(usernameOption.getUncommitedValue()==null ? "":usernameOption.getUncommitedValue());
                urlString.append(passwordOption.getUncommitedValue()==null ? "" : ":"+passwordOption.getUncommitedValue());
                urlString.append("@");
                urlString.append(servernameOption.getUncommitedValue());
                urlString.append("/");
                urlString.append(dirnameOption.getUncommitedValue());
                urlString.append("/");
                URL url = null;
                try {
                    url = new URL(urlString.toString() + "test.txt");
                    URLConnection urlc = url.openConnection();
                    OutputStream os = urlc.getOutputStream();
                    os.write(("This is GanttProject +++ I was here!")
                            .getBytes());
                    os.close();
                    JOptionPane.showMessageDialog(optionsPane, GanttLanguage
                            .getInstance().getText("successFTPConnection"),
                            GanttLanguage.getInstance().getText("success"),
                            JOptionPane.INFORMATION_MESSAGE);
                } catch (IOException e2) {
                    uiFacade.showErrorDialog(e2);
//                    JOptionPane.showMessageDialog(, GanttLanguage
//                            .getInstance().getText("errorFTPConnection"),
//                            GanttLanguage.getInstance().getText("error"),
//                            JOptionPane.ERROR_MESSAGE);
                } finally {

                }
            }               
        };
        ChangeValueListener listener = new ChangeValueListener() {
            public void changeValue(ChangeValueEvent event) {
                testConnectionAction.setEnabled(canEnableTestAction(ftpGroup));
            }
        };
        servernameOption.addChangeValueListener(listener);
        usernameOption.addChangeValueListener(listener);
        passwordOption.addChangeValueListener(listener);
View Full Code Here

    public Component getComponent() {
        Action[] choiceChangeActions = new Action[myImporters.length];
        GPOptionGroup[] choiceOptions = new GPOptionGroup[myImporters.length];
        for (int i = 0; i < myImporters.length; i++) {
            final Importer nextImporter = myImporters[i];
            Action nextAction = new AbstractAction(nextImporter
                    .getFileTypeDescription()) {
                public void actionPerformed(ActionEvent e) {
                    ImporterChooserPage.this.myState.myImporter = nextImporter;
                }
            };
View Full Code Here

        treetable = new GanttTreeTable(app.getProject(), uiFacade, treeModel);
        treetable.getActionMap().put(myIndentAction.getValue(Action.NAME), myIndentAction);
        treetable.getActionMap().put(myDedentAction.getValue(Action.NAME), myDedentAction);
        treetable.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), myIndentAction.getValue(Action.NAME));
        treetable.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, KeyEvent.SHIFT_DOWN_MASK), myDedentAction.getValue(Action.NAME));
        treetable.getActionMap().put("newTask", new AbstractAction() {
      public void actionPerformed(ActionEvent e) {
                if (getSelectedTask() != null)
                    setEditingTask(getSelectedTask());
                Mediator.getGanttProjectSingleton().getUndoManager()
                        .undoableEdit("New Task", new Runnable() {
View Full Code Here

        }
        return (Action[]) actions.toArray(new Action[0]);
    }

    private Action createMenuAction(String label, String iconPath) {
        AbstractAction result = new AbstractAction(label, new ImageIcon(
                getClass().getResource(iconPath))) {
            public void actionPerformed(ActionEvent e) {
                appli.actionPerformed(e);
            }
        };
View Full Code Here

  }

  private void assignHotkeys() {

    // assign keys 1-6 - set priority of selected items
    final Action setPriorityAction = new AbstractAction() {
      public void actionPerformed(final ActionEvent event) {
        final FreenetPriority prio = FreenetPriority.getPriority(new Integer(event.getActionCommand()).intValue());
        final List<FrostDownloadItem> selectedItems = modelTable.getSelectedItems();
        changeItemPriorites(selectedItems, prio);
       
      }
    };
    getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_1, 0),
        "SETPRIO");
    getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_2, 0),
        "SETPRIO");
    getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_3, 0),
        "SETPRIO");
    getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_4, 0),
        "SETPRIO");
    getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_5, 0),
        "SETPRIO");
    getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_6, 0),
        "SETPRIO");
    getActionMap().put("SETPRIO", setPriorityAction);
   
    // Enter
    final Action setOpenFileAction = new AbstractAction() {
      public void actionPerformed(final ActionEvent event) {
        openFile(modelTable.getSelectedItem());
      }
    };
    getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),"OpenFile");
View Full Code Here

        myDelayManager.addObserver(tree);
        myTaskManager.addTaskListener(myDelayManager);

        getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(
            KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0), "refresh");
        getRootPane().getActionMap().put("refresh", new AbstractAction() {
      public void actionPerformed(ActionEvent e) {
              getActiveChart().reset();
              repaint();
      }
        });
View Full Code Here

        super("", iconSize);
        myProvider = provider;
    }

    public void actionPerformed(ActionEvent e) {
        AbstractAction activeAction = myProvider.getActiveAction();
        activeAction.actionPerformed(e);
    }
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.