Package javax.swing

Examples of javax.swing.AbstractAction


        for (int i = 0; i < myExporters.length; i++) {
            final Exporter nextExporter = myExporters[i];
            if (nextExporter==myState.getExporter()) {
                selectedGroupIndex = i;
            }
            Action nextAction = new AbstractAction(nextExporter
                    .getFileTypeDescription()) {
                public void actionPerformed(ActionEvent e) {
                    ExporterChooserPage.this.myState.setExporter(nextExporter);
                }
            };
View Full Code Here


   
    // Second step view is a panel displaying a check box that enables next step
    private static class SecondStepView extends JPanel implements View {
      public SecondStepView(final SecondStep secondStepController) {
        add(new JLabel("Finish ?"));
        add(new JCheckBox(new AbstractAction("Yes") {
            public void actionPerformed(ActionEvent ev) {
              // Activate next step when check box is selected
              secondStepController.setFinishEnabled(
                  ((AbstractButton)ev.getSource()).isSelected());
            }
View Full Code Here

        public void removeUpdate(DocumentEvent ev) {
          changedUpdate(ev);
        }
      });
    this.searchTextField.getInputMap().put(KeyStroke.getKeyStroke("ESCAPE"), "deleteContent");
    this.searchTextField.getActionMap().put("deleteContent", new AbstractAction() {
        public void actionPerformed(ActionEvent ev) {
          searchTextField.setText("");
        }
      });
    if (OperatingSystem.isMacOSXLeopardOrSuperior()) {
View Full Code Here

         
          colorChooser = new JColorChooser();
          // Add auto selection to color chooser panels text fields
          addAutoSelectionOnTextFields(colorChooser);
          // Add Esc key management
          colorChooser.getActionMap().put("close", new AbstractAction() {
              public void actionPerformed(ActionEvent ev) {
                ((Window)SwingUtilities.getRoot(colorChooser)).dispose();
              }
            });
          colorChooser.getInputMap(JColorChooser.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "close");
View Full Code Here

          HomeComponent3D homeComponent3D = new HomeComponent3D(home, preferences, controller);
          // Add tab key to input map to change camera
          InputMap inputMap = homeComponent3D.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
          inputMap.put(KeyStroke.getKeyStroke("SPACE"), "changeCamera");
          ActionMap actionMap = homeComponent3D.getActionMap();
          actionMap.put("changeCamera", new AbstractAction() {
              public void actionPerformed(ActionEvent ev) {
                if (home.getCamera() == home.getTopCamera()) {
                  controller.viewFromObserver();
                } else {
                  controller.viewFromTop();
View Full Code Here

  /**
   * @return an action listener that will set the correct focus, either inside
   *         a template connection url or the next text field.
   */
  private Action getNextTemplateItemAction() {
    return new AbstractAction() {

      private static final long serialVersionUID = 1L;

      @Override
      public void actionPerformed(ActionEvent e) {
View Full Code Here

  /**
   * Creates actions that calls back <code>controller</code> methods. 
   */
  private void createActions(final PlanController controller) {
    // Delete selection action
    Action deleteSelectionAction = new AbstractAction() {
      public void actionPerformed(ActionEvent ev) {
        controller.deleteSelection();
      }
    };
    // Escape action
    Action escapeAction = new AbstractAction() {
      public void actionPerformed(ActionEvent ev) {
        controller.escape();
      }
    };
    // Move selection action 
View Full Code Here

      goToPointOfViewMenu.add(new ResourceAction(preferences, HomePane.class, "NoStoredPointOfView", false));
    } else {
      goToPointOfViewMenu.setEnabled(true);
      for (final Camera camera : storedCameras) {
        goToPointOfViewMenu.add(
            new AbstractAction(camera.getName()) {
              public void actionPerformed(ActionEvent e) {
                controller.getHomeController3D().goToCamera(camera);
              }
            });
      }
View Full Code Here

  protected void updateOpenRecentHomeMenu(JMenu openRecentHomeMenu,
                                          final HomeController controller) {
    openRecentHomeMenu.removeAll();
    for (final String homeName : controller.getRecentHomes()) {
      openRecentHomeMenu.add(
          new AbstractAction(controller.getContentManager().getPresentationName(
                  homeName, ContentManager.ContentType.SWEET_HOME_3D)) {
            public void actionPerformed(ActionEvent e) {
              controller.open(homeName);
            }
          });
View Full Code Here

    this.setTitle(_trayIcon.toolTipPrefix + "Console");
    this.addWindowListener(new WindowEventHandler());
    this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    _okIcon = _trayIcon.createImageIcon("/resources/tick.png");

    _clearOutputItem.setAction(new AbstractAction(null, WrapperTrayIconImpl.createImageIcon("/resources/edit-clear.png"))
    {
      public void actionPerformed(ActionEvent e)
      {
        clearOutput();
      }

    });

    _pauseOutputItem.setAction(new AbstractAction(null, WrapperTrayIconImpl.createImageIcon("/resources/pause.png"))
    {
      public void actionPerformed(ActionEvent e)
      {
        _outputPaused = true;
        _consoleForm._START_OUTPUT_BUTTON.setEnabled(true);
        _consoleForm._PAUSE_OUTPUT_BUTTON.setEnabled(false);
      }

    });

    _startOutputItem.setAction(new AbstractAction(null, WrapperTrayIconImpl.createImageIcon("/resources/start.png"))
    {
      public void actionPerformed(ActionEvent e)
      {
        _outputPaused = false;
        _consoleForm._START_OUTPUT_BUTTON.setEnabled(false);
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.