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("off")
|| value.equals("no")) || value.equals("no"))
Options.options &= ~(1 << i); Options.options &= ~(1 << i);
else if (value.equals("1") else if (value.equals("1")
|| value.equals("on") || value.equals("on")
|| value.equals("yes")) || value.equals("yes"))
Options.options &= ~(1 << i); Options.options |= 1 << i;
else else
throw new IllegalArgumentException("Illegal value for "+ throw new IllegalArgumentException("Illegal value for "+
option); option);

@ -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

Loading…
Cancel
Save