Fixed class resource searching

This commit is contained in:
Konloch 2021-06-25 19:42:54 -07:00
parent 7d55816618
commit facbee3d1a
2 changed files with 8 additions and 2 deletions

View file

@ -24,6 +24,7 @@ public class SearchableRSyntaxTextArea extends RSyntaxTextArea
private final JPanel searchPanel = new JPanel(new BorderLayout()); private final JPanel searchPanel = new JPanel(new BorderLayout());
private final JTextField searchInput = new JTextField(); private final JTextField searchInput = new JTextField();
private final JCheckBox caseSensitiveSearch = new JCheckBox("Exact"); private final JCheckBox caseSensitiveSearch = new JCheckBox("Exact");
private final JLabel titleHeader = new JLabel("");
public SearchableRSyntaxTextArea() public SearchableRSyntaxTextArea()
{ {
@ -47,7 +48,6 @@ public class SearchableRSyntaxTextArea extends RSyntaxTextArea
searchInput.addKeyListener(new ReleaseKeyListener(keyEvent -> searchInput.addKeyListener(new ReleaseKeyListener(keyEvent ->
{ {
System.out.println("DEBUG: " + keyEvent.getKeyChar());
if (keyEvent.getKeyCode() == KeyEvent.VK_ENTER) if (keyEvent.getKeyCode() == KeyEvent.VK_ENTER)
search(searchInput.getText(), true, caseSensitiveSearch.isSelected()); search(searchInput.getText(), true, caseSensitiveSearch.isSelected());
})); }));
@ -90,4 +90,9 @@ public class SearchableRSyntaxTextArea extends RSyntaxTextArea
{ {
return caseSensitiveSearch; return caseSensitiveSearch;
} }
public JLabel getTitleHeader()
{
return titleHeader;
}
} }

View file

@ -81,6 +81,7 @@ public class ResourceViewPanel
SwingUtilities.invokeLater(() -> SwingUtilities.invokeLater(() ->
{ {
panel.add(updateUpdaterTextArea.getScrollPane()); panel.add(updateUpdaterTextArea.getScrollPane());
panel.add(updateUpdaterTextArea.getTitleHeader(), BorderLayout.NORTH);
textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA); textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
textArea.setCodeFoldingEnabled(true); textArea.setCodeFoldingEnabled(true);
@ -89,7 +90,7 @@ public class ResourceViewPanel
textArea.setCaretPosition(0); textArea.setCaretPosition(0);
textArea.setEditable(isPanelEditable); textArea.setEditable(isPanelEditable);
textArea.getScrollPane().setColumnHeaderView(new JLabel(decompiler.getDecompilerName() + " - Editable: " + textArea.isEditable())); textArea.getTitleHeader().setText(decompiler.getDecompilerName() + " - Editable: " + textArea.isEditable());
textArea.setFont(new Font(Font.MONOSPACED, Font.PLAIN, textArea.setFont(new Font(Font.MONOSPACED, Font.PLAIN,
(int) BytecodeViewer.viewer.fontSpinner.getValue())); (int) BytecodeViewer.viewer.fontSpinner.getValue()));
}); });