Refine search
@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(); } } } }
@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))); } } });
/** * 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) { ActionEvent copyEvent = new ActionEvent( JPopupMenuTable.this.table, ActionEvent.ACTION_PERFORMED, "copy" ); JPopupMenuTable.this.table.getActionMap().get(copyEvent.getActionCommand()).actionPerformed(copyEvent); } }
@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); } }
/** * 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; }
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); } } }
/** * "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(); } } } }
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) );
@Override public void run () { a.actionPerformed(new ActionEvent(logger, ActionEvent.ACTION_PERFORMED, null)); } });
a.actionPerformed(new ActionEvent(textArea, ActionEvent.ACTION_PERFORMED, null, e.getWhen(), e.getModifiers()));
private void projectListMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_projectListMouseClicked if (evt.getButton() == MouseEvent.BUTTON1 && evt.getClickCount() == 2) { selectProjectAction.actionPerformed(new ActionEvent(evt.getSource(), ActionEvent.ACTION_PERFORMED, "selectProject")); } }//GEN-LAST:event_projectListMouseClicked
@Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2 && e.getButton() == MouseEvent.BUTTON1) { action.actionPerformed(new ActionEvent(e.getSource(), ActionEvent.ACTION_PERFORMED, "", e.getModifiers())); } } }
public void requestView() { if (!isAllowView()) { return; } viewAction.actionPerformed(new ActionEvent(viewAction, ActionEvent.ACTION_PERFORMED, "performView")); }
@Override public void actionPerformed(ActionEvent e) { if (enabled && hotkey.shouldExecuteAction()) { hotkeyAction.action.actionPerformed(new ActionEvent(hotkeyAction, 0, hotkey.custom)); } } };
/** * Called when a global hotkey is executed. * * @param hotkeyId */ private void onGlobalHotkey(Object hotkeyId) { Hotkey hotkey = (Hotkey)hotkeyId; HotkeyAction action = actions.get(hotkey.actionId); if (enabled && action != null && hotkey.shouldExecuteAction()) { action.action.actionPerformed(new ActionEvent(action, 0, hotkey.custom)); } }
@Override public void addCheck(ListEvent event) { actionFilter.actionPerformed(new ActionEvent(event.getSource(), 1, "checked")); } };
public void requestView() { if (!isAllowView()) { return; } viewAction.actionPerformed(new ActionEvent(viewAction, ActionEvent.ACTION_PERFORMED, "performView")); }
@Override public void addCheck(ListEvent event) { actionFilter.actionPerformed(new ActionEvent(event.getSource(), 1, "checked")); } };