use clazzAna.dumpJavaFile

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@757 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent fa4a253ee8
commit 28a90a13fb
  1. 18
      jode/jode/JodeWindow.java

@ -201,6 +201,7 @@ public class JodeWindow
} }
public class AreaOutputStream extends OutputStream { public class AreaOutputStream extends OutputStream {
boolean initialized = false;
private TextArea area; private TextArea area;
public AreaOutputStream(TextArea a) { public AreaOutputStream(TextArea a) {
@ -208,6 +209,10 @@ public class JodeWindow
} }
public void write(int b) throws IOException { public void write(int b) throws IOException {
if (!initialized) {
area.setText("");
initialized = true;
}
///#ifdef AWT10 ///#ifdef AWT10
/// area.appendText(String.valueOf((char)b)); /// area.appendText(String.valueOf((char)b));
///#else ///#else
@ -216,6 +221,10 @@ public class JodeWindow
} }
public void write(byte[] b, int off, int len) throws IOException { public void write(byte[] b, int off, int len) throws IOException {
if (!initialized) {
area.setText("");
initialized = true;
}
///#ifdef AWT10 ///#ifdef AWT10
/// area.appendText(new String(b, off, len)); /// area.appendText(new String(b, off, len));
///#else ///#else
@ -255,17 +264,12 @@ public class JodeWindow
+"and without .class ending"); +"and without .class ending");
return; return;
} }
imports.init(lastClassName);
ClassAnalyzer clazzAna = new ClassAnalyzer(null, clazz, imports);
clazzAna.analyze();
sourcecodeArea.setText("");
TabbedPrintWriter writer = TabbedPrintWriter writer =
new TabbedPrintWriter(new AreaOutputStream(sourcecodeArea) new TabbedPrintWriter(new AreaOutputStream(sourcecodeArea)
, imports); , imports);
imports.dumpHeader(writer); ClassAnalyzer clazzAna = new ClassAnalyzer(null, clazz, imports);
clazzAna.dumpSource(writer); clazzAna.dumpJavaFile(writer);
///#ifdef AWT10 ///#ifdef AWT10
/// saveButton.enable(); /// saveButton.enable();

Loading…
Cancel
Save