diff options
author | Andreas Abraham <andreas.abraham@egiz.gv.at> | 2021-09-13 14:30:27 +0200 |
---|---|---|
committer | Andreas Abraham <andreas.abraham@egiz.gv.at> | 2021-09-13 14:30:27 +0200 |
commit | f2fc62bd1d2dd0dc9660375890c28af5cbb5b00a (patch) | |
tree | 64f00ed76b43080c9f4b4727f3e864a209454640 /pdf-over-gui/src/main/java/at | |
parent | ab9a63655476c392d95fca3beff8eb59edeccc39 (diff) | |
download | pdf-over-f2fc62bd1d2dd0dc9660375890c28af5cbb5b00a.tar.gz pdf-over-f2fc62bd1d2dd0dc9660375890c28af5cbb5b00a.tar.bz2 pdf-over-f2fc62bd1d2dd0dc9660375890c28af5cbb5b00a.zip |
refactor
Diffstat (limited to 'pdf-over-gui/src/main/java/at')
77 files changed, 115 insertions, 618 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 deleted file mode 100644 index 613ff4f9..00000000 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java +++ /dev/null @@ -1,385 +0,0 @@ -/* - * Copyright 2012 by A-SIT, Secure Information Technology Center Austria - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://joinup.ec.europa.eu/software/page/eupl - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - */ -package at.asit.pdfover.gui; - -import java.io.File; -import java.io.FileInputStream; -import java.util.Locale; -import java.util.Properties; - -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.widgets.Display; - - -import at.asit.pdfover.gui.bku.mobile.MobileBKUs; - -/** - * Various constants - */ -public class Constants { - - /** Application name */ - public static final String APP_NAME = "PDF-Over"; //$NON-NLS-1$ - - /** Application version */ - public static final String APP_VERSION = Constants.class.getPackage().getImplementationVersion(); - - /** Application name + version */ - public static final String APP_NAME_VERSION = (APP_VERSION == null ? APP_NAME : APP_NAME + " v" + APP_VERSION); //$NON-NLS-1$ - - public static final String SIGNATURE_PROFILE = "SIGNATURE_PROFILE"; //$NON-NLS-1$ - public static final String DEFAULT_POSTFIX = "_signed"; - - static { - // Has to be set before (implicitly) initializing Display - Display.setAppName(APP_NAME); - } - - /** - * - */ - public static final String SIGNATURE_FIELD_NAME_CONF = "signature_field_name"; //$NON-NLS-1$ - - /** Current display - used for Colors */ - private static Display display = Display.getCurrent(); - - /** Supported locales */ - public static final Locale[] SUPPORTED_LOCALES = { Locale.GERMAN, Locale.ENGLISH }; - - /** Configuration directory */ - public static final String CONFIG_DIRECTORY = System.getProperty("user.home") + File.separator + ".pdf-over"; //$NON-NLS-1$ //$NON-NLS-2$ - - /** The default configuration file name */ - public static final String DEFAULT_CONFIG_FILENAME = "PDF-Over.config"; //$NON-NLS-1$ - - /** The default log4j file name */ - public static final String DEFAULT_LOG4J_FILENAME = "log4j.properties"; //$NON-NLS-1$ - - /** The configuration version file name */ - public static final String CONFIG_VERSION_FILENAME = ".version"; //$NON-NLS-1$ - - /** The signature placeholder cache file name */ - public static final String PLACEHOLDER_CACHE_FILENAME = ".placeholder"; //$NON-NLS-1$ - - /** The signature placeholder cache properties file name */ - public static final String PLACEHOLDER_CACHE_PROPS_FILENAME = ".placeholder.properties"; //$NON-NLS-1$ - - /** - * The minimum PDF-AS configuration version (older ones will be backed up - * and updated - */ - public static final String MIN_PDF_AS_CONFIG_VERSION = "4.2.0"; //$NON-NLS-1$ - - /** The configuration backup filename */ - public static final String PDF_AS_CONFIG_BACKUP_FILENAME = "cfg_backup"; //$NON-NLS-1$ - - /** File suffix for the signed document */ - public final static String SIGNED_SUFFIX = "_signed"; //$NON-NLS-1$ - - /** Local BKU URL */ - public static final String LOCAL_BKU_URL = "http://127.0.0.1:3495/http-security-layer-request"; //$NON-NLS-1$ - - /** Default Mobile BKU URL */ - //public static final String DEFAULT_MOBILE_BKU_URL = "https://test1.a-trust.at/mobile/https-security-layer-request/default.aspx"; - //public static final String DEFAULT_MOBILE_BKU_URL = "https://hs-abnahme.a-trust.at/mobile/https-security-layer-request/default.aspx"; //$NON-NLS-1$ - public static final String DEFAULT_MOBILE_BKU_URL = "https://www.a-trust.at/mobile/https-security-layer-request/default.aspx"; //$NON-NLS-1$ - - /** Default Mobile BKU type */ - public static final MobileBKUs DEFAULT_MOBILE_BKU_TYPE = MobileBKUs.A_TRUST; - - /** Default signature placeholder transparency */ - public static final int DEFAULT_SIGNATURE_PLACEHOLDER_TRANSPARENCY = 170; - - /** How far to displace the signature with the arrow keys */ - public static final int SIGNATURE_KEYBOARD_POSITIONING_OFFSET = 15; - - /** PDF-Over User Agent string */ - public static final String USER_AGENT_STRING = "PDF-Over " + (APP_VERSION == null ? "4.3" : APP_VERSION); //$NON-NLS-1$ //$NON-NLS-2$ - - /** Current release file */ - public static final String CURRENT_RELEASE_URL = "https://updates.a-sit.at/pdf-over/Release.txt"; //$NON-NLS-1$ - - /** Update URL */ - public static final String UPDATE_URL = "https://technology.a-sit.at/en/pdf-over/"; //$NON-NLS-1$ - - /** True */ - public static final String TRUE = "true"; //$NON-NLS-1$ - - /** False */ - public static final String FALSE = "false"; //$NON-NLS-1$ - - /* Configuration parameters */ - - /** The bku config parameter */ - public static final String CFG_BKU = "BKU"; //$NON-NLS-1$ - - /** - * The value for the Signature position in the configuration file values for - * this entry are: - * - * x=vx;y=vy;p=vp or auto - * - * vx:= float value vy:= float value vp:= integer value - */ - public static final String CFG_SIGNATURE_POSITION = "SIGNATURE_POSITION"; //$NON-NLS-1$ - - /** The use marker parameter (true/false) */ - public static final String CFG_USE_MARKER = "USE_MARKER"; //$NON-NLS-1$ - - /** The use of signature fields instead of QR codes */ - public static final String CFG_USE_SIGNATURE_FIELDS = "USE_FIELDS"; //$NON-NLS-1$ - - /** */ - public static final String CFG_ENABLE_PLACEHOLDER = "USE_PLACEHOLDER_SEARCH"; //$NON-NLS-1$ - - /** The signature placeholder transparency config parameter (0-255) */ - public static final String CFG_SIGNATURE_PLACEHOLDER_TRANSPARENCY = "SIGNATURE_PLACEHOLDER_TRANSPARENCY"; //$NON-NLS-1$ - - /** The mobile number config parameter */ - public static final String CFG_MOBILE_NUMBER = "MOBILE_NUMBER"; //$NON-NLS-1$ - - /** The signature note config parameter */ - public static final String CFG_SIGNATURE_NOTE = "SIGNATURE_NOTE"; //$NON-NLS-1$ - - /** The signature locale config parameter */ - public static final String CFG_SIGNATURE_LOCALE = "SIGNLOCALE"; //$NON-NLS-1$ - - /** The PDF/A-compatibility config parameter */ - public static final String CFG_SIGNATURE_PDFA_COMPAT = "SIGNATURE_PDFA_COMPAT"; //$NON-NLS-1$ - - /** Mobile bku url config parameter */ - public static final String CFG_MOBILE_BKU_URL = "MOBILE_BKU_URL"; //$NON-NLS-1$ - - /** Mobile bku type config parameter */ - public static final String CFG_MOBILE_BKU_TYPE = "MOBILE_BKU_TYPE"; //$NON-NLS-1$ - - /** Mobile bku BASE64 config parameter */ - public static final String CFG_MOBILE_BKU_BASE64 = "MOBILE_BKU_BASE64"; //$NON-NLS-1$ - - /** KeyStore enabled config parameter */ - public static final String CFG_KEYSTORE_ENABLED = "KEYSTORE_ENABLED"; //$NON-NLS-1$ - - /** KeyStore file config parameter */ - public static final String CFG_KEYSTORE_FILE = "KEYSTORE_FILE"; //$NON-NLS-1$ - - /** KeyStore type config parameter */ - public static final String CFG_KEYSTORE_TYPE = "KEYSTORE_TYPE"; //$NON-NLS-1$ - - /** KeyStore alias config parameter */ - public static final String CFG_KEYSTORE_ALIAS = "KEYSTORE_ALIAS"; //$NON-NLS-1$ - - /** KeyStore store password config parameter */ - public static final String CFG_KEYSTORE_STOREPASS = "KEYSTORE_STOREPASS"; //$NON-NLS-1$ - - /** KeyStore key password config parameter */ - public static final String CFG_KEYSTORE_KEYPASS = "KEYSTORE_KEYPASS"; //$NON-NLS-1$ - - /** The emblem config parameter */ - public static final String CFG_EMBLEM = "EMBLEM"; //$NON-NLS-1$ - - /** The locale config parameter */ - public static final String CFG_LOCALE = "LOCALE"; //$NON-NLS-1$ - - /** The update check config parameter */ - public static final String CFG_UPDATE_CHECK = "UPDATE_CHECK"; //$NON-NLS-1$ - - /** The proxy host config parameter */ - public static final String CFG_PROXY_HOST = "PROXY_HOST"; //$NON-NLS-1$ - - /** The proxy port config parameter */ - public static final String CFG_PROXY_PORT = "PROXY_PORT"; //$NON-NLS-1$ - - /** The proxy username config parameter */ - public static final String CFG_PROXY_USER = "PROXY_USER"; //$NON-NLS-1$ - - /** The proxy password config parameter */ - public static final String CFG_PROXY_PASS = "PROXY_PASS"; //$NON-NLS-1$ - - /** The output folder config parameter */ - public static final String CFG_OUTPUT_FOLDER = "OUTPUT_FOLDER"; //$NON-NLS-1$ - - public static final String CFG_POSTFIX = "SAVE_FILE_POSTFIX"; - - /** The main window size (Format: width,height) */ - public static final String CFG_MAINWINDOW_SIZE = "MAINWINDOW_SIZE"; //$NON-NLS-1$ - - /** The theme */ - public static final String CFG_THEME = "THEME"; //$NON-NLS-1$ - - /** Download URL for accepted Certificates*/ - public static final String CFG_DOWNLOAD_URL="DOWNLOAD_URL"; //$NON-NLS-1$ - - /* Theme constants */ - - /** The available themes */ - public static enum Themes { - /** Default theme */ DEFAULT, - /** GemPlush theme */ GEMPLUSH - }; - - /** The used theme */ - public static final Themes THEME = getTheme(); - - private static Themes getTheme() { - File f = new File(CONFIG_DIRECTORY + File.separatorChar + DEFAULT_CONFIG_FILENAME); - if (f.canRead()) { - try { - Properties config = new Properties(); - config.load(new FileInputStream(f)); - return Themes.valueOf(config.getProperty(CFG_THEME).toUpperCase()); - } catch (Exception e) { - // Ignore - } - } - return Themes.DEFAULT; - } - - /** Main window height */ - public static final int DEFAULT_MAINWINDOW_HEIGHT = 780; - - /** Main window width */ - public static final int DEFAULT_MAINWINDOW_WIDTH = 600; - - /** Main bar height */ - public static final int MAINBAR_HEIGHT = 60; - - /** Main bar active background - light start of gradient */ - public static final Color MAINBAR_ACTIVE_BACK_LIGHT = getMainbarActiveBackLight(); - private static Color getMainbarActiveBackLight() { - switch (THEME) { - default: - case DEFAULT: - return new Color(display, 0xB4, 0xCD, 0xEC); - case GEMPLUSH: - return new Color(display, 0xEC, 0xAD, 0xE7); - } - } - - /** Main bar active background - dark end of gradient */ - public static final Color MAINBAR_ACTIVE_BACK_DARK = getMainbarActiveBackDark(); - - private static Color getMainbarActiveBackDark() { - switch (THEME) { - default: - case DEFAULT: - return new Color(display, 0x6B, 0xA5, 0xD9); - case GEMPLUSH: - return new Color(display, 0xD9, 0x53, 0x9C); - } - } - - /** Main bar inactive background */ - public static final Color MAINBAR_INACTIVE_BACK = getMainbarInactiveBack(); - - private static Color getMainbarInactiveBack() { - switch (THEME) { - default: - case DEFAULT: - return new Color(display, 0xD4, 0xE7, 0xF1); - case GEMPLUSH: - return new Color(display, 0xF1, 0xD1, 0xE8); - } - } - - /** Main bar active text color */ - public static final Color MAINBAR_ACTIVE_TEXTCOLOR = new Color(display, 0x00, 0x00, 0x00); - - /** Main bar inactive text color */ - public static final Color MAINBAR_INACTIVE_TEXTCOLOR = new Color(display, 0x40, 0x40, 0x40); - - /** Drop background color */ - public static final Color DROP_BACK = new Color(display, 0xFF, 0xFF, 0xFF); - - /** Drop border color */ - public static final Color DROP_BORDER_COLOR = MAINBAR_ACTIVE_BACK_LIGHT; - - /** Normal text size */ - public static final int TEXT_SIZE_NORMAL = 12; - - /** Button text size */ - public static final int TEXT_SIZE_BUTTON = 12; - - /** Small text size */ - public static final int TEXT_SIZE_SMALL = 10; - - /** Big text size */ - public static final int TEXT_SIZE_BIG = 14; - - /* Resources */ - - /** Shell icon resource */ - public static final String RES_ICON = "/icons/icon.png"; //$NON-NLS-1$ - - /** Config image resource */ - public static final String RES_IMG_CONFIG = getResImgConfig(); - - private static String getResImgConfig() { - switch (THEME) { - default: - case DEFAULT: - return "/img/config.png"; //$NON-NLS-1$ - case GEMPLUSH: - return "/img/config_p.png"; //$NON-NLS-1$ - } - } - - /** Config inactive image resource */ - public static final String RES_IMG_CONFIG_DISABLED = "/img/config_disabled.png"; //$NON-NLS-1$ - - /** Error image resource */ - public static final String RES_IMG_ERROR = "/img/error.png"; //$NON-NLS-1$ - - /** Card image resource */ - public static final String RES_IMG_CARD = "/img/karte.png"; //$NON-NLS-1$ - - /** Mobile phone image resource */ - public static final String RES_IMG_MOBILE = "/img/handy.png"; //$NON-NLS-1$ - - /** Package resource path */ - public static String RES_PKG_PATH = "/at/asit/pdfover/gui/"; //$NON-NLS-1$ - - /** Zipped configuration resource */ - public static final String RES_CFG_ZIP = "/cfg/PDFASConfig.zip"; //$NON-NLS-1$ - - /** Accepted certificate resource path */ - public static final String RES_CERT_PATH = "/certificates/"; //$NON-NLS-1$ - - /** Accepted certificate list resource */ - public static final String RES_CERT_LIST = RES_CERT_PATH + "certificates.xml"; //$NON-NLS-1$ - - /** Accepted certificate list config */ - public static final String RES_CERT_PATH_ADDED = CONFIG_DIRECTORY + "/certificates/"; //$NON-NLS-1$ - - /** Accepted certificate list resource */ - public static final String RES_CERT_LIST_ADDED = RES_CERT_PATH_ADDED + "certificates.xml"; //$NON-NLS-1$ - - /** Download URL for accepted certificates */ - - public static final String CERTIFICATE_DOWNLOAD_XML_URL = "https://www.buergerkarte.at/trust/"; //$NON-NLS-1$ - - public static final String CERTIFICATE_XML_FILE = "certificates.xml"; //$NON-NLS-1$ - - public static final String LABEL_TAN = "input_tan"; //$NON-NLS-1$ - - public static final String LABEL_SIGN_BTN = "SignButton"; //$NON-NLS-1$ - - public static final String LABEL_PHONE_NUMBER = "handynummer"; //$NON-NLS-1$ - - public static final String LABEL_SIGN_PASS = "signaturpasswort"; //$NON-NLS-1$ - - public static final String LABEL_BTN_IDF = "Button_Identification"; //$NON-NLS-1$ - -} diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/DeveloperMain.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/DeveloperMain.java index 0e1af294..5ef6ea3c 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/DeveloperMain.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/DeveloperMain.java @@ -18,6 +18,7 @@ package at.asit.pdfover.gui; //Imports import java.io.File; +import at.asit.pdfover.commons.Constants; import org.apache.log4j.PropertyConfigurator; import org.eclipse.swt.SWT; import org.slf4j.Logger; 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 a8aceb59..b62d6cf8 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 @@ -18,15 +18,12 @@ package at.asit.pdfover.gui; //Imports import java.io.File; import java.io.IOException; -import java.net.URL; - -import javax.swing.JOptionPane; +import at.asit.pdfover.commons.Constants; import org.apache.log4j.PropertyConfigurator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import at.asit.pdfover.gui.utils.Messages; import at.asit.pdfover.gui.workflow.StateMachineImpl; /** 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 3c8caf41..c2528adc 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 @@ -23,6 +23,7 @@ import java.lang.reflect.Method; import java.util.EnumMap; import java.util.Map; +import at.asit.pdfover.commons.Constants; import org.eclipse.swt.SWT; import org.eclipse.swt.SWTError; import org.eclipse.swt.custom.StackLayout; @@ -56,7 +57,7 @@ import at.asit.pdfover.gui.controls.MainBarMiddleButton; import at.asit.pdfover.gui.controls.MainBarRectangleButton; import at.asit.pdfover.gui.controls.MainBarStartButton; import at.asit.pdfover.gui.osx.CocoaUIEnhancer; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; import at.asit.pdfover.gui.utils.SWTLoader; import at.asit.pdfover.gui.workflow.StateMachine; import at.asit.pdfover.gui.workflow.states.BKUSelectionState; diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/PlaceholderSelectionGui.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/PlaceholderSelectionGui.java index 16b8cf59..01c585d0 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/PlaceholderSelectionGui.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/PlaceholderSelectionGui.java @@ -21,7 +21,7 @@ import org.eclipse.swt.widgets.Shell; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Dialog; @@ -32,7 +32,6 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.widgets.Text; import org.eclipse.swt.widgets.Label; diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/BKUHelper.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/BKUHelper.java index 82d6f07d..b9edc3c0 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/BKUHelper.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/BKUHelper.java @@ -23,7 +23,7 @@ import org.apache.http.client.config.CookieSpecs; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import at.asit.pdfover.gui.Constants; +import at.asit.pdfover.commons.Constants; /** * diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/LocalBKUConnector.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/LocalBKUConnector.java index 1c88499a..bd5f1423 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/LocalBKUConnector.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/LocalBKUConnector.java @@ -31,7 +31,7 @@ import org.apache.commons.httpclient.methods.multipart.StringPart; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import at.asit.pdfover.gui.Constants;
+import at.asit.pdfover.commons.Constants;
import at.asit.pdfover.gui.utils.FileUploadSource;
import at.asit.pdfover.signator.BkuSlConnector;
import at.asit.pdfover.signator.SLRequest;
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java index ef7cc81d..946b55ef 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java @@ -40,12 +40,12 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
-import at.asit.pdfover.gui.Constants;
+import at.asit.pdfover.commons.Constants;
import at.asit.pdfover.gui.controls.Dialog;
import at.asit.pdfover.gui.controls.Dialog.BUTTONS;
import at.asit.pdfover.gui.controls.Dialog.ICON;
import at.asit.pdfover.gui.exceptions.ATrustConnectionException;
-import at.asit.pdfover.gui.utils.Messages;
+import at.asit.pdfover.commons.Messages;
import at.asit.pdfover.gui.workflow.states.MobileBKUState;
import at.asit.pdfover.signator.SLResponse;
import at.asit.pdfover.signator.SignatureException;
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/IAIKHandler.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/IAIKHandler.java index 2595de44..1d0ec579 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/IAIKHandler.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/IAIKHandler.java @@ -33,7 +33,7 @@ import org.slf4j.LoggerFactory; import at.asit.pdfover.gui.controls.Dialog;
import at.asit.pdfover.gui.controls.Dialog.BUTTONS;
import at.asit.pdfover.gui.controls.Dialog.ICON;
-import at.asit.pdfover.gui.utils.Messages;
+import at.asit.pdfover.commons.Messages;
import at.asit.pdfover.gui.workflow.states.MobileBKUState;
import at.asit.pdfover.signator.SLResponse;
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/SimpleXMLTrustManager.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/SimpleXMLTrustManager.java index 9e166e89..039f2ecf 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/SimpleXMLTrustManager.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/SimpleXMLTrustManager.java @@ -34,7 +34,7 @@ import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import at.asit.pdfover.gui.Constants; +import at.asit.pdfover.commons.Constants; /** * diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/TrustedSocketFactory.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/TrustedSocketFactory.java index 4fa71703..7b465b25 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/TrustedSocketFactory.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/TrustedSocketFactory.java @@ -36,7 +36,7 @@ import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/Argument.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/Argument.java index a052d91e..1b7aca28 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/Argument.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/Argument.java @@ -16,7 +16,7 @@ package at.asit.pdfover.gui.cliarguments; import at.asit.pdfover.gui.exceptions.InitializationException; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; import at.asit.pdfover.gui.workflow.StateMachine; import at.asit.pdfover.gui.workflow.Status; import at.asit.pdfover.gui.workflow.config.ConfigOverlayManipulator; diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/BKUArgument.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/BKUArgument.java index 058d84cf..646d361d 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/BKUArgument.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/BKUArgument.java @@ -16,7 +16,7 @@ package at.asit.pdfover.gui.cliarguments; import at.asit.pdfover.gui.exceptions.InitializationException; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; import at.asit.pdfover.signator.BKUs; /** diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/ConfigFileArgument.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/ConfigFileArgument.java index 0f73143d..e14782ae 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/ConfigFileArgument.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/ConfigFileArgument.java @@ -20,7 +20,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import at.asit.pdfover.gui.exceptions.InitializationException; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * CLI Argument to set the configuration file diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/EmblemArgument.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/EmblemArgument.java index 96b3690b..31d11fc6 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/EmblemArgument.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/EmblemArgument.java @@ -23,7 +23,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import at.asit.pdfover.gui.exceptions.InitializationException; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * CLI Argument to set the emblem file to use for signature diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/HelpArgument.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/HelpArgument.java index 77d95ae9..4296bb3a 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/HelpArgument.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/HelpArgument.java @@ -20,7 +20,7 @@ import java.util.Iterator; import java.util.Set; import at.asit.pdfover.gui.exceptions.InitializationException; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * CLI Argument to show the useage message diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/InputDocumentArgument.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/InputDocumentArgument.java index 37c0c81c..756effb2 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/InputDocumentArgument.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/InputDocumentArgument.java @@ -23,7 +23,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import at.asit.pdfover.gui.exceptions.InitializationException; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * CLI Argument to set the input document to sign diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/InvisibleProfile.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/InvisibleProfile.java index 4bb3890f..af819470 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/InvisibleProfile.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/InvisibleProfile.java @@ -16,14 +16,12 @@ package at.asit.pdfover.gui.cliarguments; // Imports -import java.io.File; -import java.io.FileNotFoundException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import at.asit.pdfover.gui.exceptions.InitializationException; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; import at.asit.pdfover.signer.pdfas.PdfAs4SignatureParameter; /** diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/KeystoreAliasArgument.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/KeystoreAliasArgument.java index 3673ce0b..3874f4ef 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/KeystoreAliasArgument.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/KeystoreAliasArgument.java @@ -20,7 +20,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import at.asit.pdfover.gui.exceptions.InitializationException; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * CLI Argument to provide the keystore alias diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/KeystoreFileArgument.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/KeystoreFileArgument.java index 04aa1756..66ebe286 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/KeystoreFileArgument.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/KeystoreFileArgument.java @@ -23,7 +23,7 @@ import org.slf4j.LoggerFactory; import at.asit.pdfover.gui.exceptions.InitializationException; import at.asit.pdfover.gui.exceptions.KeystoreDoesntExistException; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * CLI Argument to provide the keystore file diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/KeystoreKeyPassArgument.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/KeystoreKeyPassArgument.java index 54dcba1c..ca3fd5e8 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/KeystoreKeyPassArgument.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/KeystoreKeyPassArgument.java @@ -20,7 +20,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import at.asit.pdfover.gui.exceptions.InitializationException; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * CLI Argument to provide the keystore key password diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/KeystoreStorePassArgument.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/KeystoreStorePassArgument.java index 2519b59a..f7b8e116 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/KeystoreStorePassArgument.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/KeystoreStorePassArgument.java @@ -20,7 +20,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import at.asit.pdfover.gui.exceptions.InitializationException; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * CLI Argument to provide the keystore password diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/KeystoreTypeArgument.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/KeystoreTypeArgument.java index 6e900c95..47d1972b 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/KeystoreTypeArgument.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/KeystoreTypeArgument.java @@ -20,7 +20,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import at.asit.pdfover.gui.exceptions.InitializationException; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * CLI Argument to provide the keystore type diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/OutputFolderArgument.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/OutputFolderArgument.java index 7bce81c1..ad9c3520 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/OutputFolderArgument.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/OutputFolderArgument.java @@ -20,7 +20,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import at.asit.pdfover.gui.exceptions.InitializationException; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * CLI Argument to show the usage message diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/PasswordArgument.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/PasswordArgument.java index a6442395..60c4c3bc 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/PasswordArgument.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/PasswordArgument.java @@ -21,7 +21,7 @@ import org.slf4j.LoggerFactory; import at.asit.pdfover.gui.bku.mobile.MobileBKUHelper; import at.asit.pdfover.gui.exceptions.InitializationException; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * CLI Argument to provide Mobile BKU password diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/PhoneNumberArgument.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/PhoneNumberArgument.java index c7f23e02..6f49e6ce 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/PhoneNumberArgument.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/PhoneNumberArgument.java @@ -21,7 +21,7 @@ import org.slf4j.LoggerFactory; import at.asit.pdfover.gui.bku.mobile.MobileBKUHelper; import at.asit.pdfover.gui.exceptions.InitializationException; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * CLI Argument to provide Mobile BKU phone number to use diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/ProxyHostArgument.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/ProxyHostArgument.java index 779d6cee..924bacda 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/ProxyHostArgument.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/ProxyHostArgument.java @@ -20,7 +20,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import at.asit.pdfover.gui.exceptions.InitializationException; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * CLI Argument to provide the proxy host diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/ProxyPassArgument.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/ProxyPassArgument.java index 46368554..3640b1d1 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/ProxyPassArgument.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/ProxyPassArgument.java @@ -20,7 +20,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import at.asit.pdfover.gui.exceptions.InitializationException; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * CLI Argument to provide the proxy password diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/ProxyPortArgument.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/ProxyPortArgument.java index 5f5db33a..808c1352 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/ProxyPortArgument.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/ProxyPortArgument.java @@ -21,7 +21,7 @@ import org.slf4j.LoggerFactory; import at.asit.pdfover.gui.exceptions.InitializationException; import at.asit.pdfover.gui.exceptions.InvalidPortException; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * CLI Argument to provide the proxy port diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/ProxyUserArgument.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/ProxyUserArgument.java index d7802fea..8e636186 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/ProxyUserArgument.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/ProxyUserArgument.java @@ -20,7 +20,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import at.asit.pdfover.gui.exceptions.InitializationException; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * CLI Argument to provide the proxy username diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java index 2bb4d06b..afa4d648 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java @@ -45,7 +45,7 @@ import org.eclipse.swt.widgets.Text; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import at.asit.pdfover.gui.Constants; +import at.asit.pdfover.commons.Constants; import at.asit.pdfover.commons.Profile; import at.asit.pdfover.gui.controls.ErrorDialog; import at.asit.pdfover.gui.controls.ErrorMarker; @@ -53,7 +53,7 @@ import at.asit.pdfover.gui.controls.Dialog.BUTTONS; import at.asit.pdfover.gui.exceptions.InvalidPortException; import at.asit.pdfover.gui.exceptions.OutputfolderDoesntExistException; import at.asit.pdfover.gui.exceptions.OutputfolderNotADirectoryException; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; import at.asit.pdfover.gui.workflow.config.ConfigManipulator; import at.asit.pdfover.gui.workflow.config.ConfigurationContainer; import at.asit.pdfover.gui.workflow.config.PersistentConfigProvider; diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BKUSelectionComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BKUSelectionComposite.java index c386c49b..c3a466c1 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BKUSelectionComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BKUSelectionComposite.java @@ -33,9 +33,9 @@ import org.eclipse.swt.widgets.Display; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import at.asit.pdfover.gui.Constants; +import at.asit.pdfover.commons.Constants; import at.asit.pdfover.gui.controls.ClickableCanvas; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; import at.asit.pdfover.gui.workflow.states.State; import at.asit.pdfover.signator.BKUs; 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 b4626d0c..14ac14a9 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 @@ -36,11 +36,11 @@ import org.eclipse.swt.widgets.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import at.asit.pdfover.gui.Constants; +import at.asit.pdfover.commons.Constants; import at.asit.pdfover.gui.controls.Dialog.BUTTONS; import at.asit.pdfover.gui.controls.ErrorDialog; import at.asit.pdfover.gui.exceptions.ResumableException; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; import at.asit.pdfover.gui.workflow.PDFSigner; import at.asit.pdfover.gui.workflow.config.ConfigManipulator; import at.asit.pdfover.gui.workflow.config.ConfigurationContainer; 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 83a92a7b..51b8441c 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 @@ -44,8 +44,8 @@ import org.eclipse.swt.widgets.Label; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import at.asit.pdfover.gui.Constants; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Constants; +import at.asit.pdfover.commons.Messages; import at.asit.pdfover.gui.workflow.states.State; /** diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/KeystoreConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/KeystoreConfigurationComposite.java index 7970e145..299e389c 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/KeystoreConfigurationComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/KeystoreConfigurationComposite.java @@ -48,7 +48,7 @@ import org.eclipse.swt.widgets.Text; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import at.asit.pdfover.gui.Constants; +import at.asit.pdfover.commons.Constants; import at.asit.pdfover.gui.controls.Dialog.BUTTONS; import at.asit.pdfover.gui.controls.ErrorDialog; import at.asit.pdfover.gui.exceptions.CantLoadKeystoreException; @@ -56,7 +56,7 @@ import at.asit.pdfover.gui.exceptions.KeystoreAliasDoesntExistException; import at.asit.pdfover.gui.exceptions.KeystoreAliasNoKeyException; import at.asit.pdfover.gui.exceptions.KeystoreDoesntExistException; import at.asit.pdfover.gui.exceptions.KeystoreKeyPasswordException; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; import at.asit.pdfover.gui.workflow.config.ConfigManipulator; import at.asit.pdfover.gui.workflow.config.ConfigurationContainer; import at.asit.pdfover.gui.workflow.config.PersistentConfigProvider; diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java index e290528e..0e6da9ff 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java @@ -17,8 +17,6 @@ package at.asit.pdfover.gui.composites; // Imports
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
@@ -35,11 +33,10 @@ import org.eclipse.swt.widgets.Text; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import at.asit.pdfover.gui.Constants;
+import at.asit.pdfover.commons.Constants;
import at.asit.pdfover.gui.bku.mobile.MobileBKUHelper;
-import at.asit.pdfover.gui.exceptions.InvalidNumberException;
import at.asit.pdfover.gui.exceptions.InvalidPasswordException;
-import at.asit.pdfover.gui.utils.Messages;
+import at.asit.pdfover.commons.Messages;
import at.asit.pdfover.gui.workflow.states.State;
/**
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java index d34f89dc..8120d269 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java @@ -43,8 +43,8 @@ import org.eclipse.swt.widgets.Text; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import at.asit.pdfover.gui.Constants;
-import at.asit.pdfover.gui.utils.Messages;
+import at.asit.pdfover.commons.Constants;
+import at.asit.pdfover.commons.Messages;
import at.asit.pdfover.gui.workflow.states.State;
/**
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUFingerprintComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUFingerprintComposite.java index eb4771ba..7d477f62 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUFingerprintComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUFingerprintComposite.java @@ -38,8 +38,8 @@ import org.eclipse.swt.widgets.Link; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import at.asit.pdfover.gui.Constants;
-import at.asit.pdfover.gui.utils.Messages;
+import at.asit.pdfover.commons.Constants;
+import at.asit.pdfover.commons.Messages;
import at.asit.pdfover.gui.workflow.states.State;
/**
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUQRComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUQRComposite.java index 81b2b31c..0303ae09 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUQRComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUQRComposite.java @@ -40,8 +40,8 @@ import org.eclipse.swt.widgets.Link; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import at.asit.pdfover.gui.Constants;
-import at.asit.pdfover.gui.utils.Messages;
+import at.asit.pdfover.commons.Constants;
+import at.asit.pdfover.commons.Messages;
import at.asit.pdfover.gui.workflow.states.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 31bf6f93..69bf66aa 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 @@ -41,12 +41,12 @@ import org.eclipse.swt.widgets.Link; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import at.asit.pdfover.gui.Constants; +import at.asit.pdfover.commons.Constants; import at.asit.pdfover.gui.controls.Dialog; import at.asit.pdfover.gui.controls.Dialog.BUTTONS; import at.asit.pdfover.gui.controls.Dialog.ICON; import at.asit.pdfover.gui.controls.ErrorDialog; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; import at.asit.pdfover.gui.workflow.states.State; import at.asit.pdfover.signator.DocumentSource; 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 0a5e566e..09b310fe 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 @@ -42,8 +42,8 @@ import org.eclipse.swt.widgets.ScrollBar; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import at.asit.pdfover.gui.Constants; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Constants; +import at.asit.pdfover.commons.Messages; import at.asit.pdfover.gui.workflow.states.State; import at.asit.pdfover.signator.SignaturePosition; diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java index 575c8f86..34dd6c5e 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java @@ -35,8 +35,8 @@ import javax.swing.JPanel; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import at.asit.pdfover.gui.Constants;
-import at.asit.pdfover.gui.utils.Messages;
+import at.asit.pdfover.commons.Constants;
+import at.asit.pdfover.commons.Messages;
import com.sun.pdfview.PDFFile;
import com.sun.pdfview.PDFPage;
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java index 05efd217..2ec6d80c 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java @@ -21,7 +21,6 @@ import java.io.IOException; import java.util.Locale; import javax.imageio.ImageIO; -import javax.swing.*; import at.asit.pdfover.signator.SignaturePosition; import org.eclipse.swt.SWT; @@ -60,7 +59,7 @@ import org.eclipse.swt.widgets.Text; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import at.asit.pdfover.gui.Constants; +import at.asit.pdfover.commons.Constants; import at.asit.pdfover.commons.Profile; import at.asit.pdfover.gui.controls.Dialog.BUTTONS; import at.asit.pdfover.gui.controls.ErrorDialog; @@ -68,8 +67,7 @@ import at.asit.pdfover.gui.controls.ErrorMarker; import at.asit.pdfover.gui.exceptions.InvalidEmblemFile; import at.asit.pdfover.gui.exceptions.InvalidNumberException; import at.asit.pdfover.gui.utils.ImageConverter; -import at.asit.pdfover.gui.utils.Messages; -import at.asit.pdfover.gui.utils.SignaturePlaceholderCache; +import at.asit.pdfover.commons.Messages; import at.asit.pdfover.gui.workflow.config.ConfigManipulator; import at.asit.pdfover.gui.workflow.config.ConfigurationContainer; import at.asit.pdfover.gui.workflow.config.PersistentConfigProvider; @@ -776,6 +774,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { return true; } + //TODO FIX ME String getSignatureBlockNoteTextAccordingToProfile(Profile profile, Locale locale){ if (profile.equals(Profile.SIGNATURBLOCK_SMALL)){ 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 71d6acf2..deecb09d 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 @@ -24,7 +24,7 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.ProgressBar; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; import at.asit.pdfover.gui.workflow.states.State; /** diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/WaitingForAppComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/WaitingForAppComposite.java index 921c6c8b..310a38e9 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/WaitingForAppComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/WaitingForAppComposite.java @@ -24,7 +24,7 @@ import org.eclipse.swt.layout.FormLayout; import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.ProgressBar;
-import at.asit.pdfover.gui.utils.Messages;
+import at.asit.pdfover.commons.Messages;
import at.asit.pdfover.gui.workflow.states.State;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.events.SelectionAdapter;
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorDialog.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorDialog.java index 91100355..f6863b4f 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorDialog.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorDialog.java @@ -18,7 +18,7 @@ package at.asit.pdfover.gui.controls; // Imports import org.eclipse.swt.widgets.Shell; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * An error dialog diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorMarker.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorMarker.java index 9e2579a3..0b5ca4b9 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorMarker.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorMarker.java @@ -28,7 +28,7 @@ import org.eclipse.swt.widgets.Label; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import at.asit.pdfover.gui.Constants; +import at.asit.pdfover.commons.Constants; /** * diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/InputDialog.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/InputDialog.java index 88cf9e87..3822bbd7 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/InputDialog.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/InputDialog.java @@ -28,7 +28,7 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java index 484f5e28..e03b427d 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java @@ -30,7 +30,7 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; -import at.asit.pdfover.gui.Constants; +import at.asit.pdfover.commons.Constants; /** * Main Bar Button implementation diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/ATrustConnectionException.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/ATrustConnectionException.java index ae350bf2..29f08e49 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/ATrustConnectionException.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/ATrustConnectionException.java @@ -16,9 +16,8 @@ package at.asit.pdfover.gui.exceptions; // Imports -import java.io.File; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/CantLoadKeystoreException.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/CantLoadKeystoreException.java index cb13c804..dd924118 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/CantLoadKeystoreException.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/CantLoadKeystoreException.java @@ -15,7 +15,7 @@ */ package at.asit.pdfover.gui.exceptions; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidEmblemFile.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidEmblemFile.java index 006778b3..e5f2a9de 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidEmblemFile.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidEmblemFile.java @@ -18,7 +18,7 @@ package at.asit.pdfover.gui.exceptions; // Imports import java.io.File; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidPortException.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidPortException.java index a6861d38..695d477a 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidPortException.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidPortException.java @@ -15,7 +15,7 @@ */ package at.asit.pdfover.gui.exceptions; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/KeystoreAliasDoesntExistException.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/KeystoreAliasDoesntExistException.java index 45db46e6..61cf968f 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/KeystoreAliasDoesntExistException.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/KeystoreAliasDoesntExistException.java @@ -15,7 +15,7 @@ */ package at.asit.pdfover.gui.exceptions; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/KeystoreAliasNoKeyException.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/KeystoreAliasNoKeyException.java index 535945cb..8ea41f56 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/KeystoreAliasNoKeyException.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/KeystoreAliasNoKeyException.java @@ -15,7 +15,7 @@ */ package at.asit.pdfover.gui.exceptions; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/KeystoreDoesntExistException.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/KeystoreDoesntExistException.java index 7578d1c3..ebe8dd7f 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/KeystoreDoesntExistException.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/KeystoreDoesntExistException.java @@ -17,7 +17,7 @@ package at.asit.pdfover.gui.exceptions; import java.io.File; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/KeystoreKeyPasswordException.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/KeystoreKeyPasswordException.java index a63e00c0..4dd20ef2 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/KeystoreKeyPasswordException.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/KeystoreKeyPasswordException.java @@ -15,7 +15,7 @@ */ package at.asit.pdfover.gui.exceptions; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/OutputfolderDoesntExistException.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/OutputfolderDoesntExistException.java index 021d3da8..c82a82bf 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/OutputfolderDoesntExistException.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/OutputfolderDoesntExistException.java @@ -17,7 +17,7 @@ package at.asit.pdfover.gui.exceptions; import java.io.File; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/OutputfolderNotADirectoryException.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/OutputfolderNotADirectoryException.java index f2053c84..cfa884a0 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/OutputfolderNotADirectoryException.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/OutputfolderNotADirectoryException.java @@ -19,7 +19,7 @@ package at.asit.pdfover.gui.exceptions; import java.io.File; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; /** * diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/PasswordTooLongException.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/PasswordTooLongException.java index 61074a33..d915b6da 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/PasswordTooLongException.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/PasswordTooLongException.java @@ -15,7 +15,7 @@ */ package at.asit.pdfover.gui.exceptions; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; // Imports diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/PasswordTooShortException.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/PasswordTooShortException.java index 71b9f55c..ab073484 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/PasswordTooShortException.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/PasswordTooShortException.java @@ -15,7 +15,7 @@ */ package at.asit.pdfover.gui.exceptions; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; // Imports diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/osx/CocoaUIEnhancer.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/osx/CocoaUIEnhancer.java index d6076272..78aaa777 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/osx/CocoaUIEnhancer.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/osx/CocoaUIEnhancer.java @@ -25,8 +25,8 @@ import org.eclipse.swt.internal.Callback; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Listener; -import at.asit.pdfover.gui.Constants; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Constants; +import at.asit.pdfover.commons.Messages; /** * Provide a hook to connecting the Preferences, About and Quit menu items of diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/CertificateDownloadSource.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/CertificateDownloadSource.java index 6ce5b176..34b8cb53 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/CertificateDownloadSource.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/CertificateDownloadSource.java @@ -34,14 +34,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.xml.sax.SAXException; -import at.asit.pdfover.gui.Constants; -import at.asit.pdfover.gui.exceptions.InitializationException; -import at.asit.pdfover.gui.utils.Messages; -import at.asit.pdfover.gui.utils.SWTLoader; -import at.asit.pdfover.gui.workflow.StateMachineImpl; +import at.asit.pdfover.commons.Constants; import at.asit.pdfover.gui.workflow.config.ConfigProvider; -import at.asit.pdfover.gui.workflow.config.ConfigProviderImpl; -import at.gv.egiz.sl.schema.ToBeEncryptedType.Element; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilder; @@ -50,13 +44,11 @@ import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import org.w3c.dom.Attr; + import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import java.io.File; - /** * Download of accepted certificates */ diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/Messages.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/Messages.java deleted file mode 100644 index c48337e6..00000000 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/Messages.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2012 by A-SIT, Secure Information Technology Center Austria - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://joinup.ec.europa.eu/software/page/eupl - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - */ -package at.asit.pdfover.gui.utils; - -// Imports -import java.util.HashMap; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import at.asit.pdfover.gui.Constants; - -/** - * Localizes string messages for PDFOver GUI - */ -public class Messages { - - /** - * SLF4J Logger instance - **/ - static final Logger log = LoggerFactory.getLogger(Messages.class); - - private static final String BUNDLE_NAME = "at.asit.pdfover.gui.messages"; //$NON-NLS-1$ - - private static HashMap<Locale, ResourceBundle> bundles = new HashMap<>(); - - private static Locale currentLocale = getDefaultLocale(); - - private Messages() { - } - - /** - * Get the closest match to the system default Locale out of the supported locales - * @return the default locale - */ - public static Locale getDefaultLocale() { - Locale ld = Locale.getDefault(); - for (Locale l : Constants.SUPPORTED_LOCALES) { - if (l.equals(ld) || l.getLanguage().equals(ld.getLanguage())) - return l; - } - return Constants.SUPPORTED_LOCALES[0]; - } - - /** - * Sets the currently used locals - * @param locale - */ - public static void setLocale(Locale locale) { - currentLocale = locale; - } - - private static ResourceBundle getBundle(Locale locale) { - if(!bundles.containsKey(locale)) { - log.debug("Loading resource bundle for {}", locale); //$NON-NLS-1$ - ResourceBundle tmp = null; - try { - tmp = ResourceBundle.getBundle(BUNDLE_NAME, locale); - log.debug("Received bundle for {}", tmp.getLocale()); //$NON-NLS-1$ - } catch(Exception e) { - log.error("NO RESOURCE BUNDLE FOR {} {}", locale, e); //$NON-NLS-1$ - tmp = ResourceBundle.getBundle(BUNDLE_NAME); - } - if(tmp == null) { - log.error("NO RESOURCE BUNDLE FOR {}", locale); //$NON-NLS-1$ - tmp = ResourceBundle.getBundle(BUNDLE_NAME); - } - bundles.put(locale, tmp); - return tmp; - } - return bundles.get(locale); - } - - /** - * Gets the localized message - * @param key - * @return the localized message - */ - public static String getString(String key) { - try { - return getBundle(currentLocale).getString(key); - } catch (MissingResourceException e) { - return '!' + key + '!'; - } - } - - /** - * Gets the localized message - * @param key the key - * @param locale the locale to use - * @return the localized message - */ - public static String getString(String key, Locale locale) { - try { - return getBundle(locale).getString(key); - } catch (MissingResourceException e) { - return '!' + key + '!'; - } - } -} diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SignaturePlaceholderCache.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SignaturePlaceholderCache.java index 6ef2d909..44e72725 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SignaturePlaceholderCache.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SignaturePlaceholderCache.java @@ -33,7 +33,7 @@ import org.eclipse.swt.graphics.ImageData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import at.asit.pdfover.gui.Constants; +import at.asit.pdfover.commons.Constants; import at.asit.pdfover.signator.CachedFileNameEmblem; import at.asit.pdfover.signator.Emblem; import at.asit.pdfover.signator.SignatureParameter; 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 8a6e3c92..45005d20 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 @@ -28,7 +28,7 @@ import at.asit.pdfover.gui.MainWindow; import at.asit.pdfover.gui.controls.Dialog.BUTTONS; import at.asit.pdfover.gui.controls.ErrorDialog; import at.asit.pdfover.gui.utils.CertificateDownloadSource; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; import at.asit.pdfover.gui.workflow.config.ConfigManipulator; import at.asit.pdfover.gui.workflow.config.ConfigOverlayManipulator; import at.asit.pdfover.gui.workflow.config.ConfigProvider; diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProviderImpl.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProviderImpl.java index 036154ab..86d86e4b 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProviderImpl.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProviderImpl.java @@ -30,13 +30,13 @@ import org.eclipse.swt.graphics.Point; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import at.asit.pdfover.gui.Constants; +import at.asit.pdfover.commons.Constants; import at.asit.pdfover.gui.bku.mobile.MobileBKUs; import at.asit.pdfover.gui.exceptions.InvalidEmblemFile; import at.asit.pdfover.gui.exceptions.InvalidNumberException; import at.asit.pdfover.gui.exceptions.InvalidPortException; import at.asit.pdfover.gui.utils.LocaleSerializer; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; import at.asit.pdfover.signator.BKUs; import at.asit.pdfover.signator.SignaturePosition; diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainerImpl.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainerImpl.java index 47094aa7..46b5c460 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainerImpl.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainerImpl.java @@ -28,13 +28,13 @@ import org.eclipse.swt.widgets.Display; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import at.asit.pdfover.gui.Constants; +import at.asit.pdfover.commons.Constants; import at.asit.pdfover.gui.bku.mobile.MobileBKUHelper; import at.asit.pdfover.gui.bku.mobile.MobileBKUs; import at.asit.pdfover.gui.exceptions.InvalidEmblemFile; import at.asit.pdfover.gui.exceptions.InvalidNumberException; import at.asit.pdfover.gui.exceptions.InvalidPortException; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; import at.asit.pdfover.signator.BKUs; import at.asit.pdfover.signator.SignaturePosition; diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/KSState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/KSState.java index 2e5c0d75..c2a5f039 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/KSState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/KSState.java @@ -27,7 +27,7 @@ import at.asit.pdfover.gui.MainWindowBehavior; import at.asit.pdfover.gui.controls.Dialog.BUTTONS; import at.asit.pdfover.gui.controls.ErrorDialog; import at.asit.pdfover.gui.controls.PasswordInputDialog; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; import at.asit.pdfover.gui.workflow.StateMachine; import at.asit.pdfover.gui.workflow.Status; import at.asit.pdfover.gui.workflow.config.ConfigProvider; diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java index b229b58a..c0baabbf 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java @@ -25,14 +25,14 @@ import org.eclipse.swt.SWT; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import at.asit.pdfover.gui.Constants; +import at.asit.pdfover.commons.Constants; import at.asit.pdfover.gui.MainWindow.Buttons; import at.asit.pdfover.gui.MainWindowBehavior; import at.asit.pdfover.gui.bku.BKUHelper; import at.asit.pdfover.gui.bku.LocalBKUConnector; 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.commons.Messages; import at.asit.pdfover.gui.workflow.StateMachine; import at.asit.pdfover.gui.workflow.Status; import at.asit.pdfover.signator.SLResponse; diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java index e224ce78..ebd434f7 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java @@ -15,11 +15,9 @@ */
package at.asit.pdfover.gui.workflow.states;
-import java.io.IOException;
import java.io.InputStream;
import java.util.Timer;
import java.util.TimerTask;
-import java.util.concurrent.TimeoutException;
// Imports
import at.asit.pdfover.gui.exceptions.ATrustConnectionException;
@@ -46,7 +44,7 @@ import at.asit.pdfover.gui.composites.WaitingComposite; import at.asit.pdfover.gui.composites.WaitingForAppComposite;
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.commons.Messages;
import at.asit.pdfover.gui.workflow.StateMachine;
import at.asit.pdfover.gui.workflow.config.ConfigProvider;
import at.asit.pdfover.signator.SigningState;
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java index 89ca3ef9..9c2dc847 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java @@ -32,12 +32,12 @@ import org.eclipse.swt.widgets.MessageBox; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import at.asit.pdfover.gui.Constants; +import at.asit.pdfover.commons.Constants; import at.asit.pdfover.gui.MainWindow.Buttons; import at.asit.pdfover.gui.MainWindowBehavior; import at.asit.pdfover.gui.PlaceholderSelectionGui; import at.asit.pdfover.gui.composites.DataSourceSelectComposite; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; import at.asit.pdfover.gui.workflow.StateMachine; import at.asit.pdfover.gui.workflow.Status; import at.asit.pdfover.gui.workflow.config.ConfigProvider; diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OutputState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OutputState.java index 3b3c2098..d20d5268 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OutputState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OutputState.java @@ -25,7 +25,7 @@ import at.asit.pdfover.gui.MainWindowBehavior; import at.asit.pdfover.gui.composites.OutputComposite; import at.asit.pdfover.gui.controls.ErrorDialog; import at.asit.pdfover.gui.controls.Dialog.BUTTONS; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; import at.asit.pdfover.gui.workflow.StateMachine; import at.asit.pdfover.gui.workflow.Status; import at.asit.pdfover.gui.workflow.config.ConfigProvider; diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java index 4d73c068..401f2cd9 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java @@ -31,7 +31,7 @@ import at.asit.pdfover.gui.MainWindowBehavior; import at.asit.pdfover.gui.composites.PositioningComposite; 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.commons.Messages; import at.asit.pdfover.gui.utils.SignaturePlaceholderCache; import at.asit.pdfover.gui.workflow.StateMachine; import at.asit.pdfover.gui.workflow.Status; 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 8e4e2d13..2ce4a5a0 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 @@ -31,6 +31,7 @@ import java.io.OutputStream; import java.net.URI; import java.util.Locale; +import at.asit.pdfover.commons.Profile; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.log4j.PropertyConfigurator; @@ -39,7 +40,7 @@ import org.eclipse.swt.program.Program; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import at.asit.pdfover.gui.Constants; +import at.asit.pdfover.commons.Constants; import at.asit.pdfover.gui.bku.BKUHelper; import at.asit.pdfover.gui.cliarguments.*; import at.asit.pdfover.gui.controls.Dialog; @@ -47,7 +48,7 @@ import at.asit.pdfover.gui.controls.Dialog.BUTTONS; import at.asit.pdfover.gui.controls.Dialog.ICON; import at.asit.pdfover.gui.controls.ErrorDialog; import at.asit.pdfover.gui.exceptions.InitializationException; -import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.commons.Messages; import at.asit.pdfover.gui.utils.VersionComparator; import at.asit.pdfover.gui.utils.Zipper; import at.asit.pdfover.gui.workflow.GUIProvider; @@ -152,11 +153,27 @@ public class PrepareConfigurationState extends State { String note_old = Messages.getString("simple_config.Note_Default_Old", loc); //$NON-NLS-1$ if (note.equals(note_old)) { + String profileNote = getDefaultNote(config); + note = Messages.getString("simple_config.Note_Default", loc); //$NON-NLS-1$ getStateMachine().getConfigManipulator().setSignatureNote(note); } } + private String getDefaultNote(ConfigProvider config){ + + Profile profile = Profile.getProfile(config.getSignatureProfile()); + Locale locale = config.getLocale(); + + if (profile.equals(Profile.SIGNATURBLOCK_SMALL)){ + return Messages.getString("simple_config.Note_Default_Standard", locale); + } else if (profile.equals(Profile.AMTSSIGNATURBLOCK)){ + return Messages.getString("simple_config.Note_Default_OfficialSignature", locale); + } else { + return ""; + } + } + private void initializeFromArguments(String[] args, ArgumentHandler handler) throws InitializationException { handler.handleArguments(args); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java index 9d17a3e8..38049be0 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java @@ -28,7 +28,7 @@ import at.asit.pdfover.gui.MainWindowBehavior; import at.asit.pdfover.gui.composites.WaitingComposite; 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.commons.Messages; import at.asit.pdfover.gui.workflow.StateMachine; import at.asit.pdfover.gui.workflow.Status; import at.asit.pdfover.gui.workflow.config.ConfigProvider; diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/SigningState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/SigningState.java index a4c84f91..e6884fb6 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/SigningState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/SigningState.java @@ -26,7 +26,7 @@ import at.asit.pdfover.gui.MainWindowBehavior; import at.asit.pdfover.gui.MainWindow.Buttons; 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.commons.Messages; import at.asit.pdfover.gui.workflow.StateMachine; import at.asit.pdfover.gui.workflow.Status; import at.asit.pdfover.signator.SignatureException; |