Pretty option fixed.

Verbose and Pretty are default now.
Don't reset classpath if it didn't changed.


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1232 379699f6-c40d-0410-875b-85095c16579e
branch_1_1
hoenicke 25 years ago
parent eedb8fadf5
commit ae980c0e34
  1. 8
      jode/jode/decompiler/Decompiler.java
  2. 25
      jode/jode/decompiler/Window.java

@ -132,10 +132,10 @@ public class Decompiler {
|| value.equals("off")
|| value.equals("no"))
Options.options &= ~(1 << i);
else if (value.equals("1")
|| value.equals("on")
|| value.equals("yes"))
Options.options &= ~(1 << i);
else if (value.equals("1")
|| value.equals("on")
|| value.equals("yes"))
Options.options |= 1 << i;
else
throw new IllegalArgumentException("Illegal value for "+
option);

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

Loading…
Cancel
Save