Improve code exporter

master
skylarmt 9 years ago
parent 762413338c
commit e5ba578e09

@ -173,12 +173,12 @@ public class CodeExport extends javax.swing.JInternalFrame {
} }
private String getOutput() { private String getOutput() {
return "<pre>" return "<p><b>Output:</b></p><pre class=\"plaintxt\">"
+ outputTxt.replace("<", "&lt;"). + outputTxt.replace("<", "&lt;").
replace("&", "&amp;"). replace("&", "&amp;").
replace(">", "&gt;"). replace(">", "&gt;").
replace("\"", "''") replace("\"", "''")
+ "</pre>"; + "\n\n</pre>";
} }
/** /**
@ -390,6 +390,7 @@ public class CodeExport extends javax.swing.JInternalFrame {
}//GEN-LAST:event_exPdfActionPerformed }//GEN-LAST:event_exPdfActionPerformed
private void doSave(String format) { private void doSave(String format) {
html = genHtml(origCode);
JFileChooser fc = new JFileChooser(); JFileChooser fc = new JFileChooser();
FileFilter filter; FileFilter filter;
switch (format) { switch (format) {
@ -454,13 +455,6 @@ public class CodeExport extends javax.swing.JInternalFrame {
JOptionPane.showInternalMessageDialog(this, "Export complete!"); JOptionPane.showInternalMessageDialog(this, "Export complete!");
} }
private String addSaveExt(String path, String format) {
if (!path.matches(".*\\.(" + format + ")")) {
path += "." + format;
}
return path;
}
// Variables declaration - do not modify//GEN-BEGIN:variables // Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JTextField authBox; private javax.swing.JTextField authBox;
private javax.swing.JTextField dateBox; private javax.swing.JTextField dateBox;

Loading…
Cancel
Save