mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 11:50:51 +00:00
Issue #302 Find declaration (Ctrl+click, Ctrl+B), Find usages (Ctrl+U)
This commit is contained in:
@@ -43,16 +43,21 @@ import java.util.logging.Logger;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.Action;
|
||||
import javax.swing.ActionMap;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.InputMap;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JEditorPane;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JPopupMenu;
|
||||
import javax.swing.JRootPane;
|
||||
import javax.swing.JTree;
|
||||
import javax.swing.KeyStroke;
|
||||
@@ -62,6 +67,7 @@ import javax.swing.UIManager;
|
||||
import javax.swing.UnsupportedLookAndFeelException;
|
||||
import javax.swing.plaf.FontUIResource;
|
||||
import javax.swing.plaf.basic.BasicColorChooserUI;
|
||||
import javax.swing.text.JTextComponent;
|
||||
import javax.swing.tree.TreeModel;
|
||||
import javax.swing.tree.TreePath;
|
||||
import org.pushingpixels.flamingo.api.common.icon.ImageWrapperResizableIcon;
|
||||
@@ -498,4 +504,20 @@ public class View {
|
||||
tree.collapsePath(parent);
|
||||
}
|
||||
}
|
||||
|
||||
public static void addEditorAction(JEditorPane editor,AbstractAction a,String key, String name, String keyStroke){
|
||||
KeyStroke ks = KeyStroke.getKeyStroke(keyStroke);
|
||||
a.putValue(Action.ACCELERATOR_KEY, ks);
|
||||
a.putValue(Action.NAME, name);
|
||||
|
||||
String actionName = key;
|
||||
ActionMap amap = editor.getActionMap();
|
||||
InputMap imap = editor.getInputMap(JTextComponent.WHEN_FOCUSED);
|
||||
imap.put(ks, actionName);
|
||||
amap.put(actionName, a);
|
||||
|
||||
JPopupMenu pmenu = editor.getComponentPopupMenu();
|
||||
JMenuItem findUsagesMenu = new JMenuItem(a);
|
||||
pmenu.add(findUsagesMenu);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user