11 package net.sf.gridarta.textedit.textarea;
13 import java.awt.Component;
14 import java.awt.event.ActionEvent;
15 import java.awt.event.ActionListener;
16 import java.awt.event.KeyEvent;
17 import java.awt.event.KeyListener;
18 import java.util.EventObject;
19 import javax.swing.JPopupMenu;
20 import org.apache.log4j.Category;
21 import org.apache.log4j.Logger;
22 import org.jetbrains.annotations.NotNull;
23 import org.jetbrains.annotations.Nullable;
108 protected void executeAction(
final ActionListener listener,
final Object source, @Nullable
final String actionCommand) {
110 final ActionEvent evt =
new ActionEvent(source, ActionEvent.ACTION_PERFORMED, actionCommand);
113 final boolean repeatBak =
repeat;
117 listener.actionPerformed(evt);
119 for (
int i = 0; i < Math.max(1,
repeatCount); i++) {
120 listener.actionPerformed(evt);
146 final Object o = evt.getSource();
147 if (o instanceof Component) {
149 Component c = (Component) o;
157 if (c instanceof JPopupMenu) {
158 c = ((JPopupMenu) c).getInvoker();
167 LOG.fatal(
"BUG: getTextArea() returning null");
168 LOG.fatal(
"Report this to Slava Pestov <sp@gjt.org>");
169 assert false :
"BUG: getTextArea() returning null";
170 throw new Error(
"BUG: getTextArea() returning null");
189 final ActionListener grabAction2 =
grabAction;
191 executeAction(grabAction2, evt.getSource(), String.valueOf(evt.getKeyChar()));