Refine search
for(ActionListener a: buttonExample.getActionListeners()) { a.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, null) { //Nothing need go here, the actionPerformed method (with the //above arguments) will trigger the respective listener }); }
@Override public void actionPerformed(ActionEvent e) { if (focusOwner == null) return; String action = e.getActionCommand(); Action a = focusOwner.getActionMap().get(action); if (a != null) { a.actionPerformed(new ActionEvent(focusOwner, ActionEvent.ACTION_PERFORMED, null)); } } }
public void actionPerformed(@NotNull ActionEvent e) { ExTextField target = (ExTextField)getTextComponent(e); final Action currentAction = target.getCurrentAction(); if (currentAction != null) { currentAction.actionPerformed(e); } else { KeyStroke key = convert(e); if (key != null) { final char c = key.getKeyChar(); if (c > 0) { ActionEvent event = new ActionEvent(e.getSource(), e.getID(), "" + c, e.getWhen(), e.getModifiers()); super.actionPerformed(event); target.saveLastEntry(); } } else { super.actionPerformed(e); target.saveLastEntry(); } } } }
public void fireActionPerformed() { if (listner != null) { listner.actionPerformed(new ActionEvent(this, 0, "")); } } }
@Override public void mouseClicked(MouseEvent e) { int modelRow = TablesUtil.getSelectedModelRow(table); if (e.getClickCount() == 2 && modelRow != -1) { action.actionPerformed(new ActionEvent(table, ActionEvent.ACTION_PERFORMED, TablesUtil.getSearchIdFromTable(table, modelRow))); } } });
/** * Send a ChangeEvent, whose source is this Slider, to * each listener. This method method is called each time * a ChangeEvent is received from the model. * * @param menuKey The menu item key that was selected. * @see #addActionListener * @see javax.swing.event.EventListenerList */ protected void fireActionEvent(String menuKey) { ActionEvent actionEvent = new ActionEvent(this, 0, menuKey); Object[] listeners = listenerList.getListenerList(); for (int i = listeners.length - 2; i >= 0; i -= 2) { if (listeners[i] == ActionListener.class) { ((ActionListener) listeners[i + 1]).actionPerformed(actionEvent); } } }
/** * Perform copy event on current table. */ public void copyTable() { ActionEvent nev = new ActionEvent(this.tableValues, ActionEvent.ACTION_PERFORMED, "copy"); this.tableValues.getActionMap().get(nev.getActionCommand()).actionPerformed(nev); }
@Override public void actionPerformed( ActionEvent e ) { nd.setValue(option); if (buttonListener != null) { // #34485: some listeners expect that the action source is the option, not the button ActionEvent e2 = new ActionEvent( option, e.getID(), e.getActionCommand(), e.getWhen(), e.getModifiers() ); buttonListener.actionPerformed(e2); } if ((closingOptions == null) || Arrays.asList(closingOptions).contains(option)) { haveFinalValue = true; setVisible(false); } } }
@Override public void actionPerformed(ActionEvent e) { ActionEvent copyEvent = new ActionEvent( JPopupMenuTable.this.table, ActionEvent.ACTION_PERFORMED, "copy" ); JPopupMenuTable.this.table.getActionMap().get(copyEvent.getActionCommand()).actionPerformed(copyEvent); } }
actionCommand = model.getActionCommand(); ActionEvent ae = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, actionCommand); for (int i = listeners.length-2; i>=0; i-=2) { if (listeners[i]== ActionListener.class) { ((ActionListener)listeners[i+1]).actionPerformed(ae);
@Override public void actionPerformed(ActionEvent e) { if (table.getRowCount() > 0 && table.getRowCount() >= table.getEditingRow() && table.getEditingRow() >= 0) { int row = table.convertRowIndexToModel(table.getEditingRow()); fireEditingStopped(); ActionEvent event = new ActionEvent(table, ActionEvent.ACTION_PERFORMED, TablesUtil.getSearchIdFromTable(table, row)); action.actionPerformed(event); } }
private void notifyCloseListeners() { for(ActionListener listener : closeListeners) { listener.actionPerformed(new ActionEvent(this, 0, "")); } } }
/** * Selects word based on a mouse event. */ private void selectWord(MouseEvent e) { if (selectedWordEvent != null && selectedWordEvent.getX() == e.getX() && selectedWordEvent.getY() == e.getY()) { // We've already the done selection for this. return; } Action a = null; RTextArea textArea = getTextArea(); ActionMap map = textArea.getActionMap(); if (map != null) { a = map.get(RTextAreaEditorKit.selectWordAction); } if (a == null) { if (selectWord == null) { selectWord = new RTextAreaEditorKit.SelectWordAction(); } a = selectWord; } a.actionPerformed(new ActionEvent(textArea, ActionEvent.ACTION_PERFORMED, null, e.getWhen(), e.getModifiers())); selectedWordEvent = e; }
@Override public void mouseClicked(MouseEvent event) { ActionListener action = getAction(event); if (action != null) action.actionPerformed(new ActionEvent(DiffView.this, 0, "action")); } });
private void processEditingStopped() { newValue = table.getModel().getValueAt(row, column); // The data has changed, invoke the supplied Action if (! newValue.equals(oldValue)) { // Make a copy of the data in case another cell starts editing // while processing this change TableCellListener tcl = new TableCellListener( getTable(), getRow(), getColumn(), getOldValue(), getNewValue()); ActionEvent event = new ActionEvent( tcl, ActionEvent.ACTION_PERFORMED, ""); action.actionPerformed(event); } } }
/** * fire a new ActionEvent and process it, if some listeners are listening */ protected void fireActionEvent() { if(actionListener != null) { ActionEvent ae = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, command); actionListener.actionPerformed(ae); } }
/** * "Plays back" the last recorded macro in this text area. */ public synchronized void playbackLastMacro() { if (currentMacro!=null) { List<MacroRecord> macroRecords = currentMacro.getMacroRecords(); if (!macroRecords.isEmpty()) { Action[] actions = getActions(); undoManager.beginInternalAtomicEdit(); try { for (MacroRecord record : macroRecords) { for (int i=0; i<actions.length; i++) { if ((actions[i] instanceof RecordableTextAction) && record.id.equals( ((RecordableTextAction)actions[i]).getMacroID())) { actions[i].actionPerformed( new ActionEvent(this, ActionEvent.ACTION_PERFORMED, record.actionCommand)); break; } } } } finally { undoManager.endInternalAtomicEdit(); } } } }
private static void notifyActionListeners(String a) { for(ActionListener l : dialogActionListeners) { l.actionPerformed(new ActionEvent(VDialog.class, 0, a)); } }
Action action = this.dndList.getActionMap().get(TransferHandler.getCopyAction().getValue(Action.NAME)); if (action != null) { action.actionPerformed( new ActionEvent(this.dndList, ActionEvent.ACTION_PERFORMED, null) ); Action action = this.dndList.getActionMap().get(TransferHandler.getCutAction().getValue(Action.NAME)); if (action != null) { action.actionPerformed( new ActionEvent(this.dndList, ActionEvent.ACTION_PERFORMED, null) ); Action action = this.dndList.getActionMap().get(TransferHandler.getPasteAction().getValue(Action.NAME)); if (action != null) { action.actionPerformed( new ActionEvent(this.dndList, ActionEvent.ACTION_PERFORMED, null) );
private synchronized void fireActionPerformed() { if (actionListeners == null) return; ActionEvent a = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, ""); for (ActionListener l : actionListeners) l.actionPerformed(a); }