diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcesearch/SearchBoxPane.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcesearch/SearchBoxPane.java index de9475a2..cae7a1fa 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcesearch/SearchBoxPane.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcesearch/SearchBoxPane.java @@ -98,7 +98,7 @@ public class SearchBoxPane extends TranslatedVisibleComponent typeBox.addItemListener(il); - typeBox.setSelectedItem(SearchType.Strings); + typeBox.setSelectedItem(SearchType.STRINGS); il.itemStateChanged(null); searchOpts.add(typeBox); @@ -178,7 +178,7 @@ public class SearchBoxPane extends TranslatedVisibleComponent searchType = (SearchType) typeBox.getSelectedItem(); final SearchRadius radius = (SearchRadius) searchRadiusBox.getSelectedItem(); - if (radius == SearchRadius.All_Classes) + if (radius == SearchRadius.ALL_CLASSES) { if (performSearchThread == null || performSearchThread.finished) { @@ -193,7 +193,7 @@ public class SearchBoxPane extends TranslatedVisibleComponent BytecodeViewer.showMessage("You currently have a search performing in the background, please wait for that to finish."); } } - else if (radius == SearchRadius.Current_Class) + else if (radius == SearchRadius.CURRENT_CLASS) { final ResourceViewer cv = BytecodeViewer.getActiveResource(); diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcesearch/SearchRadius.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcesearch/SearchRadius.java index e5c53e67..b42a7a77 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcesearch/SearchRadius.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcesearch/SearchRadius.java @@ -24,6 +24,19 @@ package the.bytecode.club.bytecodeviewer.gui.resourcesearch; */ public enum SearchRadius { - All_Classes, - Current_Class + ALL_CLASSES("All Classes"), + CURRENT_CLASS("Current Class"); + + private final String name; + + SearchRadius(String name) + { + this.name = name; + } + + @Override + public String toString() + { + return name; + } } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcesearch/SearchType.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcesearch/SearchType.java index b3f7a72e..9899dcb9 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcesearch/SearchType.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcesearch/SearchType.java @@ -27,11 +27,11 @@ import the.bytecode.club.bytecodeviewer.searching.impl.*; */ public enum SearchType { - Strings(new LDCSearch()), - Regex(new RegexSearch()), - MethodCall(new MethodCallSearch()), - FieldCall(new FieldCallSearch()), - MemberWithAnnotation(new MemberWithAnnotationSearch()); + STRINGS(new LDCSearch()), + REGEX(new RegexSearch()), + METHOD_CALL(new MethodCallSearch()), + FIELD_CALL(new FieldCallSearch()), + MEMBER_WITH_ANNOTATION(new MemberWithAnnotationSearch()); public final SearchPanel panel; @@ -39,4 +39,10 @@ public enum SearchType { this.panel = panel; } + + @Override + public String toString() + { + return panel.toString(); + } } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/FieldCallSearch.java b/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/FieldCallSearch.java index eacb6b07..ade5269d 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/FieldCallSearch.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/FieldCallSearch.java @@ -32,6 +32,12 @@ import java.util.Iterator; public class FieldCallSearch extends MethodCallSearch { + @Override + public String toString() + { + return "Field Call Search"; + } + @Override public void search(ResourceContainer container, String resourceWorkingName, ClassNode node, boolean exact) { diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/LDCSearch.java b/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/LDCSearch.java index 0fd8a037..8d537ef4 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/LDCSearch.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/LDCSearch.java @@ -52,6 +52,12 @@ public class LDCSearch implements SearchPanel LAFTheme.registerThemeUpdate(searchText); } + @Override + public String toString() + { + return "LDC Search"; + } + @Override public JPanel getPanel() { diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/MemberWithAnnotationSearch.java b/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/MemberWithAnnotationSearch.java index ab7962b5..97647e99 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/MemberWithAnnotationSearch.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/MemberWithAnnotationSearch.java @@ -53,6 +53,12 @@ public class MemberWithAnnotationSearch implements SearchPanel LAFTheme.registerThemeUpdate(annotation); } + @Override + public String toString() + { + return "Members With Annotation Search"; + } + @Override public JPanel getPanel() { diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/MethodCallSearch.java b/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/MethodCallSearch.java index 5b8988b4..d57bd78e 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/MethodCallSearch.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/MethodCallSearch.java @@ -59,6 +59,12 @@ public class MethodCallSearch implements SearchPanel LAFTheme.registerThemeUpdate(mOwner, mName, mDesc); } + @Override + public String toString() + { + return "Method Call Search"; + } + public JPanel getPanel() { if (myPanel == null) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/RegexSearch.java b/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/RegexSearch.java index 4a9e8397..093f323a 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/RegexSearch.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/RegexSearch.java @@ -58,6 +58,12 @@ public class RegexSearch implements SearchPanel LAFTheme.registerThemeUpdate(searchText); } + @Override + public String toString() + { + return "Regex Search"; + } + @Override public JPanel getPanel() {