20 package net.sf.gridarta.textedit.scripteditor;
22 import java.awt.Color;
23 import java.awt.event.ActionEvent;
24 import java.awt.event.ActionListener;
25 import javax.swing.JComboBox;
26 import javax.swing.JPopupMenu;
27 import javax.swing.text.BadLocationException;
29 import org.apache.log4j.Category;
30 import org.apache.log4j.Logger;
31 import org.jetbrains.annotations.NotNull;
62 private final JPopupMenu
menu;
82 setBackground(Color.white);
86 for (
final String menuEntry : menuEntries) {
87 addItem(
" " + menuEntry);
93 isReady = !menuEntries.isEmpty();
95 setRequestFocusEnabled(
true);
145 String method =
popup.getSelectedItem().toString();
146 method = method.substring(0, method.indexOf(
'(')).trim() +
"()";
149 if (activeTextArea !=
null) {
153 }
catch (
final BadLocationException ex) {
154 LOG.error(
"BadLocationException", ex);
159 popup.setSelectedIndex(0);