summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites
diff options
context:
space:
mode:
authortkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 18:55:44 +0000
committertkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 18:55:44 +0000
commit77fcccbfb250f8b762302a62bfe5b2b4870f8a6f (patch)
treec23b47552ccf716a7bf5d6ec8eb54d6c2244fe6c /pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites
parent1fc53f8c97a55349c39e6e931f981a7572ae59ac (diff)
downloadpdf-over-77fcccbfb250f8b762302a62bfe5b2b4870f8a6f.tar.gz
pdf-over-77fcccbfb250f8b762302a62bfe5b2b4870f8a6f.tar.bz2
pdf-over-77fcccbfb250f8b762302a62bfe5b2b4870f8a6f.zip
Display PDF Document
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@43 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java39
1 files changed, 28 insertions, 11 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java
index da18bb49..559c6b26 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java
@@ -16,12 +16,17 @@
package at.asit.pdfover.gui.composites;
// Imports
+import java.io.File;
+import java.io.IOException;
+
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
+import org.icepdf.core.exceptions.PDFException;
+import org.icepdf.core.exceptions.PDFSecurityException;
import at.asit.pdfover.gui.workflow.states.State;
import at.asit.pdfover.signator.SignaturePosition;
@@ -32,6 +37,22 @@ import at.asit.pdfover.signator.SignaturePosition;
*/
public class PositioningComposite extends StateComposite {
+ private PDFViewerComposite viewer = null;
+
+ /**
+ * Set the PDF Document to display
+ * @param document document to display
+ * @throws PDFException Error parsing PDF document
+ * @throws PDFSecurityException Error decrypting PDF document (not supported)
+ * @throws IOException I/O Error
+ */
+ public void displayDocument(File document) throws PDFException, PDFSecurityException, IOException {
+ if (this.viewer == null)
+ this.viewer = new PDFViewerComposite(this, SWT.EMBEDDED | SWT.NO_BACKGROUND, document);
+ else
+ this.viewer.setDocument(document);
+ }
+
/**
* Selection listener when position was fixed
*/
@@ -76,16 +97,12 @@ public class PositioningComposite extends StateComposite {
*/
public PositioningComposite(Composite parent, int style, State state) {
super(parent, style, state);
-
-
- Label test = new Label(this, SWT.NATIVE);
- test.setBounds(10, 20, 100, 30);
- test.setText("POSITIONING ---- TODO!!");
-
- Button btn_position = new Button(this, SWT.NATIVE | SWT.RESIZE);
- btn_position.setBounds(10, 50, 100, 30);
- btn_position.setText("FAKE Position");
- btn_position.addSelectionListener(new PositionSelectedListener());
+ this.setLayout(new FillLayout());
+
+// Button btn_position = new Button(this, SWT.NATIVE | SWT.RESIZE);
+// btn_position.setBounds(10, 50, 100, 30);
+// btn_position.setText("FAKE Position");
+// btn_position.addSelectionListener(new PositionSelectedListener());
}
@Override