cli: move specific code from common jadx args

This commit is contained in:
Skylot
2013-08-10 22:52:06 +04:00
parent 7985466213
commit ab8fa23fc3
4 changed files with 95 additions and 90 deletions
+13 -14
View File
@@ -1,6 +1,6 @@
package jadx.gui;
import jadx.cli.JadxArgs;
import jadx.cli.JadxCLIArgs;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
@@ -12,25 +12,24 @@ public class JadxGUI {
private static final Logger LOG = LoggerFactory.getLogger(JadxGUI.class);
public static void main(String[] args) {
final JadxArgs jadxArgs = new JadxArgs(args, false);
try {
final JadxCLIArgs jadxArgs = new JadxCLIArgs(args);
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JadxWrapper wrapper = new JadxWrapper(jadxArgs);
MainWindow mainWindow = new MainWindow(wrapper);
mainWindow.setVisible(true);
if (!jadxArgs.getInput().isEmpty()) {
mainWindow.openFile(jadxArgs.getInput().get(0));
}
}
});
} catch (Throwable e) {
LOG.error("Error: " + e.getMessage());
System.exit(1);
}
SwingUtilities.invokeLater(new Runnable() {
public void run() {
MainWindow mainWindow = new MainWindow(jadxArgs);
mainWindow.setVisible(true);
if (!jadxArgs.getInput().isEmpty()) {
mainWindow.openFile(jadxArgs.getInput().get(0));
}
}
});
}
}
@@ -1,6 +1,5 @@
package jadx.gui;
import jadx.cli.JadxArgs;
import jadx.gui.treemodel.JClass;
import jadx.gui.treemodel.JNode;
import jadx.gui.treemodel.JRoot;
@@ -66,8 +65,8 @@ public class MainWindow extends JFrame {
private JToolBar searchToolBar;
private SearchBar searchBar;
public MainWindow(JadxArgs jadxArgs) {
this.wrapper = new JadxWrapper(jadxArgs);
public MainWindow(JadxWrapper wrapper) {
this.wrapper = wrapper;
initUI();
initMenuAndToolbar();