Package java.awt.event

Examples of java.awt.event.ActionEvent


    }

    if (isDoubleClick) {
      Action defaultAction = menu.getDefaultAction();
      if (defaultAction != null) {
        defaultAction.actionPerformed(new ActionEvent(mTree, 0, ""));
      }
    }

  }
View Full Code Here


  private Action createAction(String name, String id, String description,
      Icon smallIcon, Icon bigIcon, int type, final ActionListener listener) {
    Action action = new AbstractAction() {
      public void actionPerformed(ActionEvent e) {
        listener.actionPerformed(new ActionEvent(this, e.getID(), e
            .getActionCommand()));
      }
    };
    action.putValue(Action.NAME, name);
    action.putValue(Action.SMALL_ICON, smallIcon);
View Full Code Here

    Icon icon = getIcon(action);
    String title = getTitle(action);

    button.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        action.actionPerformed(new ActionEvent(action,ActionEvent.ACTION_PERFORMED,""));
        final AbstractButton btn = (AbstractButton) action.getValue(ToolBar.ACTION_VALUE);
        if (!(btn instanceof JToggleButton)) {
          MainFrame.getInstance().getProgramTableScrollPane().requestFocusInWindow();
        }
      }
View Full Code Here

    }
  }

  public void actionPerformed(ActionEvent event) {
    if (!listeners.isEmpty()) {
      ActionEvent e = new ActionEvent(menuItem, event.getID(),
          event.getActionCommand(), event.getWhen(),
          event.getModifiers());
      for (ActionListener l : listeners) {
        l.actionPerformed(e);
      }
View Full Code Here

  public void componentResized(ComponentEvent e) {}

  public void componentShown(ComponentEvent e) {
    interrupt();
    actionPerformed(new ActionEvent(this, 0, "show"));
  }
View Full Code Here

    comp.addKeyListener(new KeyAdapter() {

      public void keyTyped(KeyEvent e) {
        if (Character.isLetterOrDigit(e.getKeyChar()) &&
            !(e.isControlDown()||e.isMetaDown())) {
          actionPerformed(new ActionEvent(this, 0, "show"));
          mSearchField.setText(Character.toString(e.getKeyChar()));
         
          start();
        }
      }

      @Override
      public void keyPressed(KeyEvent e) {
        if (e.getKeyCode() == KeyEvent.VK_F && e.isControlDown()) {
          setBlockAutoClosing(true);
          actionPerformed(new ActionEvent(this, 0, "show"));
        }
      }
     
    });
  }
View Full Code Here

            c.shutdown();

            // check if starting the browser works
            c.runTool("-web", "-webPort", "9002", "-tool");
            lastUrl = "-";
            c.actionPerformed(new ActionEvent(this, 0, "console"));
            assertContains(lastUrl, ":9002");
            lastUrl = "-";
            // double-click prevention is 100 ms
            Thread.sleep(200);
            MouseEvent me = new MouseEvent(new Button(), 0, 0, 0, 0, 0, 0, false, MouseEvent.BUTTON1);
            c.mouseClicked(me);
            assertContains(lastUrl, ":9002");
            lastUrl = "-";
            // no delay - ignore because it looks like a double click
            c.mouseClicked(me);
            assertEquals("-", lastUrl);
            // open the window
            c.actionPerformed(new ActionEvent(this, 0, "status"));
            c.actionPerformed(new ActionEvent(this, 0, "exit"));

            // check if the service was stopped
            c.runTool("-webPort", "9002");
            c.shutdown();
View Full Code Here

  }
 
  public boolean stopCellEditing() {
    if (mComboBox.isEditable()) {
      // Commit edited value.
      mComboBox.actionPerformed(new ActionEvent(this, 0, ""));
    }
    return super.stopCellEditing();
  }
View Full Code Here

                  Action action = getAction(pluginAccess
                      .getContextMenuActions(program));

                  if (action != null) {
                    found = true;
                    ActionEvent evt = new ActionEvent(program, 0,
                        (String) action.getValue(Action.ACTION_COMMAND_KEY));
                    action.actionPerformed(evt);
                  }
                }
              }

              if (!found) {
                Action action = null;

                if (FavoritesPlugin.getRootNode()
                    .getMutableTreeNode().equals(target)) {
                  action = getAction(FavoritesPluginProxy.getInstance()
                      .getContextMenuActions(program));
                } else if (ReminderPlugin.getRootNode()
                    .getMutableTreeNode().equals(target)) {
                  action = getAction(ReminderPluginProxy.getInstance()
                      .getContextMenuActions(program));
                }

                if (action != null) {
                  found = true;
                  ActionEvent evt = new ActionEvent(program, 0, (String) action
                      .getValue(Action.ACTION_COMMAND_KEY));
                  action.actionPerformed(evt);
                }
              }
            }
View Full Code Here

                        if (fda != null) {
                            fda.setTo(drawingAttributes);
                        }
                    }

                    actionPerformed(new ActionEvent(this, 0, AddFeatureCmd));
                }
            } else {
                loadCurrentFeatures(node.children(), featureName, warehouse);
            }
        }
View Full Code Here

TOP

Related Classes of java.awt.event.ActionEvent

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.