Main Viewer GUI Cleanup

This commit is contained in:
Konloch 2021-07-11 02:17:46 -07:00
parent 56a6a4ebf3
commit 717b2e466c
3 changed files with 3 additions and 12 deletions

View file

@ -777,15 +777,6 @@ public class MainViewerGUI extends JFrame
public void openFile(final ResourceContainer container, final String name, byte[] content) {
workPane.addFileResource(container, name, content);
}
@SuppressWarnings("unchecked")
public static <T> T getComponent(final Class<T> clazz) {
for (final VisibleComponent vc : uiComponents) {
if (vc.getClass() == clazz)
return (T) vc;
}
return null;
}
public void compileOnNewThread()
{

View file

@ -46,8 +46,8 @@ class PerformSearch extends BackgroundSearchThread
for (ClassNode c : container.resourceClasses.values())
searchBoxPane.searchType.details.search(container, c, srn, searchBoxPane.exact.isSelected());
Objects.requireNonNull(MainViewerGUI.getComponent(SearchBoxPane.class)).search.setEnabled(true);
Objects.requireNonNull(MainViewerGUI.getComponent(SearchBoxPane.class)).search.setText(TranslatedStrings.SEARCH.getText());
BytecodeViewer.viewer.searchBoxPane.search.setEnabled(true);
BytecodeViewer.viewer.searchBoxPane.search.setText(TranslatedStrings.SEARCH.getText());
searchBoxPane.tree.expandPath(new TreePath(searchBoxPane.tree.getModel().getRoot()));
searchBoxPane.tree.updateUI();

View file

@ -93,7 +93,7 @@ public class ImportResource implements Runnable
{
BytecodeViewer.updateBusyStatus(false);
try {
Objects.requireNonNull(MainViewerGUI.getComponent(ResourceListPane.class)).updateTree();
BytecodeViewer.viewer.resourcePane.updateTree();
} catch (NullPointerException ignored) { }
}
}