summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites
diff options
context:
space:
mode:
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/DataSourceSelectComposite.java34
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ErrorComposite.java20
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java20
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java13
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/StateComposite.java2
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/WaitingComposite.java17
6 files changed, 46 insertions, 60 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java
index 44b2574b..b68ffa03 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java
@@ -18,13 +18,15 @@ package at.asit.pdfover.gui.composites;
// Imports
import java.io.File;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DropTarget;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.dnd.DropTargetListener;
+import org.eclipse.swt.dnd.FileTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
@@ -32,12 +34,14 @@ import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.*;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
-import at.asit.pdfover.gui.workflow.StateMachineImpl;
import at.asit.pdfover.gui.workflow.states.State;
/**
@@ -60,7 +64,7 @@ public class DataSourceSelectComposite extends StateComposite {
@Override
public void widgetSelected(SelectionEvent e) {
FileDialog dialog = new FileDialog(DataSourceSelectComposite.this.getShell(), SWT.OPEN);
- dialog.setFilterExtensions(new String[] {"*.pdf"});
+ dialog.setFilterExtensions(new String[] {"*.pdf"}); //$NON-NLS-1$
dialog.setFilterNames(new String[] {"PDF Dateien"});
String fileName = dialog.open();
File file = null;
@@ -81,7 +85,7 @@ public class DataSourceSelectComposite extends StateComposite {
/**
* SFL4J Logger instance
**/
- private static final Logger log = LoggerFactory
+ static final Logger log = LoggerFactory
.getLogger(DataSourceSelectComposite.class);
/**
@@ -155,7 +159,7 @@ public class DataSourceSelectComposite extends StateComposite {
File file = new File(files[0]);
if(!file.exists())
{
- log.error("File: " + files[0] + " doesnot exists!");
+ log.error("File: " + files[0] + " does not exist!");
return;
}
DataSourceSelectComposite.this.setSelected(file);
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ErrorComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ErrorComposite.java
index 6963c6f6..38b0f877 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ErrorComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ErrorComposite.java
@@ -25,8 +25,7 @@ import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
import at.asit.pdfover.gui.workflow.states.State;
/**
@@ -37,6 +36,12 @@ public class ErrorComposite extends StateComposite {
*
*/
private final class OkSelectionListener implements SelectionListener {
+ /**
+ *
+ */
+ public OkSelectionListener() {
+ }
+
@Override
public void widgetSelected(SelectionEvent e) {
ErrorComposite.this.userOk = true;
@@ -49,20 +54,14 @@ public class ErrorComposite extends StateComposite {
}
}
- /**
- * SLF4J Logger instance
- **/
- private static final Logger log = LoggerFactory
- .getLogger(ErrorComposite.class);
-
boolean userOk = false;
/**
* Checks if the user has clicked OK
- * @return
+ * @return whether the user has clicked OK
*/
public boolean isUserOk() {
- return userOk;
+ return this.userOk;
}
private Exception exception;
@@ -80,6 +79,7 @@ public class ErrorComposite extends StateComposite {
* Create the composite.
* @param parent
* @param style
+ * @param state
*/
public ErrorComposite(Composite parent, int style, State state) {
super(parent, style, state);
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java
index 860cd095..6c79ed01 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java
@@ -17,7 +17,6 @@ package at.asit.pdfover.gui.composites;
// Imports
import java.awt.Desktop;
-import org.eclipse.swt.widgets.FileDialog;
import java.io.File;
import java.io.FileOutputStream;
@@ -29,6 +28,7 @@ import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.FileDialog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -39,9 +39,15 @@ import at.asit.pdfover.signator.DocumentSource;
* GUI component for Output State
*/
public class OutputComposite extends StateComposite {
-
+
/**
- * Selection Listner for save button
+ * SLF4J Logger instance
+ **/
+ static final Logger log = LoggerFactory
+ .getLogger(OutputComposite.class);
+
+ /**
+ * SelectionListener for save button
*/
private final class SaveSelectionListener implements SelectionListener {
@@ -56,7 +62,7 @@ public class OutputComposite extends StateComposite {
public void widgetSelected(SelectionEvent e) {
try {
FileDialog save = new FileDialog(OutputComposite.this.getShell(), SWT.SAVE | SWT.NATIVE);
- save.setFilterExtensions(new String[] {"*.pdf"});
+ save.setFilterExtensions(new String[] {"*.pdf"}); //$NON-NLS-1$
save.setFilterNames(new String[] {"PDF Dateien"});
String target = save.open();
@@ -132,12 +138,6 @@ public class OutputComposite extends StateComposite {
}
}
- /**
- * SLF4J Logger instance
- **/
- private static final Logger log = LoggerFactory
- .getLogger(OutputComposite.class);
-
File savedFile = null;
private DocumentSource signedDocument;
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 d641af62..e101d281 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
@@ -22,8 +22,6 @@ import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import at.asit.pdfover.gui.workflow.states.State;
import at.asit.pdfover.signator.SignaturePosition;
@@ -59,17 +57,11 @@ public class PositioningComposite extends StateComposite {
}
}
- /**
- * SFL4J Logger instance
- **/
- private static final Logger log = LoggerFactory
- .getLogger(PositioningComposite.class);
-
private SignaturePosition position = null;
/**
- * Gets the Position
- * @return
+ * Gets the position of the signature
+ * @return the SignaturePosition
*/
public SignaturePosition getPosition() {
return this.position;
@@ -87,6 +79,7 @@ public class PositioningComposite extends StateComposite {
* Create the composite.
* @param parent
* @param style
+ * @param state
*/
public PositioningComposite(Composite parent, int style, State state) {
super(parent, style, state);
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/StateComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/StateComposite.java
index 0b21e3aa..dcc82394 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/StateComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/StateComposite.java
@@ -17,8 +17,6 @@ package at.asit.pdfover.gui.composites;
// Imports
import org.eclipse.swt.widgets.Composite;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import at.asit.pdfover.gui.workflow.states.State;
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/WaitingComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/WaitingComposite.java
index 4101e924..1b609dc9 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/WaitingComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/WaitingComposite.java
@@ -16,16 +16,13 @@
package at.asit.pdfover.gui.composites;
// Imports
-import org.eclipse.swt.widgets.Composite;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.eclipse.swt.widgets.ProgressBar;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.ProgressBar;
-import at.asit.pdfover.gui.workflow.StateMachineImpl;
import at.asit.pdfover.gui.workflow.states.State;
/**
@@ -33,12 +30,6 @@ import at.asit.pdfover.gui.workflow.states.State;
*/
public class WaitingComposite extends StateComposite {
/**
- * SLF4J Logger instance
- **/
- private static final Logger log = LoggerFactory
- .getLogger(WaitingComposite.class);
-
- /**
* Create the composite.
* @param parent
* @param style