summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at/asit/pdfover/gui
diff options
context:
space:
mode:
authortkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2014-01-27 17:59:46 +0000
committertkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2014-01-27 17:59:46 +0000
commit161af59764d0e4df632ace57c6de9d02ae7d3e5d (patch)
tree62df24fe1f648e77ce79dd74a26210756bfca3fe /pdf-over-gui/src/main/java/at/asit/pdfover/gui
parent66ebe9d3cf72e89ed308d8100dda8dbb83da7628 (diff)
downloadmocca-161af59764d0e4df632ace57c6de9d02ae7d3e5d.tar.gz
mocca-161af59764d0e4df632ace57c6de9d02ae7d3e5d.tar.bz2
mocca-161af59764d0e4df632ace57c6de9d02ae7d3e5d.zip
Make application name a constant
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@479 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java7
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/Main.java6
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java4
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java2
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StateMachineImpl.java3
5 files changed, 14 insertions, 8 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java
index d95fd000..a9492f0e 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java
@@ -30,6 +30,13 @@ import at.asit.pdfover.gui.workflow.states.mobilebku.MobileBKUs;
*/
public class Constants {
+ /** Application name */
+ public static final String APP_NAME = "PDF-Over"; //$NON-NLS-1$
+
+ static {
+ // Has to be set before (implicitly) initializing Display
+ Display.setAppName(APP_NAME);
+ }
/** Current display - used for Colors */
private static Display display = Display.getCurrent();
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Main.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Main.java
index 03b0bfeb..78e22fbb 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Main.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Main.java
@@ -57,13 +57,13 @@ public class Main {
File configDir = new File(Constants.CONFIG_DIRECTORY);
if(!configDir.exists()) {
configDir.mkdir();
- }
-
+ }
+
File log4j = new File(configDir.getAbsolutePath() + File.separator + Constants.DEFAULT_LOG4J_FILENAME);
if(log4j.exists()) {
PropertyConfigurator.configureAndWatch(log4j.getAbsolutePath());
}
-
+
StateMachineImpl stateMachine = new StateMachineImpl(args);
log.debug("Starting stateMachine ..."); //$NON-NLS-1$
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java
index a243a717..e847fd0c 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java
@@ -168,7 +168,6 @@ public class MainWindow {
* Reload the localization
*/
public void reloadLocalization() {
- getShell().setText(Messages.getString("main.title")); //$NON-NLS-1$
this.btn_config.setText(Messages.getString("main.configuration")); //$NON-NLS-1$
this.btn_config.setToolTipText(Messages.getString("main.configuration")); //$NON-NLS-1$
this.btn_open.setText(Messages.getString("common.open")); //$NON-NLS-1$
@@ -229,7 +228,8 @@ public class MainWindow {
catch (SWTError e) {
log.debug("Cannot get display", e); //$NON-NLS-1$
}
- getShell().setText(Messages.getString("main.title")); //$NON-NLS-1$
+ Display.setAppVersion(this.getClass().getPackage().getImplementationVersion());
+ getShell().setText(Constants.APP_NAME);
getShell().addShellListener(new ShellAdapter() {
@Override
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java
index b4b519f1..0b2bbb05 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java
@@ -181,7 +181,7 @@ public class ConfigurationComposite extends StateComposite {
String version = getClass().getPackage().getImplementationVersion();
version = (version == null ? "" : " v" + version); //$NON-NLS-1$ //$NON-NLS-2$
- getShell().setText(Messages.getString("main.title") + version); //$NON-NLS-1$
+ getShell().setText(Constants.APP_NAME + version);
this.doLayout();
}
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 324e9a30..d4c391b5 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
@@ -25,8 +25,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import at.asit.pdfover.gui.MainWindow;
-import at.asit.pdfover.gui.controls.ErrorDialog;
import at.asit.pdfover.gui.controls.Dialog.BUTTONS;
+import at.asit.pdfover.gui.controls.ErrorDialog;
import at.asit.pdfover.gui.utils.Messages;
import at.asit.pdfover.gui.workflow.config.ConfigManipulator;
import at.asit.pdfover.gui.workflow.config.ConfigOverlayManipulator;
@@ -172,7 +172,6 @@ public class StateMachineImpl implements StateMachine, GUIProvider {
this.display = Display.getDefault();
this.mainWindow = new MainWindow(this);
-
this.mainWindow.open();
this.shell = this.mainWindow.getShell();