|
|
@ -37,7 +37,7 @@ public class Window |
|
|
|
TextArea sourcecodeArea, errorArea; |
|
|
|
TextArea sourcecodeArea, errorArea; |
|
|
|
Checkbox verboseCheck, prettyCheck; |
|
|
|
Checkbox verboseCheck, prettyCheck; |
|
|
|
Button startButton, saveButton; |
|
|
|
Button startButton, saveButton; |
|
|
|
String lastClassName; |
|
|
|
String lastClassName, lastClassPath; |
|
|
|
Frame frame; |
|
|
|
Frame frame; |
|
|
|
|
|
|
|
|
|
|
|
PrintWriter errStream; |
|
|
|
PrintWriter errStream; |
|
|
@ -58,8 +58,8 @@ public class Window |
|
|
|
classField = new TextField(50); |
|
|
|
classField = new TextField(50); |
|
|
|
sourcecodeArea = new TextArea(20, 80); |
|
|
|
sourcecodeArea = new TextArea(20, 80); |
|
|
|
errorArea = new TextArea(3, 80); |
|
|
|
errorArea = new TextArea(3, 80); |
|
|
|
verboseCheck = new Checkbox("verbose", false); |
|
|
|
verboseCheck = new Checkbox("verbose", true); |
|
|
|
prettyCheck = new Checkbox("pretty", false); |
|
|
|
prettyCheck = new Checkbox("pretty", true); |
|
|
|
startButton = new Button("start"); |
|
|
|
startButton = new Button("start"); |
|
|
|
saveButton = new Button("save"); |
|
|
|
saveButton = new Button("save"); |
|
|
|
///#ifdef AWT10
|
|
|
|
///#ifdef AWT10
|
|
|
@ -234,10 +234,7 @@ public class Window |
|
|
|
|
|
|
|
|
|
|
|
public void run() { |
|
|
|
public void run() { |
|
|
|
decompiler.setOption("verbose", verboseCheck.getState() ? "1" : "0"); |
|
|
|
decompiler.setOption("verbose", verboseCheck.getState() ? "1" : "0"); |
|
|
|
if (prettyCheck.getState()) |
|
|
|
decompiler.setOption("pretty", prettyCheck.getState() ? "1" : "0"); |
|
|
|
decompiler.setOption("pretty", "0"); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
decompiler.setOption("pretty", "1"); |
|
|
|
|
|
|
|
errorArea.setText(""); |
|
|
|
errorArea.setText(""); |
|
|
|
///#ifdef AWT10
|
|
|
|
///#ifdef AWT10
|
|
|
|
/// saveButton.disable();
|
|
|
|
/// saveButton.disable();
|
|
|
@ -246,17 +243,23 @@ public class Window |
|
|
|
///#endif
|
|
|
|
///#endif
|
|
|
|
|
|
|
|
|
|
|
|
lastClassName = classField.getText(); |
|
|
|
lastClassName = classField.getText(); |
|
|
|
decompiler.setClassPath(classpathField.getText()); |
|
|
|
String newClassPath = classpathField.getText(); |
|
|
|
|
|
|
|
if (!newClassPath.equals(lastClassPath)) { |
|
|
|
|
|
|
|
decompiler.setClassPath(newClassPath); |
|
|
|
|
|
|
|
lastClassPath = newClassPath; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
Writer writer = new AreaWriter(sourcecodeArea); |
|
|
|
Writer writer |
|
|
|
|
|
|
|
= new BufferedWriter(new AreaWriter(sourcecodeArea), 512); |
|
|
|
try { |
|
|
|
try { |
|
|
|
decompiler.decompile(lastClassName, writer, null); |
|
|
|
decompiler.decompile(lastClassName, writer, null); |
|
|
|
} catch (IllegalArgumentException ex) { |
|
|
|
} catch (IllegalArgumentException ex) { |
|
|
|
sourcecodeArea.setText |
|
|
|
sourcecodeArea.setText |
|
|
|
("`"+lastClassName+"' is not a class name\n" |
|
|
|
("`"+lastClassName+"' is not a class name.\n" |
|
|
|
+"You have to give a full qualified classname " |
|
|
|
+"You have to give a full qualified classname " |
|
|
|
+"with '.' as package delimiter \n" |
|
|
|
+"with '.' as package delimiter \n" |
|
|
|
+"and without .class ending"); |
|
|
|
+"and without .class ending."); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
///#ifdef AWT10
|
|
|
|
///#ifdef AWT10
|
|
|
|