--cp option added

menu item "Reload classpath" added


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@813 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent fb10437749
commit cdb44a3d1e
  1. 27
      jode/jode/swingui/Main.java

@ -36,15 +36,16 @@ import java.io.*;
public class MainWindow public class MainWindow
implements ActionListener, Runnable, TreeSelectionListener { implements ActionListener, Runnable, TreeSelectionListener {
JFrame frame;
JTree classTree; JTree classTree;
PackagesTreeModel classModel; PackagesTreeModel classModel;
JTextArea sourcecodeArea, errorArea; JTextArea sourcecodeArea, errorArea;
Thread decompileThread; Thread decompileThread;
String currentClassPath, lastClassName; String currentClassPath, lastClassName;
public MainWindow() { public MainWindow(String classpath) {
setClasspath(System.getProperty("java.class.path")); setClasspath(classpath);
JFrame frame = new JFrame(GlobalOptions.copyright); frame = new JFrame(GlobalOptions.copyright);
fillContentPane(frame.getContentPane()); fillContentPane(frame.getContentPane());
addMenu(frame); addMenu(frame);
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
@ -53,6 +54,9 @@ public class MainWindow
System.exit(0); System.exit(0);
} }
}); });
}
public void show() {
frame.pack(); frame.pack();
frame.show(); frame.show();
} }
@ -224,6 +228,13 @@ public class MainWindow
} }
}); });
menu.add(item); menu.add(item);
item = new JMenuItem("Reload classpath");
item.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ev) {
setClasspath(currentClassPath);
}
});
menu.add(item);
bar.add(menu); bar.add(menu);
frame.setJMenuBar(bar); frame.setJMenuBar(bar);
} }
@ -240,7 +251,15 @@ public class MainWindow
} }
public static void main(String[] params) { public static void main(String[] params) {
MainWindow win = new MainWindow(); String cp = System.getProperty("java.class.path");
for (int i=0; i<params.length; i++) {
if (params[i].equals("--cp"))
cp = params[++i];
else
return;
}
MainWindow win = new MainWindow(cp);
win.show();
} }
} }

Loading…
Cancel
Save