|
14 | 14 | import club.bytecode.the.jda.gui.fileviewer.Viewer; |
15 | 15 | import club.bytecode.the.jda.gui.fileviewer.ViewerFile; |
16 | 16 | import club.bytecode.the.jda.gui.navigation.FileNavigationPane; |
| 17 | +import club.bytecode.the.jda.gui.search.SearchDialog; |
17 | 18 | import club.bytecode.the.jda.settings.IPersistentWindow; |
18 | 19 | import club.bytecode.the.jda.settings.Settings; |
19 | 20 |
|
@@ -215,7 +216,7 @@ private void initializeMenubar() { |
215 | 216 | // Edit menu |
216 | 217 | // =========================================================================================== |
217 | 218 | menuBar.add(editMenu); |
218 | | - |
| 219 | + |
219 | 220 | // ------------------------------------------------------------------------------------------- |
220 | 221 | // Settings menu |
221 | 222 | settingsMenu = new JMenu("Settings"); |
@@ -250,6 +251,15 @@ private void initializeMenubar() { |
250 | 251 | button.addActionListener((e) -> plugin.onPluginButton()); |
251 | 252 | pluginsMenu.add(button); |
252 | 253 | } |
| 254 | + |
| 255 | + // ------------------------------------------------------------------------------------------- |
| 256 | + // Search menu |
| 257 | + JMenu searchMenu = new JMenu("Search..."); |
| 258 | + editMenu.add(searchMenu); |
| 259 | + JMenuItem constantButton = new JMenuItem("Raw constant"); |
| 260 | + constantButton.addActionListener((e) -> doSearchDialog()); |
| 261 | + searchMenu.add(constantButton); |
| 262 | + |
253 | 263 |
|
254 | 264 | // =========================================================================================== |
255 | 265 | // View menu |
@@ -316,7 +326,13 @@ private void initializeMenubar() { |
316 | 326 | // =========================================================================================== |
317 | 327 | menuBar.add(spinnerMenu); |
318 | 328 | } |
319 | | - |
| 329 | + |
| 330 | + public void doSearchDialog() { |
| 331 | + String constant = JOptionPane.showInputDialog("Enter a constant..."); |
| 332 | + if (constant != null && !constant.isEmpty()) |
| 333 | + new SearchDialog(constant, JDA.search(constant)).setVisible(true); |
| 334 | + } |
| 335 | + |
320 | 336 | private void initializePanelGroup() { |
321 | 337 | for (int i = 0; i < panelGroups.length; i++) { |
322 | 338 | String decompilerName = Settings.PANE_DECOMPILERS[i].getString(); |
|
0 commit comments