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

Loading…
Cancel
Save