patch so DocumentPrinter.java can be removed
authortony mancill <tmancill@debian.org>
Wed, 13 Jan 2010 07:11:08 +0000 (07:11 -0000)
committertony mancill <tmancill@debian.org>
Wed, 13 Jan 2010 07:11:08 +0000 (07:11 -0000)
debian/changelog
debian/patches/07_PreviewPanel.patch [new file with mode: 0644]
debian/patches/series

index 63eac0c..e9901ec 100644 (file)
@@ -18,7 +18,10 @@ jabref (2.6~beta2+ds-1) UNRELEASED; urgency=low
   * debian/copyright: update formatting and list of third-party copyright
     holders. 
 
   * debian/copyright: update formatting and list of third-party copyright
     holders. 
 
- -- gregor herrmann <gregoa@debian.org>  Wed, 30 Dec 2009 20:56:57 +0100
+  [ tony mancill ]
+  * Add PreviewPanel patch to remove dependency on DocumentPrinter class.
+
+ -- tony mancill <tmancill@debian.org>  Tue, 12 Jan 2010 23:06:19 -0800
 
 jabref (2.6~beta2-1) unstable; urgency=low
 
 
 jabref (2.6~beta2-1) unstable; urgency=low
 
diff --git a/debian/patches/07_PreviewPanel.patch b/debian/patches/07_PreviewPanel.patch
new file mode 100644 (file)
index 0000000..4c7255d
--- /dev/null
@@ -0,0 +1,46 @@
+Author: tony mancill <tmancill@debian.org>
+Description: remove dependency on DocumentPrinter.java (requires Java 1.5 or later)
+--- a/src/java/net/sf/jabref/PreviewPanel.java
++++ b/src/java/net/sf/jabref/PreviewPanel.java
+@@ -9,6 +9,9 @@
+ import java.io.IOException;
+ import java.io.StringReader;
++import javax.print.attribute.HashPrintRequestAttributeSet;
++import javax.print.attribute.PrintRequestAttributeSet;
++import javax.print.attribute.standard.JobName;
+ import javax.swing.*;
+ import javax.swing.event.HyperlinkEvent;
+ import javax.swing.event.HyperlinkListener;
+@@ -16,7 +19,6 @@
+ import net.sf.jabref.export.layout.Layout;
+ import net.sf.jabref.export.layout.LayoutHelper;
+ import net.sf.jabref.export.ExportFormats;
+-import net.sf.jabref.util.DocumentPrinter;
+ /**
+  * Displays an BibtexEntry using the given layout format.
+@@ -116,17 +118,18 @@
+                       putValue(SHORT_DESCRIPTION, Globals.lang("Print Preview"));
+               }
+-              DocumentPrinter printerService;
++              //DocumentPrinter printerService;
+               public void actionPerformed(ActionEvent arg0) {
+-                      if (printerService == null)
+-                              printerService = new DocumentPrinter();
+-
++
+                       // Background this, as it takes a while.
+                       new Thread() {
+                               public void run() {
+                                       try {
+-                                              printerService.print(entry.getCiteKey(), previewPane);
++                                              PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
++                                              pras.add(new JobName(entry.getCiteKey(), null));
++                                              previewPane.print(null, null, true, null, pras, false);
++
+                                       } catch (PrinterException e) {
+                                               // Inform the user... we don't know what to do.
index 69a2066..31aa14a 100644 (file)
@@ -3,3 +3,4 @@
 03_external_apps.patch
 05_antlr.patch
 06_BibtexEntry.patch
 03_external_apps.patch
 05_antlr.patch
 06_BibtexEntry.patch
+07_PreviewPanel.patch