better classpath handling

tabbedprintwriter is now buffered


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@961 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent c880423ef9
commit 31043993ef
  1. 15
      jode/jode/swingui/Main.java

@ -21,6 +21,7 @@ package jode.swingui;
import jode.GlobalOptions;
import jode.decompiler.*;
import jode.bytecode.ClassInfo;
import jode.bytecode.SearchPath;
///#ifndef OLDSWING
import javax.swing.*;
import javax.swing.event.*;
@ -87,7 +88,7 @@ public class MainWindow
rightPane.setDividerSize(4);
allPane.setDividerLocation(200);
allPane.setDividerSize(4);
GlobalOptions.err = new PrintWriter(new AreaWriter(errorArea));
GlobalOptions.err = new PrintWriter(new AreaWriter(errorArea), true);
}
public synchronized void valueChanged(TreeSelectionEvent e) {
@ -181,13 +182,18 @@ public class MainWindow
imports.init(lastClassName);
ClassAnalyzer clazzAna = new ClassAnalyzer(null, clazz, imports);
clazzAna.analyze();
clazzAna.analyzeInnerClasses();
clazzAna.makeDeclaration();
sourcecodeArea.setText("");
TabbedPrintWriter writer =
new TabbedPrintWriter(new AreaWriter(sourcecodeArea), imports);
new TabbedPrintWriter
(new BufferedWriter
(new AreaWriter(sourcecodeArea), 1024), imports);
imports.dumpHeader(writer);
clazzAna.dumpSource(writer);
writer.close();
// saveButton.setEnabled(true);
} catch (Throwable t) {
@ -261,15 +267,16 @@ public class MainWindow
}
public static void main(String[] params) {
String cp = System.getProperty("java.class.path");
String cp = System.getProperty("java.class.path", "");
cp = cp.replace(File.pathSeparatorChar, SearchPath.pathSeparatorChar);
for (int i=0; i<params.length; i++) {
if (params[i].equals("--cp"))
cp = params[++i];
else
return;
}
GlobalOptions.verboseLevel = 1;
MainWindow win = new MainWindow(cp);
win.show();
}
}

Loading…
Cancel
Save