summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.settings/org.eclipse.jdt.core.prefs11
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StateMachineImpl.java33
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java6
-rw-r--r--pdf-over-signer/pdf-over-sigpdfas3/.classpath6
4 files changed, 36 insertions, 20 deletions
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
index 8b7c3b59..a73cd2a8 100644
--- a/.settings/org.eclipse.jdt.core.prefs
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -1,6 +1,15 @@
eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=9
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
@@ -9,6 +18,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
@@ -82,6 +92,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL,LOW
org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX,NOTE
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StateMachineImpl.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StateMachineImpl.java
index 6af68b78..8a6e3c92 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StateMachineImpl.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StateMachineImpl.java
@@ -15,12 +15,8 @@
*/
package at.asit.pdfover.gui.workflow;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
//Imports
import java.lang.reflect.Constructor;
-import java.nio.file.Files;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
@@ -28,7 +24,6 @@ import org.eclipse.swt.widgets.Shell;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import at.asit.pdfover.gui.Constants;
import at.asit.pdfover.gui.MainWindow;
import at.asit.pdfover.gui.controls.Dialog.BUTTONS;
import at.asit.pdfover.gui.controls.ErrorDialog;
@@ -176,17 +171,27 @@ public class StateMachineImpl implements StateMachine, GUIProvider {
}
private void createMainWindow() {
- this.display = Display.getDefault();
+ try {
+
+ this.display = Display.getDefault();
- this.mainWindow = new MainWindow(this);
- this.mainWindow.open();
+ this.mainWindow = new MainWindow(this);
+ this.mainWindow.open();
- this.shell = this.mainWindow.getShell();
+ this.shell = this.mainWindow.getShell();
- this.container = this.mainWindow.getContainer();
+ this.container = this.mainWindow.getContainer();
- this.shell.open();
- this.shell.layout();
+ this.shell.open();
+ this.shell.layout();
+ } catch (Exception e) {
+ log.warn("Main-Window creation FAILED. Reason: " + e.getMessage()); //$NON-NLS-1$
+ this.display = null;
+ this.mainWindow = null;
+ this.shell = null;
+ this.container = null;
+ throw e;
+ }
}
/**
@@ -194,7 +199,7 @@ public class StateMachineImpl implements StateMachine, GUIProvider {
*
* @return Composite
*/
- public Composite getComposite() {
+ public synchronized Composite getComposite() {
// Main window will be built on first call
// returns SWT Composite container for states to draw their GUI
@@ -375,7 +380,7 @@ public class StateMachineImpl implements StateMachine, GUIProvider {
* @see at.asit.pdfover.gui.workflow.GUIProvider#getMainShell()
*/
@Override
- public Shell getMainShell() {
+ public synchronized Shell getMainShell() {
if(this.shell == null) {
this.createMainWindow();
}
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java
index 640f61da..8e4e2d13 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java
@@ -465,7 +465,11 @@ public class PrepareConfigurationState extends State {
final String version = method.getResponseBodyAsString().trim();
if (!VersionComparator.before(Constants.APP_VERSION, version))
return;
-
+
+ // wait 500ms before invoke the GUI message, because GUI had to be started from
+ // main thread
+ try {Thread.sleep(500); } catch (InterruptedException e1) { }
+ // invoke GUI message in main thread
gui.getMainShell().getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
diff --git a/pdf-over-signer/pdf-over-sigpdfas3/.classpath b/pdf-over-signer/pdf-over-sigpdfas3/.classpath
index eed8a51e..8f5c07ea 100644
--- a/pdf-over-signer/pdf-over-sigpdfas3/.classpath
+++ b/pdf-over-signer/pdf-over-sigpdfas3/.classpath
@@ -22,10 +22,6 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>