Package java.awt.event

Examples of java.awt.event.ActionListener.actionPerformed()


    protected void processActionEvent(ActionEvent e) {
        for (Iterator<?> i = actionListeners.getUserIterator(); i.hasNext();) {
            ActionListener listener = (ActionListener) i.next();
            switch (e.getID()) {
                case ActionEvent.ACTION_PERFORMED:
                    listener.actionPerformed(e);
                    break;
            }
        }
    }
View Full Code Here


                WeakReference ref = (WeakReference) i.next();
                ActionListener l = (ActionListener) ref.get();
                if (l != null) {
                    if (e == null)
                        e = new ActionEvent(EVTaskList.class, 0, taskListName);
                    l.actionPerformed(e);
                }
            }
        }
    }
    private static List TASK_LIST_SAVE_LISTENERS = new Vector();
View Full Code Here

    public void testExceptionThrowingFromHiddenComponent() {
        MutablePicoContainer pc = createImplementationHidingPicoContainer();
        pc.registerComponentImplementation(ActionListener.class, Burp.class);
        try {
            ActionListener ac = (ActionListener) pc.getComponentInstance(ActionListener.class);
            ac.actionPerformed(null);
            fail("Oh no.");
        } catch (RuntimeException e) {
            assertEquals("woohoo", e.getMessage());
        }
    }
View Full Code Here

                    Iterator<ActionListener> it = campaignActionListeners.iterator();
                    ActionListener al;
                    while (it.hasNext()) {
                        al = it.next();
                        //
                        al.actionPerformed(new ActionEvent(TestCampaignMainPanel.this, RUN_ID, STARTED_CMD));
                    }
                }
                CampaignManager campaignManager = CampaignManager.getInstance();
                Campaign campaign = campaignManager.readFile(xmlFileName);
                campaignManager.execute(campaign);
View Full Code Here

                    Iterator<ActionListener> it = campaignActionListeners.iterator();
                    ActionListener al;
                    while (it.hasNext()) {
                        al = it.next();
                        //
                        al.actionPerformed(new ActionEvent(TestCampaignMainPanel.this, RUN_ID, STOPPED_CMD));
                    }
                }
            }
        }
    }
View Full Code Here

    public void testExceptionThrowingFromHiddenComponent() {
        Container pc = createImplementationHidingPicoContainer();
        pc.registerConstructor(ActionListener.class, Burp.class);
        try {
            ActionListener ac = (ActionListener) pc.getInstance(ActionListener.class);
            ac.actionPerformed(null);
            fail("Oh no.");
        } catch (RuntimeException e) {
            assertEquals("woohoo", e.getMessage());
        }
    }
View Full Code Here

       
        labelEditor.addFocusListener(new FocusListener(){
          public void focusGained(FocusEvent arg0) {
          }
          public void focusLost(FocusEvent arg0) {
            onEditDone.actionPerformed(null);           
          }
        });
       
        labelEditor.addActionListener(onEditDone);
       
View Full Code Here

       
        labelEditor.addFocusListener(new FocusListener(){
          public void focusGained(FocusEvent arg0) {
          }
          public void focusLost(FocusEvent arg0) {
            onEditDone.actionPerformed(null);           
          }
        });
       
        labelEditor.addActionListener(onEditDone);
       
View Full Code Here

                        case UNKNOWN:
                        default:
                            if (c != 0) { // ignore null chars
                                ActionListener action = triggeredActions.get((char) c);
                                if (action != null) {
                                    action.actionPerformed(null);
                                }
                                else {
                                    putChar(c, true);
                                }
                            }
View Full Code Here

  private void fireActionListeners(ActionEvent e) {
    if(listeners==null) return;
    for(int a = 0; a<listeners.size(); a++) {
      ActionListener l = (ActionListener)listeners.get(a);
      try {
        l.actionPerformed(e);
      } catch(Exception e2) {
        e2.printStackTrace();
      }
    }
  }
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.