From e4767bccc7324d4b61a334bf6c0558d0080045e2 Mon Sep 17 00:00:00 2001 From: Jakob Heher Date: Wed, 6 Jul 2022 12:33:33 +0200 Subject: remove NON-NLS comments, cleanup whitespace --- .../at/asit/pdfover/gui/workflow/GUIProvider.java | 6 +- .../at/asit/pdfover/gui/workflow/PDFSigner.java | 6 +- .../asit/pdfover/gui/workflow/PDFSignerImpl.java | 6 +- .../at/asit/pdfover/gui/workflow/StateMachine.java | 20 +-- .../pdfover/gui/workflow/StateMachineImpl.java | 40 +++--- .../java/at/asit/pdfover/gui/workflow/Status.java | 14 +- .../at/asit/pdfover/gui/workflow/StatusImpl.java | 26 ++-- .../gui/workflow/config/ConfigManipulator.java | 14 +- .../workflow/config/ConfigOverlayManipulator.java | 8 +- .../gui/workflow/config/ConfigProvider.java | 70 +++++----- .../gui/workflow/config/ConfigProviderImpl.java | 146 ++++++++++----------- .../workflow/config/ConfigurationContainer.java | 40 +++--- .../config/ConfigurationContainerImpl.java | 48 +++---- .../workflow/config/PersistentConfigProvider.java | 16 +-- .../gui/workflow/states/BKUSelectionState.java | 10 +- .../gui/workflow/states/ConfigurationUIState.java | 10 +- .../asit/pdfover/gui/workflow/states/KSState.java | 22 ++-- .../pdfover/gui/workflow/states/LocalBKUState.java | 36 ++--- .../gui/workflow/states/MobileBKUState.java | 70 +++++----- .../pdfover/gui/workflow/states/OpenState.java | 26 ++-- .../pdfover/gui/workflow/states/OutputState.java | 20 +-- .../gui/workflow/states/PositioningState.java | 26 ++-- .../workflow/states/PrepareConfigurationState.java | 108 +++++++-------- .../gui/workflow/states/PrepareSigningState.java | 36 ++--- .../pdfover/gui/workflow/states/SigningState.java | 24 ++-- .../at/asit/pdfover/gui/workflow/states/State.java | 10 +- 26 files changed, 429 insertions(+), 429 deletions(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/GUIProvider.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/GUIProvider.java index f18b4ef1..a332d844 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/GUIProvider.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/GUIProvider.java @@ -22,7 +22,7 @@ import at.asit.pdfover.gui.workflow.states.State; /** - * + * */ public interface GUIProvider { /** @@ -39,13 +39,13 @@ public interface GUIProvider { * @param composite the composite */ public void display(final Composite composite); - + /** * Gets the main window shell * @return the main window shell */ public Shell getMainShell(); - + /** * Reloads the resources on active gui components */ diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/PDFSigner.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/PDFSigner.java index 33e8c176..9d174302 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/PDFSigner.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/PDFSigner.java @@ -20,7 +20,7 @@ import at.asit.pdfover.signator.Signator; import at.asit.pdfover.signator.Signer; /** - * + * */ public interface PDFSigner { /** @@ -28,13 +28,13 @@ public interface PDFSigner { * @return the signer type */ public Signator.Signers getUsedPDFSignerLibrary(); - + /** * Set PDF Signer Type * @param signer the signer type */ public void setUsedPDFSignerLibrary(Signator.Signers signer); - + /** * Gets the currently used PDF Signer * @return the pdf signer diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/PDFSignerImpl.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/PDFSignerImpl.java index 9750a0b1..c858f46d 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/PDFSignerImpl.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/PDFSignerImpl.java @@ -24,7 +24,7 @@ import at.asit.pdfover.signator.Signator.Signers; import at.asit.pdfover.signator.Signer; /** - * + * */ public class PDFSignerImpl implements PDFSigner { /** @@ -35,7 +35,7 @@ public class PDFSignerImpl implements PDFSigner { .getLogger(PDFSignerImpl.class); private Signers signer = Signator.Signers.PDFAS4; - + /* (non-Javadoc) * @see at.asit.pdfover.gui.workflow.PDFSigner#getPDFSignerType() */ @@ -57,7 +57,7 @@ public class PDFSignerImpl implements PDFSigner { } private Signer signerLib; - + /* (non-Javadoc) * @see at.asit.pdfover.gui.workflow.PDFSigner#getPDFSigner() */ diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StateMachine.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StateMachine.java index 6075ffee..85539eb5 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StateMachine.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StateMachine.java @@ -22,7 +22,7 @@ import at.asit.pdfover.gui.workflow.config.PersistentConfigProvider; import at.asit.pdfover.gui.workflow.states.State; /** - * + * */ public interface StateMachine { /** @@ -54,29 +54,29 @@ public interface StateMachine { * @return the PDF Signer */ public PDFSigner getPDFSigner(); - + /** * Get the Status * @return the Status */ public Status getStatus(); - + /** * Gets the GUI provider * @return the GUI provider */ public GUIProvider getGUIProvider(); - + /** * Jump to specific state - * + * * Sets the state machine state this method should be used to let the user jump * around between states. This Method also resets certain properties defined * by later states then the target state. - * + * * Example: Usually the MainWindow allows the user to jump to the states: * DataSourceSelectionState, PositioningState and BKUSelectionState - * + * * @param state the state to jump to */ public void jumpToState(State state); @@ -86,7 +86,7 @@ public interface StateMachine { * Calls the next state. */ public void update(); - + /** * Update state machine from other thread * Calls the next state within the main thread @@ -97,10 +97,10 @@ public interface StateMachine { * Exit state machine execution */ public void exit(); - + /** * Gets the command line arguments - * + * * @return the command line arguments */ public String[] getCmdArgs(); 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 990e6c31..a48c0e5e 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 @@ -56,7 +56,7 @@ public class StateMachineImpl implements StateMachine, GUIProvider { /** * Default constructor - * + * * @param cmdLineArgs */ public StateMachineImpl(String[] cmdLineArgs) { @@ -72,7 +72,7 @@ public class StateMachineImpl implements StateMachine, GUIProvider { * This method should be used to let the user jump * around between states. This Method also resets certain properties defined * by later states then state - * + * * @param state */ @Override @@ -92,9 +92,9 @@ public class StateMachineImpl implements StateMachine, GUIProvider { try { current.run(); } catch (Exception e) { - log.error("StateMachine update: ", e); //$NON-NLS-1$ - ErrorDialog errorState = new ErrorDialog(this.getMainShell(), - Messages.getString("error.Unexpected"), BUTTONS.OK); //$NON-NLS-1$ + log.error("StateMachine update: ", e); // + ErrorDialog errorState = new ErrorDialog(this.getMainShell(), + Messages.getString("error.Unexpected"), BUTTONS.OK); // //errorState.setException(e); //jumpToState(errorState); errorState.open(); @@ -109,7 +109,7 @@ public class StateMachineImpl implements StateMachine, GUIProvider { if (this.mainWindow != null && !this.mainWindow.getShell().isDisposed()) { - log.debug("Allowing MainWindow to update its state for " //$NON-NLS-1$ + log.debug("Allowing MainWindow to update its state for " // + current); current.updateMainWindowBehavior(); this.mainWindow.applyBehavior(); @@ -121,13 +121,13 @@ public class StateMachineImpl implements StateMachine, GUIProvider { } if (next == null) { - log.info("Next state is null -> exit"); //$NON-NLS-1$ + log.info("Next state is null -> exit"); // this.status.setCurrentState(next); break; } - log.debug("Changing state from: " //$NON-NLS-1$ - + current + " to " //$NON-NLS-1$ + log.debug("Changing state from: " // + + current + " to " // + next.toString()); this.status.setCurrentState(next); } @@ -159,7 +159,7 @@ public class StateMachineImpl implements StateMachine, GUIProvider { /* * (non-Javadoc) - * + * * @see * at.asit.pdfover.gui.workflow.StateMachine#display(org.eclipse.swt.widgets * .Composite) @@ -184,7 +184,7 @@ public class StateMachineImpl implements StateMachine, GUIProvider { this.shell.open(); this.shell.layout(); } catch (Exception e) { - log.warn("Main-Window creation FAILED. Reason: " + e.getMessage()); //$NON-NLS-1$ + log.warn("Main-Window creation FAILED. Reason: " + e.getMessage()); // this.display = null; this.mainWindow = null; this.shell = null; @@ -195,7 +195,7 @@ public class StateMachineImpl implements StateMachine, GUIProvider { /** * Gets the Shell for drawing the ui - * + * * @return Composite */ public synchronized Composite getComposite() { @@ -217,7 +217,7 @@ public class StateMachineImpl implements StateMachine, GUIProvider { Composite.class, int.class, State.class); composite = constructor.newInstance(getComposite(), style, state); } catch (Exception e) { - log.error("Could not create Composite for Class " //$NON-NLS-1$ + log.error("Could not create Composite for Class " // + compositeClass.getName(), e); } return composite; @@ -225,7 +225,7 @@ public class StateMachineImpl implements StateMachine, GUIProvider { /** * Only returns a shell if one was already created ... - * + * * @return */ private Shell nonCreatingGetShell() { @@ -247,7 +247,7 @@ public class StateMachineImpl implements StateMachine, GUIProvider { /** * Only returns a shell if one was already created ... - * + * * @return */ private Display nonCreatingGetDisplay() { @@ -258,9 +258,9 @@ public class StateMachineImpl implements StateMachine, GUIProvider { * Workflow main entrance point */ public void start() { - + // Call update to start processing ... - update(); + update(); // if a user interaction is required we have a shell ... Shell shell = nonCreatingGetShell(); @@ -352,7 +352,7 @@ public class StateMachineImpl implements StateMachine, GUIProvider { /** * sets the command line arguments - * + * * @param cmdLineArgs */ private void setCmdLineArgs(String[] cmdLineArgs) { @@ -361,7 +361,7 @@ public class StateMachineImpl implements StateMachine, GUIProvider { /** * Gets the command line arguments - * + * * @return the command line arguments */ @Override @@ -377,7 +377,7 @@ public class StateMachineImpl implements StateMachine, GUIProvider { if(this.shell == null) { this.createMainWindow(); } - + return this.shell; } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/Status.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/Status.java index f5b078ed..177b2f39 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/Status.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/Status.java @@ -45,7 +45,7 @@ public interface Status { * @param position the position */ public void setSignaturePosition(SignaturePosition position); - + /** * Gets the signature position * @return the signature position @@ -57,13 +57,13 @@ public interface Status { * @param bku the selected BKU */ public void setBKU(BKUs bku); - + /** * Gets the selected BKU * @return the selected BKU */ public BKUs getBKU(); - + /** * Gets the current state * @return the current state @@ -81,25 +81,25 @@ public interface Status { * @return the previous State */ public State getPreviousState(); - + /** * Gets the signing state * @return the signing state */ public SigningState getSigningState(); - + /** * Sets the signing state * @param state the signing state */ public void setSigningState(SigningState state); - + /** * Sets the sign result * @param signResult */ public void setSignResult(SignResult signResult); - + /** * Gets the sign Result * @return the sign result diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StatusImpl.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StatusImpl.java index 7cc94c62..2faf8b73 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StatusImpl.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/StatusImpl.java @@ -29,7 +29,7 @@ import at.asit.pdfover.signator.SignaturePosition; import at.asit.pdfover.signator.SigningState; /** - * + * */ public class StatusImpl implements Status { /** @@ -38,19 +38,19 @@ public class StatusImpl implements Status { private static final Logger log = LoggerFactory.getLogger(StatusImpl.class); private File document = null; - + private SignaturePosition signaturePosition = null; - + private BKUs bku = BKUs.NONE; - + private State currentState = null; private State previousState = null; private SigningState signingState = null; - + private SignResult signResult = null; - + private MainWindowBehavior behavior; private boolean searchForPlacehoderSignature = false; @@ -73,16 +73,16 @@ public class StatusImpl implements Status { */ public void setCurrentState(State currentState) { //if (this.previousState == this.currentState) - // log.error("Changing to same state? " + this.currentState); //$NON-NLS-1$ + // log.error("Changing to same state? " + this.currentState); // if (this.previousState != null && !this.previousState.equals(currentState)) { //Reference to previous state will be lost - perform cleanup - log.debug("Changing from " + this.currentState + " to " + currentState); //$NON-NLS-1$ //$NON-NLS-2$ - log.debug("Cleaning up " + this.previousState); //$NON-NLS-1$ + log.debug("Changing from " + this.currentState + " to " + currentState); // // + log.debug("Cleaning up " + this.previousState); // this.previousState.cleanUp(); } - + this.previousState = this.currentState; this.currentState = currentState; } @@ -110,7 +110,7 @@ public class StatusImpl implements Status { public File getDocument() { return this.document; } - + /* (non-Javadoc) * @see at.asit.pdfover.gui.workflow.Status#setSignaturePosition(at.asit.pdfover.signator.SignaturePosition) */ @@ -185,7 +185,7 @@ public class StatusImpl implements Status { /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.workflow.Status#getConfiguration() */ @Override @@ -195,7 +195,7 @@ public class StatusImpl implements Status { /* * (non-Javadoc) - * + * * @see * at.asit.pdfover.gui.workflow.Status#setSearchForPlaceholderSignature( * boolean) diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigManipulator.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigManipulator.java index befb244b..2a34b440 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigManipulator.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigManipulator.java @@ -171,28 +171,28 @@ public interface ConfigManipulator { */ public void saveCurrentConfiguration() throws IOException; - + /** * Sets whether to use an existing signaturemarker. * QR-Code only - * + * * @param useMarker * whether to use an existing signaturemarker */ public void setUseMarker(boolean useMarker); - + /** - * Sets the use of signature fields as signature marker + * Sets the use of signature fields as signature marker * @param useFields */ public void setUseSignatureFields(boolean useFields); - + /** * @param bool */ public void setEnablePlaceholderUsage(boolean bool); - + /** * @return */ @@ -204,7 +204,7 @@ public interface ConfigManipulator { public void setSignatureProfile(String profile); public void setSaveFilePostFix(String postFix); - + } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigOverlayManipulator.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigOverlayManipulator.java index 9b54f4ee..9c82845d 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigOverlayManipulator.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigOverlayManipulator.java @@ -20,7 +20,7 @@ import at.asit.pdfover.signator.SignaturePosition; /** * An interface for setting the configuration overlay - * + * * This overlay overrides the actual configuration but will not be saved */ public interface ConfigOverlayManipulator { @@ -131,10 +131,10 @@ public interface ConfigOverlayManipulator { * @param configurationFile */ public void setConfigurationFile(String configurationFile); - + /** - * + * * @param profile */ - public void setSignatureProfile(String profile); + public void setSignatureProfile(String profile); } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProvider.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProvider.java index b6935206..38526326 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProvider.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProvider.java @@ -32,11 +32,11 @@ public interface ConfigProvider { /** * RegEx for parsing signature position */ - public static final String SIGN_POS_REGEX = "(x=(\\d\\.?\\d?);y=(\\d\\.?\\d?);p=(\\d))|(auto)|(x=(\\d\\.?\\d?);y=(\\d\\.?\\d?))"; //$NON-NLS-1$ + public static final String SIGN_POS_REGEX = "(x=(\\d\\.?\\d?);y=(\\d\\.?\\d?);p=(\\d))|(auto)|(x=(\\d\\.?\\d?);y=(\\d\\.?\\d?))"; // /** * Loads the configuration from a configuration file - * + * * @param configSource * the configuration file * @throws IOException @@ -45,77 +45,77 @@ public interface ConfigProvider { /** * Gets the configuration file - * + * * @return the configuration file */ public String getConfigurationFile(); /** * Gets the configuration directory - * + * * @return the configuration directory */ public String getConfigurationDirectory(); /** * Gets the default Mobile number - * + * * @return the default mobile number */ public String getDefaultMobileNumber(); /** * Gets the password to use for Mobile BKU - * + * * @return the password */ public String getDefaultMobilePassword(); /** * Gets the filename of the default emblem - * + * * @return the emblem */ public String getDefaultEmblem(); /** * Gets the proxy host - * + * * @return the proxy hostname or ip address */ public String getProxyHost(); /** * Gets the proxy port - * + * * @return the proxy port */ public int getProxyPort(); /** * Gets the proxy username - * + * * @return the proxy username */ public String getProxyUser(); /** * Gets the proxy password - * + * * @return the proxy password */ public String getProxyPass(); /** * Get the default configured BKU - * + * * @return the default configured BKU */ public BKUs getDefaultBKU(); /** * Get the default configured SignaturePosition - * + * * @return the default configured SignaturePosition or null if not * configured */ @@ -123,126 +123,126 @@ public interface ConfigProvider { /** * Get the transparency of the signature placeholder - * + * * @return the transparency of the signature placeholder */ public int getPlaceholderTransparency(); /** * Gets the default output folder for signed documents - * + * * @return the default output folder */ public String getDefaultOutputFolder(); /** * Gets the mobile BKU URL - * + * * @return the mobile BKU URL */ public String getMobileBKUURL(); /** * Gets the mobile BKU type - * + * * @return the mobile BKU type */ public MobileBKUs getMobileBKUType(); /** * Gets the mobile BKU BASE64 setting - * + * * @return the mobile BKU BASE64 setting */ public boolean getMobileBKUBase64(); /** * Get the signature note text to use - * + * * @return the signature note text */ public String getSignatureNote(); /** * Gets the configured locale - * + * * @return the configured locale */ public Locale getLocale(); /** * Gets the configured locale - * + * * @return the configured locale */ public Locale getSignatureLocale(); /** * Get the signature PDF/A compatibility setting - * + * * @return the signature PDF/A compatibility setting */ public boolean getSignaturePdfACompat(); /** * Gets whether keystore signing is enabled - * + * * @return whether keystore signing is enabled */ public Boolean getKeyStoreEnabled(); /** * Gets the keystore file - * + * * @return the keystore file */ public String getKeyStoreFile(); /** * Gets the keystore type - * + * * @return the keystore type */ public String getKeyStoreType(); /** * Gets the keystore alias - * + * * @return the keystore alias */ public String getKeyStoreAlias(); /** * Gets the keystore store password - * + * * @return the keystore store password */ public String getKeyStoreStorePass(); /** * Gets the keystore key password - * + * * @return the keystore key password */ public String getKeyStoreKeyPass(); /** * Gets whether to automatically check for application updates - * + * * @return whether to automatically check for application updates */ public boolean getUpdateCheck(); /** * Gets the configured MainWindow size - * + * * @return the configured MainWindow size */ public Point getMainWindowSize(); /** * Gets whether to skip the finish screen - * + * * @return whether to skip the finish screen */ public boolean getSkipFinish(); @@ -253,14 +253,14 @@ public interface ConfigProvider { * @return whether to use a signature maker */ public boolean getUseMarker(); - + /** * Gets whether to use signature fileds instead of QR code. * * @return boolean */ public boolean getUseSignatureFields(); - + /** * @return */ @@ -270,8 +270,8 @@ public interface ConfigProvider { * @param profile */ public void setSignatureProfile(String profile); - - + + /** * @return */ 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 a744cf72..6edd7662 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 @@ -59,7 +59,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /** * An empty property entry */ - private static final String STRING_EMPTY = ""; //$NON-NLS-1$ + private static final String STRING_EMPTY = ""; // private String configurationFile = Constants.DEFAULT_CONFIG_FILENAME; @@ -79,7 +79,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /* * (non-Javadoc) - * + * * @see * at.asit.pdfover.gui.workflow.ConfigProvider#loadConfiguration(java.io * .InputStream) @@ -110,13 +110,13 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, setSaveFilePostFix(postFix); String localeString = config.getProperty(Constants.CFG_LOCALE); - + Locale targetLocale = LocaleSerializer.parseFromString(localeString); if (targetLocale != null) setLocale(targetLocale); String signatureLocaleString = config.getProperty(Constants.CFG_SIGNATURE_LOCALE); - + Locale signatureTargetLocale = LocaleSerializer.parseFromString(signatureLocaleString); if (signatureTargetLocale != null) setSignatureLocale(signatureTargetLocale); @@ -124,15 +124,15 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, String useMarker = config.getProperty(Constants.CFG_USE_MARKER); if (useMarker != null) setUseMarker(useMarker.equalsIgnoreCase(Constants.TRUE)); - + String useSignatureFields = config.getProperty(Constants.CFG_USE_SIGNATURE_FIELDS); if (useSignatureFields != null) setUseSignatureFields(useSignatureFields.equalsIgnoreCase(Constants.TRUE)); - + String enablePlaceholder = config.getProperty(Constants.CFG_ENABLE_PLACEHOLDER); if (enablePlaceholder != null) setEnablePlaceholderUsage(enablePlaceholder.equalsIgnoreCase(Constants.TRUE)); - + String signatureProfile = config.getProperty(Constants.SIGNATURE_PROFILE); if (signatureProfile != null) { @@ -143,7 +143,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, this.configurationOverlay.setSignatureProfile(profile); } } - + String compat = config.getProperty(Constants.CFG_SIGNATURE_PDFA_COMPAT); if (compat != null) setSignaturePdfACompat(compat.equalsIgnoreCase(Constants.TRUE)); @@ -162,7 +162,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, this.configuration.setMobileBKUType(MobileBKUs.valueOf( bkuType.trim().toUpperCase())); } catch (IllegalArgumentException e) { - log.error("Invalid BKU type: " + bkuType); //$NON-NLS-1$ + log.error("Invalid BKU type: " + bkuType); // this.configuration.setMobileBKUType(DEFAULT_MOBILE_BKU_TYPE); } } @@ -179,7 +179,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, if (port > 0 && port <= 0xFFFF) setProxyPort(port); else - log.warn("Proxy port is out of range!: " + port); //$NON-NLS-1$ + log.warn("Proxy port is out of range!: " + port); // } // Set Default BKU @@ -189,10 +189,10 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, try { defaultBKU = BKUs.valueOf(bkuString); } catch (IllegalArgumentException ex) { - log.error("Invalid BKU config value " + bkuString + " using none!"); //$NON-NLS-1$ //$NON-NLS-2$ + log.error("Invalid BKU config value " + bkuString + " using none!"); // // defaultBKU = BKUs.NONE; } catch (NullPointerException ex) { - log.error("Invalid BKU config value " + bkuString + " using none!"); //$NON-NLS-1$ //$NON-NLS-2$ + log.error("Invalid BKU config value " + bkuString + " using none!"); // // defaultBKU = BKUs.NONE; } } @@ -205,7 +205,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, try { transparency = Integer.parseInt(trans); } catch (NumberFormatException e) { - log.debug("Couldn't parse placeholder transparency", e); //$NON-NLS-1$ + log.debug("Couldn't parse placeholder transparency", e); // // ignore parsing exception } } @@ -226,7 +226,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, width = Integer.parseInt(size.substring(0, pos).trim()); height = Integer.parseInt(size.substring(pos + 1).trim()); } catch (NumberFormatException e) { - log.debug("Couldn't parse main window size", e); //$NON-NLS-1$ + log.debug("Couldn't parse main window size", e); // // ignore parsing exception } } @@ -257,7 +257,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, position = new SignaturePosition(x, y, p); } catch (NumberFormatException ex) { log.error( - "Signature Position read from config failed: Not a valid number", ex); //$NON-NLS-1$ + "Signature Position read from config failed: Not a valid number", ex); // } } else if (matcher.group(5) != null) { // we have format auto @@ -273,10 +273,10 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, position = new SignaturePosition(x, y); } } else { - log.error("Signature Position read from config failed: wrong group Count!"); //$NON-NLS-1$ + log.error("Signature Position read from config failed: wrong group Count!"); // } } else { - log.error("Signature Position read from config failed: not matching string"); //$NON-NLS-1$ + log.error("Signature Position read from config failed: not matching string"); // } } setDefaultSignaturePosition(position); @@ -300,7 +300,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /* * (non-Javadoc) - * + * * @see * at.asit.pdfover.gui.workflow.ConfigManipulator#saveCurrentConfiguration() */ @@ -338,7 +338,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, Integer.toString(getPlaceholderTransparency())); Point size = this.configuration.getMainWindowSize(); - props.setProperty(Constants.CFG_MAINWINDOW_SIZE, size.x + "," + size.y); //$NON-NLS-1$ + props.setProperty(Constants.CFG_MAINWINDOW_SIZE, size.x + "," + size.y); // Locale configLocale = getLocale(); if(configLocale != null) { @@ -352,11 +352,11 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, if (getUseMarker()) props.setProperty(Constants.CFG_USE_MARKER, Constants.TRUE); - + if (getUseSignatureFields()) { props.setProperty(Constants.CFG_USE_SIGNATURE_FIELDS, Constants.TRUE); } - + if (getEnablePlaceholderUsage()) { props.setProperty(Constants.CFG_ENABLE_PLACEHOLDER, Constants.TRUE); } @@ -366,12 +366,12 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, SignaturePosition pos = getDefaultSignaturePositionPersistent(); if (pos == null) { - props.setProperty(Constants.CFG_SIGNATURE_POSITION, ""); //$NON-NLS-1$ + props.setProperty(Constants.CFG_SIGNATURE_POSITION, ""); // } else if (pos.useAutoPositioning()) { - props.setProperty(Constants.CFG_SIGNATURE_POSITION, "auto"); //$NON-NLS-1$ + props.setProperty(Constants.CFG_SIGNATURE_POSITION, "auto"); // } else { props.setProperty(Constants.CFG_SIGNATURE_POSITION, - String.format((Locale) null, "x=%f;y=%f;p=%d", //$NON-NLS-1$ + String.format((Locale) null, "x=%f;y=%f;p=%d", // pos.getX(), pos.getY(), pos.getPage())); } @@ -409,21 +409,21 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, if (!getUpdateCheck()) props.setProperty(Constants.CFG_UPDATE_CHECK, Constants.FALSE); - + props.setProperty(Constants.SIGNATURE_PROFILE, getSignatureProfile()); - + FileOutputStream outputstream = new FileOutputStream(configFile, false); - props.store(outputstream, "Configuration file was generated!"); //$NON-NLS-1$ + props.store(outputstream, "Configuration file was generated!"); // - log.info("Configuration file saved to " + configFile.getAbsolutePath()); //$NON-NLS-1$ + log.info("Configuration file saved to " + configFile.getAbsolutePath()); // } /* * (non-Javadoc) - * + * * @see * at.asit.pdfover.gui.workflow.ConfigProvider#getConfigurationDirectory() */ @@ -434,7 +434,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /* * (non-Javadoc) - * + * * @see * at.asit.pdfover.gui.workflow.ConfigManipulator#setConfigurationFile(java * .lang.String) @@ -446,7 +446,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.workflow.ConfigProvider#getConfigurationFile() */ @Override @@ -456,7 +456,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /** * Sets the default bku type - * + * * @param bku * the bku type */ @@ -471,12 +471,12 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, @Override public void setDefaultBKUOverlay(BKUs bku) { this.configurationOverlay.setDefaultBKU(bku); - + } /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.workflow.ConfigProvider#getDefaultBKU() */ @Override @@ -497,7 +497,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /** * Sets the default signature position - * + * * @param signaturePosition * the default signature position */ @@ -517,7 +517,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /* * (non-Javadoc) - * + * * @see * at.asit.pdfover.gui.workflow.ConfigProvider#getDefaultSignaturePosition() */ @@ -539,7 +539,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /** * Sets the signature placeholder transparency - * + * * @param transparency * the signature placeholder transparency */ @@ -550,7 +550,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /* * (non-Javadoc) - * + * * @see * at.asit.pdfover.gui.workflow.ConfigProvider#getPlaceholderTransparency() */ @@ -561,7 +561,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /** * Sets the default mobile number - * + * * @param number * the default mobile number */ @@ -588,7 +588,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.workflow.ConfigProvider#getDefaultMobileNumber() */ @Override @@ -612,7 +612,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /** * Sets the default mobile password - * + * * @param password * the default password */ @@ -639,7 +639,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.workflow.ConfigProvider#getDefaultPassword() */ @Override @@ -663,7 +663,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /** * Sets the default emblem - * + * * @param emblem * the default emblem */ @@ -676,7 +676,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, this.configuration.setEmblem(emblem); } } catch (InvalidEmblemFile e) { - log.error("Error setting emblem file", e); //$NON-NLS-1$ + log.error("Error setting emblem file", e); // try { this.configuration.setEmblem(STRING_EMPTY); } catch (InvalidEmblemFile e1) { @@ -697,7 +697,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, this.configurationOverlay.setEmblem(emblem); } } catch (InvalidEmblemFile e) { - log.error("Error setting emblem file", e); //$NON-NLS-1$ + log.error("Error setting emblem file", e); // try { this.configurationOverlay.setEmblem(STRING_EMPTY); } catch (InvalidEmblemFile e1) { @@ -708,7 +708,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.workflow.ConfigProvider#getDefaultEmblem() */ @Override @@ -729,7 +729,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, emblem = STRING_EMPTY; return emblem; } - + /*@Override public String getDownloadURL() { return Constants.CERTIFICATE_DOWNLOAD_XML_URL; @@ -737,7 +737,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /** * Sets the proxy host - * + * * @param host * the proxy host */ @@ -764,7 +764,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.workflow.ConfigProvider#getProxyHost() */ @Override @@ -788,7 +788,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /** * Sets the proxy port - * + * * @param port * the proxy port */ @@ -797,7 +797,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, try { this.configuration.setProxyPort(port); } catch (InvalidPortException e) { - log.error("Error setting proxy port" , e); //$NON-NLS-1$ + log.error("Error setting proxy port" , e); // // ignore } } @@ -810,14 +810,14 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, try { this.configurationOverlay.setProxyPort(port); } catch (InvalidPortException e) { - log.error("Error setting proxy port" , e); //$NON-NLS-1$ + log.error("Error setting proxy port" , e); // // ignore } } /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.workflow.ConfigProvider#getProxyPort() */ @Override @@ -838,7 +838,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /** * Sets the proxy username - * + * * @param user * the proxy username */ @@ -887,7 +887,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /** * Sets the proxy password - * + * * @param pass * the proxy password */ @@ -936,7 +936,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /* * (non-Javadoc) - * + * * @see * at.asit.pdfover.gui.workflow.ConfigManipulator#setDefaultOutputFolder * (java.lang.String) @@ -964,7 +964,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.workflow.ConfigProvider#getDefaultOutputFolder() */ @Override @@ -988,7 +988,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.workflow.ConfigProvider#getMobileBKUURL() */ @Override @@ -1015,7 +1015,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /* * (non-Javadoc) - * + * * @see * at.asit.pdfover.gui.workflow.ConfigManipulator#setSignatureNote(java. * lang.String) @@ -1031,7 +1031,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.workflow.ConfigProvider#getSignatureNote() */ @Override @@ -1424,14 +1424,14 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.workflow.config.ConfigProvider#getUseMarker() */ @Override public boolean getUseMarker() { return this.configurationOverlay.getUseMarker(); } - + /* (non-Javadoc) * @see at.asit.pdfover.gui.workflow.config.PersistentConfigProvider#getUseSignatureFields() */ @@ -1439,13 +1439,13 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, public boolean getUseSignatureFields() { return this.configurationOverlay.getUseSignatureFields(); } - - - + + + /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.workflow.config.ConfigManipulator#setUseMarker( * boolean) */ @@ -1460,7 +1460,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, this.configurationOverlay.setUseSignatureFields(useFields); if (useFields) setUseMarker(false); } - + @Override public void setSignatureProfile(String profile) { this.configurationOverlay.setSignatureProfile(Profile.getProfile(profile)); @@ -1480,18 +1480,18 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, public String getSignatureProfile() { return this.configurationOverlay.getSignatureProfile().name(); } - - + + @Override public void setEnablePlaceholderUsage(boolean bool) { this.configurationOverlay.setEnablePlaceholderUsage(bool); } - + @Override public boolean getEnablePlaceholderUsage() { return this.configurationOverlay.getEnablePlaceholderUsage(); } - - - + + + } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainer.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainer.java index e2381a6f..70661f3d 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainer.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainer.java @@ -50,7 +50,7 @@ public interface ConfigurationContainer { public String getMobileNumber(); /** - * Sets the mobile phone number + * Sets the mobile phone number * @param number the mobile phone number */ public void setMobileNumber(String number); @@ -62,7 +62,7 @@ public interface ConfigurationContainer { public String getMobilePassword(); /** - * Sets the mobile phone password + * Sets the mobile phone password * @param password the mobile phone password */ public void setMobilePassword(String password); @@ -81,18 +81,18 @@ public interface ConfigurationContainer { /** * Gets the proxy port - * + * * if port is -1 no port is selected - * + * * @return the proxy port */ public int getProxyPort(); /** * Sets the proxy port - * + * * set to -1 for no port - * + * * @param port the proxy port * @throws InvalidPortException */ @@ -153,7 +153,7 @@ public interface ConfigurationContainer { public BKUs getDefaultBKU(); /** - * Sets the default BKU + * Sets the default BKU * @param defaultBKU the default BKU */ public void setDefaultBKU(BKUs defaultBKU); @@ -301,7 +301,7 @@ public interface ConfigurationContainer { * @param alias the keystore alias */ public void setKeyStoreAlias(String alias); - + /** * Gets the keystore store password * @return the keystore store password @@ -362,7 +362,7 @@ public interface ConfigurationContainer { */ public void setSkipFinish(boolean skipFinish); - + /** * Gets theCertificate-Download URL * @return the Certificate-Download URL @@ -370,7 +370,7 @@ public interface ConfigurationContainer { public String getDownloadURL(); - + /** * Gets whether to use an existing signature marker. * @@ -385,37 +385,37 @@ public interface ConfigurationContainer { * whether to use an existing signature marker */ public void setUseMarker(boolean useMarker); - - + + /*** * Extension to the standard use marker implementation * @param useFields */ public void setUseSignatureFields(boolean useFields); - - + + /** * @return if the usage of signatureFields is enabled */ public boolean getUseSignatureFields(); - + /** * @param bool */ public void setEnablePlaceholderUsage(boolean bool); - + /** * @return boolean */ public boolean getEnablePlaceholderUsage(); - - + + /** * @param profile set the selected profile */ public void setSignatureProfile(Profile profile); - - + + /** * @return selected signature profile as string */ 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 c989d59f..c0c84054 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 @@ -131,19 +131,19 @@ public class ConfigurationContainerImpl implements ConfigurationContainer { /** Whether to skip the output state */ protected boolean skipFinish = false; - + /** Default Download URL for certificates*/ protected String downloadURL = null; - + /** describes if the placeholder search is enabled */ - protected boolean enabledPlaceholderUsage = false; - + protected boolean enabledPlaceholderUsage = false; + /** Whether to use an existing signature marker. */ protected boolean useMarker = false; /** Either QR-Code or signature fields as marker */ - protected boolean useSignatureFields = false; - + protected boolean useSignatureFields = false; + /** The Signature Profile */ protected Profile signatureProfile = null; @@ -649,15 +649,15 @@ public class ConfigurationContainerImpl implements ConfigurationContainer { this.skipFinish = skipFinish; } - + /* (non-Javadoc) * @see at.asit.pdfover.gui.workflow.config.ConfigurationContainer#setDownloadURL(java.lang.String) - + @Override public void setDownloadURL(String downloadURL) { this.downloadURL = downloadURL; - - + + }*/ /* (non-Javadoc) @@ -667,10 +667,10 @@ public class ConfigurationContainerImpl implements ConfigurationContainer { public String getDownloadURL() { return this.downloadURL; } - + /* * (non-Javadoc) - * + * * @see * at.asit.pdfover.gui.workflow.config.ConfigurationContainer#getUseMarker() */ @@ -681,7 +681,7 @@ public class ConfigurationContainerImpl implements ConfigurationContainer { /* * (non-Javadoc) - * + * * @see * at.asit.pdfover.gui.workflow.config.ConfigurationContainer#setUseMarker( * boolean) @@ -691,16 +691,16 @@ public class ConfigurationContainerImpl implements ConfigurationContainer { this.useMarker = useMarker; if (useMarker) setUseSignatureFields(false); } - - + + @Override public void setUseSignatureFields(boolean useFields) { this.useSignatureFields = useFields; if (useFields) setUseMarker(false); } - - + + @Override public boolean getUseSignatureFields() { return this.useSignatureFields; @@ -711,8 +711,8 @@ public class ConfigurationContainerImpl implements ConfigurationContainer { */ @Override public void setEnablePlaceholderUsage(boolean bool) { - this.enabledPlaceholderUsage = bool; - + this.enabledPlaceholderUsage = bool; + } /* (non-Javadoc) @@ -722,14 +722,14 @@ public class ConfigurationContainerImpl implements ConfigurationContainer { public boolean getEnablePlaceholderUsage() { return this.enabledPlaceholderUsage; } - - - @Override + + + @Override public Profile getSignatureProfile() { if (this.signatureProfile == null) { this.signatureProfile = Profile.SIGNATURBLOCK_SMALL; } - return this.signatureProfile; + return this.signatureProfile; } @Override @@ -747,5 +747,5 @@ public class ConfigurationContainerImpl implements ConfigurationContainer { public void setSignatureProfile(Profile profile) { this.signatureProfile = profile; } - + } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/PersistentConfigProvider.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/PersistentConfigProvider.java index 1175ca9a..9bf81a05 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/PersistentConfigProvider.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/PersistentConfigProvider.java @@ -25,7 +25,7 @@ import at.asit.pdfover.signator.SignaturePosition; /** * An interface for reading the persistent configuration - * + * * This reads the configuration that will be saved */ public interface PersistentConfigProvider { @@ -79,7 +79,7 @@ public interface PersistentConfigProvider { /** * Gets the default output folder for signed documents - * @return the default output folder + * @return the default output folder */ public String getDefaultOutputFolderPersistent(); @@ -180,29 +180,29 @@ public interface PersistentConfigProvider { * @return the configured MainWindow size */ public Point getMainWindowSize(); - + /** * Gets whether to use an existing singature marker. * * @return whether to use an existing singature marker */ public boolean getUseMarker(); - + /** * Gets whether to use an existing signature fields. * * @return boolean */ public boolean getUseSignatureFields(); - + /** * @return */ public boolean getEnablePlaceholderUsage(); - + /*** - * - * @return the signature profile + * + * @return the signature profile */ public String getSignatureProfile(); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/BKUSelectionState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/BKUSelectionState.java index 8cca67a0..006b1ed9 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/BKUSelectionState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/BKUSelectionState.java @@ -47,7 +47,7 @@ public class BKUSelectionState extends State { **/ @SuppressWarnings("unused") private static final Logger log = LoggerFactory.getLogger(BKUSelectionState.class); - + private BKUSelectionComposite selectionComposite = null; private BKUSelectionComposite getSelectionComposite() { @@ -64,7 +64,7 @@ public class BKUSelectionState extends State { return this.selectionComposite; } - + @Override public void run() { Status status = getStateMachine().getStatus(); @@ -85,13 +85,13 @@ public class BKUSelectionState extends State { getStateMachine().getGUIProvider().display(selection); selection.layout(); - + status.setBKU(selection.getSelected()); - + if(status.getBKU() == BKUs.NONE) { return; } - } + } this.setNextState(new PrepareSigningState(getStateMachine())); } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/ConfigurationUIState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/ConfigurationUIState.java index 2d839bc0..d8ee2c63 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/ConfigurationUIState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/ConfigurationUIState.java @@ -27,7 +27,7 @@ import at.asit.pdfover.gui.workflow.StateMachine; import at.asit.pdfover.gui.workflow.Status; /** - * + * */ public class ConfigurationUIState extends State { /** @@ -37,8 +37,8 @@ public class ConfigurationUIState extends State { private static final Logger log = LoggerFactory .getLogger(ConfigurationUIState.class); - - + + private ConfigurationComposite configurationComposite = null; private ConfigurationComposite getConfigurationComposite() { @@ -52,7 +52,7 @@ public class ConfigurationUIState extends State { return this.configurationComposite; } - + /** * @param stateMachine */ @@ -69,7 +69,7 @@ public class ConfigurationUIState extends State { Status status = getStateMachine().getStatus(); ConfigurationComposite config = this.getConfigurationComposite(); - + getStateMachine().getGUIProvider().display(config); if(config.isUserDone()) 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 c2a5f039..86d8f32f 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 @@ -54,7 +54,7 @@ public class KSState extends State { /* * (non-Javadoc) - * + * * @see * at.asit.pdfover.gui.workflow.WorkflowState#update(at.asit.pdfover.gui * .workflow.Workflow) @@ -70,10 +70,10 @@ public class KSState extends State { String file = config.getKeyStoreFile(); File f = new File(file); if (!f.isFile()) { - log.error("Keystore not found"); //$NON-NLS-1$ + log.error("Keystore not found"); // ErrorDialog dialog = new ErrorDialog( getStateMachine().getGUIProvider().getMainShell(), - String.format(Messages.getString("error.KeyStoreFileNotExist"), f.getName()), //$NON-NLS-1$ + String.format(Messages.getString("error.KeyStoreFileNotExist"), f.getName()), // BUTTONS.RETRY_CANCEL); if (dialog.open() != SWT.RETRY) { //getStateMachine().exit(); @@ -88,25 +88,25 @@ public class KSState extends State { if (storePass.isEmpty()) { PasswordInputDialog pwd = new PasswordInputDialog( getStateMachine().getGUIProvider().getMainShell(), - Messages.getString("keystore_config.KeystoreStorePass"), //$NON-NLS-1$ - Messages.getString("keystore.KeystoreStorePassEntry")); //$NON-NLS-1$ + Messages.getString("keystore_config.KeystoreStorePass"), // + Messages.getString("keystore.KeystoreStorePassEntry")); // storePass = pwd.open(); } String keyPass = config.getKeyStoreKeyPass(); if (keyPass.isEmpty()) { PasswordInputDialog pwd = new PasswordInputDialog( getStateMachine().getGUIProvider().getMainShell(), - Messages.getString("keystore_config.KeystoreKeyPass"), //$NON-NLS-1$ - Messages.getString("keystore.KeystoreKeyPassEntry")); //$NON-NLS-1$ + Messages.getString("keystore_config.KeystoreKeyPass"), // + Messages.getString("keystore.KeystoreKeyPassEntry")); // keyPass = pwd.open(); } String type = config.getKeyStoreType(); signingState.setKSSigner(file, alias, storePass, keyPass, type); } catch (SignatureException e) { - log.error("Error loading keystore", e); //$NON-NLS-1$ + log.error("Error loading keystore", e); // ErrorDialog dialog = new ErrorDialog( getStateMachine().getGUIProvider().getMainShell(), - Messages.getString("error.KeyStore"), //$NON-NLS-1$ + Messages.getString("error.KeyStore"), // BUTTONS.RETRY_CANCEL); if (dialog.open() != SWT.RETRY) { //getStateMachine().exit(); @@ -123,7 +123,7 @@ public class KSState extends State { /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.workflow.states.State#cleanUp() */ @Override @@ -133,7 +133,7 @@ public class KSState extends State { /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.workflow.states.State#setMainWindowBehavior() */ @Override 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 c0baabbf..ed6ee411 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 @@ -51,17 +51,17 @@ public class LocalBKUState extends State { /** * HTTP Response server HEADER */ - public final static String BKU_RESPONSE_HEADER_SERVER = "server"; //$NON-NLS-1$ + public final static String BKU_RESPONSE_HEADER_SERVER = "server"; // /** * HTTP Response user-agent HEADER */ - public final static String BKU_RESPONSE_HEADER_USERAGENT = "user-agent"; //$NON-NLS-1$ + public final static String BKU_RESPONSE_HEADER_USERAGENT = "user-agent"; // /** * HTTP Response SignatureLayout HEADER */ - public final static String BKU_RESPONSE_HEADER_SIGNATURE_LAYOUT = "SignatureLayout"; //$NON-NLS-1$ + public final static String BKU_RESPONSE_HEADER_SIGNATURE_LAYOUT = "SignatureLayout"; // Exception threadException = null; @@ -71,8 +71,8 @@ public class LocalBKUState extends State { /** * Null-Operation SL-Request */ - private final static String NULL_OPERATION_REQUEST = "" + //$NON-NLS-1$ - ""; //$NON-NLS-1$ + private final static String NULL_OPERATION_REQUEST = "" + // + ""; // /** * Constructor @@ -83,14 +83,14 @@ public class LocalBKUState extends State { } /** - * + * */ private final class SignLocalBKUThread implements Runnable { private LocalBKUState state; private SigningState signingState; - + /** * @param localBKUState * @param signingState @@ -109,7 +109,7 @@ public class LocalBKUState extends State { PostMethod method = new PostMethod(Constants.LOCAL_BKU_URL); String sl_request = NULL_OPERATION_REQUEST; - method.addParameter("XMLRequest", sl_request); //$NON-NLS-1$ + method.addParameter("XMLRequest", sl_request); // int returnCode = client.executeMethod(method); String userAgent = getResponseHeader(method, BKU_RESPONSE_HEADER_USERAGENT); @@ -121,27 +121,27 @@ public class LocalBKUState extends State { } else { server = getResponseHeader(method, BKU_RESPONSE_HEADER_SERVER); if (server == null) - server = ""; //$NON-NLS-1$ + server = ""; // else - if (server.contains("trustDeskbasic") || server.contains("asignSecurityLayer")) //$NON-NLS-1$ //$NON-NLS-2$ + if (server.contains("trustDeskbasic") || server.contains("asignSecurityLayer")) // // LocalBKUState.this.useBase64Request = true; userAgent = getResponseHeader(method, BKU_RESPONSE_HEADER_USERAGENT); if (userAgent == null) - userAgent = ""; //$NON-NLS-1$ + userAgent = ""; // String signatureLayout = getResponseHeader(method, BKU_RESPONSE_HEADER_SIGNATURE_LAYOUT); - log.debug("Server - UA: " + server + " - " + userAgent); //$NON-NLS-1$ //$NON-NLS-2$ + log.debug("Server - UA: " + server + " - " + userAgent); // // String response = method.getResponseBodyAsString(); - log.debug("SL Response: " + response); //$NON-NLS-1$ + log.debug("SL Response: " + response); // SLResponse slResponse = new SLResponse(response, server, userAgent, signatureLayout); this.signingState.setSignatureResponse(slResponse); this.signingState.setUseBase64Request(LocalBKUState.this.useBase64Request); } } catch (Exception e) { - log.error("SignLocalBKUThread: ", e); //$NON-NLS-1$ + log.error("SignLocalBKUThread: ", e); // this.state.threadException = e; } finally { @@ -164,7 +164,7 @@ public class LocalBKUState extends State { /* * (non-Javadoc) - * + * * @see * at.asit.pdfover.gui.workflow.WorkflowState#update(at.asit.pdfover.gui * .workflow.Workflow) @@ -186,7 +186,7 @@ public class LocalBKUState extends State { if (this.threadException != null) { ErrorDialog dialog = new ErrorDialog( getStateMachine().getGUIProvider().getMainShell(), - Messages.getString("error.LocalBKU"), //$NON-NLS-1$ + Messages.getString("error.LocalBKU"), // BUTTONS.RETRY_CANCEL); if (dialog.open() != SWT.RETRY) { //getStateMachine().exit(); @@ -204,7 +204,7 @@ public class LocalBKUState extends State { /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.workflow.states.State#cleanUp() */ @Override @@ -214,7 +214,7 @@ public class LocalBKUState extends State { /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.workflow.states.State#setMainWindowBehavior() */ @Override 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 a838c635..86266b13 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 @@ -75,15 +75,15 @@ public class MobileBKUState extends State { this.status = new IAIKStatus(provider); this.handler = new IAIKHandler(this, stateMachine.getGUIProvider().getMainShell()); break; - + default: throw new RuntimeException("Unexpected mobileBKUType"); } } MobileBKUEnterTANComposite mobileBKUEnterTANComposite = null; - - WaitingForAppComposite waitingForAppComposite = null; + + WaitingForAppComposite waitingForAppComposite = null; WaitingForAppComposite getWaitingForAppComposite() { if (this.waitingForAppComposite == null) { this.waitingForAppComposite = getStateMachine().getGUIProvider() @@ -92,7 +92,7 @@ public class MobileBKUState extends State { return this.waitingForAppComposite; } - + WaitingComposite waitingComposite = null; WaitingComposite getWaitingComposite() { if (this.waitingComposite == null) { @@ -159,22 +159,22 @@ public class MobileBKUState extends State { /** * Display an error message - * + * * @param e * the exception */ public void displayError(Exception e) { - String message = Messages.getString("error.Unexpected"); //$NON-NLS-1$ + String message = Messages.getString("error.Unexpected"); // log.error(message, e); String errormsg = e.getLocalizedMessage(); if (errormsg != null && !errormsg.isEmpty()) - message += ": " + errormsg; //$NON-NLS-1$ + message += ": " + errormsg; // displayError(message); } /** * Display an error message - * + * * @param message * the error message */ @@ -205,7 +205,7 @@ public class MobileBKUState extends State { public void run() { MobileBKUEnterNumberComposite ui = MobileBKUState.this .getMobileBKUEnterNumberComposite(); - + if (!ui.userAck) { // We need number and password => show UI! if (mobileStatus.errorMessage != null @@ -214,7 +214,7 @@ public class MobileBKUState extends State { ui.setErrorMessage(mobileStatus.errorMessage); mobileStatus.errorMessage = null; } else if (mobileStatus instanceof ATrustStatus) { - ui.setErrorMessage(Messages.getString("mobileBKU.aTrustDisclaimer")); //$NON-NLS-1$ + ui.setErrorMessage(Messages.getString("mobileBKU.aTrustDisclaimer")); // } if (ui.getMobileNumber() == null @@ -231,7 +231,7 @@ public class MobileBKUState extends State { ui.enableButton(); getStateMachine().getGUIProvider().display(ui); - Display display = getStateMachine().getGUIProvider().getMainShell().getDisplay(); + Display display = getStateMachine().getGUIProvider().getMainShell().getDisplay(); while (!ui.userAck && !ui.userCancel) { if (!display.readAndDispatch()) { display.sleep(); @@ -241,7 +241,7 @@ public class MobileBKUState extends State { if (ui.userCancel) { ui.userCancel = false; - mobileStatus.errorMessage = "cancel"; //$NON-NLS-1$ + mobileStatus.errorMessage = "cancel"; // return; } @@ -270,7 +270,7 @@ public class MobileBKUState extends State { public void run() { MobileBKUEnterTANComposite tan = MobileBKUState.this .getMobileBKUEnterTANComposite(); - + if (!tan.isUserAck()) { // we need the TAN tan.setRefVal(mobileStatus.refVal); @@ -280,13 +280,13 @@ public class MobileBKUState extends State { && mobileStatus.tanTries > 0) { // show warning message x tries left! // overrides error message - + tan.setTries(mobileStatus.tanTries); } tan.enableButton(); getStateMachine().getGUIProvider().display(tan); - Display display = getStateMachine().getGUIProvider().getMainShell().getDisplay(); + Display display = getStateMachine().getGUIProvider().getMainShell().getDisplay(); while (!tan.isUserAck() && !tan.isUserCancel()) { if (!display.readAndDispatch()) { display.sleep(); @@ -321,14 +321,14 @@ public class MobileBKUState extends State { final Timer checkDone = new Timer(); checkDone.scheduleAtFixedRate(new TimerTask() { - + @Override public void run() { // ping signature page to see if code has been scanned try { String resp = handler.getSignaturePage(); if (handler.handleQRResponse(resp)) { - log.debug("Signature page response: " + resp); //$NON-NLS-1$ + log.debug("Signature page response: " + resp); // getMobileBKUQRComposite().setDone(true); Display display = getStateMachine().getGUIProvider(). getMainShell().getDisplay(); @@ -337,7 +337,7 @@ public class MobileBKUState extends State { } Display.getDefault().wake(); } catch (Exception e) { - log.error("Error getting signature page", e); //$NON-NLS-1$ + log.error("Error getting signature page", e); // } } }, 0, 5000); @@ -351,7 +351,7 @@ public class MobileBKUState extends State { InputStream qrcode = handler.getQRCode(); if (qrcode == null) { MobileBKUState.this.threadException = new Exception( - Messages.getString("error.FailedToLoadQRCode")); //$NON-NLS-1$ + Messages.getString("error.FailedToLoadQRCode")); // } qr.setQR(qrcode); getStateMachine().getGUIProvider().display(qr); @@ -396,9 +396,9 @@ public class MobileBKUState extends State { getStateMachine().getGUIProvider().display(MobileBKUState.this.getWaitingForAppComposite()); } }); - + } - + /** * This composite notifies the user to open the signature-app */ @@ -472,8 +472,8 @@ public class MobileBKUState extends State { } /** - * when fingerprint or faceid is selected in the app - * this information is shown + * when fingerprint or faceid is selected in the app + * this information is shown */ public void showFingerPrintInformation() { final ATrustStatus status = (ATrustStatus) this.status; @@ -481,14 +481,14 @@ public class MobileBKUState extends State { Timer checkDone = new Timer(); checkDone.scheduleAtFixedRate(new TimerTask() { - + @Override public void run() { // ping signature page to see if code has been scanned try { String resp = handler.getSignaturePage(); if (handler.handleQRResponse(resp)) { - log.debug("Signature page response: " + resp); //$NON-NLS-1$ + log.debug("Signature page response: " + resp); // getMobileBKUFingerprintComposite().setDone(true); Display display = getStateMachine().getGUIProvider().getMainShell().getDisplay(); display.wake(); @@ -496,7 +496,7 @@ public class MobileBKUState extends State { } Display.getDefault().wake(); } catch (Exception e) { - log.error("Error getting signature page", e); //$NON-NLS-1$ + log.error("Error getting signature page", e); // } } }, 0, 5000); @@ -539,14 +539,14 @@ public class MobileBKUState extends State { /** * @return a boolean true if the user has pressed the sms tan button */ - public boolean getSMSStatus() { - - return this.getMobileBKUFingerprintComposite().isUserSMS(); + public boolean getSMSStatus() { + + return this.getMobileBKUFingerprintComposite().isUserSMS(); } /* * (non-Javadoc) - * + * * @see * at.asit.pdfover.gui.workflow.WorkflowState#update(at.asit.pdfover.gui * .workflow.Workflow) @@ -556,15 +556,15 @@ public class MobileBKUState extends State { this.signingState = getStateMachine().getStatus().getSigningState(); this.signingState.setBKUConnector(new MobileBKUConnector(this)); - log.debug("Setting base64 request to " + this.handler.useBase64Request()); //$NON-NLS-1$ + log.debug("Setting base64 request to " + this.handler.useBase64Request()); // this.signingState.setUseBase64Request(this.handler.useBase64Request()); if (this.threadException != null) { - String message = Messages.getString("error.Unexpected"); //$NON-NLS-1$ + String message = Messages.getString("error.Unexpected"); // log.error(message, this.threadException); String errormsg = this.threadException.getLocalizedMessage(); if (errormsg != null && !errormsg.isEmpty()) - message += ": " + errormsg; //$NON-NLS-1$ + message += ": " + errormsg; // ErrorDialog error = new ErrorDialog( getStateMachine().getGUIProvider().getMainShell(), message, BUTTONS.OK); @@ -583,7 +583,7 @@ public class MobileBKUState extends State { /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.workflow.states.State#cleanUp() */ @Override @@ -600,7 +600,7 @@ public class MobileBKUState extends State { /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.workflow.states.State#setMainWindowBehavior() */ @Override 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 9fca3d2c..78b9db3c 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 @@ -67,8 +67,8 @@ public class OpenState extends State { **/ private static final Logger log = LoggerFactory .getLogger(OpenState.class); - private static final String advancedConfig = Constants.CONFIG_DIRECTORY + File.separator + "/cfg/advancedconfig.properties"; //$NON-NLS-1$ - + private static final String advancedConfig = Constants.CONFIG_DIRECTORY + File.separator + "/cfg/advancedconfig.properties"; // + private DataSourceSelectComposite selectionComposite = null; private DataSourceSelectComposite getSelectionComposite() { @@ -106,7 +106,7 @@ public class OpenState extends State { return; } } - log.debug("Got Datasource: " + getStateMachine().getStatus().getDocument().getAbsolutePath()); //$NON-NLS-1$ + log.debug("Got Datasource: " + getStateMachine().getStatus().getDocument().getAbsolutePath()); // // scan for signature placeholders // - see if we want to scan for placeholders in the settings @@ -116,7 +116,7 @@ public class OpenState extends State { boolean useSignatureFields = config.getUseSignatureFields(); boolean useMarker = config.getUseMarker(); log.debug("Placeholder usage enabled. Signature fields: {}, QR Markers: {}", useSignatureFields, useMarker); - //first check the signature fields placeholder + //first check the signature fields placeholder if (useSignatureFields) { List fields = SignatureFieldsAndPlaceHolderExtractor.findEmptySignatureFields(pddocument); @@ -128,23 +128,23 @@ public class OpenState extends State { // icon MessageBox dialog = new MessageBox(getStateMachine().getGUIProvider().getMainShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO | SWT.CANCEL); - dialog.setText(Messages.getString("dataSourceSelection.usePlaceholderTitle")); //$NON-NLS-1$ - dialog.setMessage(Messages.getString("dataSourceSelection.usePlaceholderText")); //$NON-NLS-1$ + dialog.setText(Messages.getString("dataSourceSelection.usePlaceholderTitle")); // + dialog.setMessage(Messages.getString("dataSourceSelection.usePlaceholderText")); // // open dialog and await user selection int result = dialog.open(); if (result == SWT.YES) { - + if (fields.size() == 1) { addPlaceholderSelectionToConfig(fields.get(0)); this.setNextState(new BKUSelectionState(getStateMachine())); return; - + } else if (fields.size() > 1) { PlaceholderSelectionGui gui = new PlaceholderSelectionGui( - getStateMachine().getGUIProvider().getMainShell(), 65570, "text", //$NON-NLS-1$ - "select the fields", fields); //$NON-NLS-1$ + getStateMachine().getGUIProvider().getMainShell(), 65570, "text", // + "select the fields", fields); // int res = gui.open(); if (res != -1) { getStateMachine().getStatus().setSearchForPlaceholderSignature(true); @@ -174,8 +174,8 @@ public class OpenState extends State { // create a dialog with ok and cancel buttons and a question icon MessageBox dialog = new MessageBox(getStateMachine().getGUIProvider().getMainShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO | SWT.CANCEL); - dialog.setText(Messages.getString("dataSourceSelection.usePlaceholderTitle")); //$NON-NLS-1$ - dialog.setMessage(Messages.getString("dataSourceSelection.usePlaceholderText")); //$NON-NLS-1$ + dialog.setText(Messages.getString("dataSourceSelection.usePlaceholderTitle")); // + dialog.setMessage(Messages.getString("dataSourceSelection.usePlaceholderText")); // // open dialog and await user selection int result = dialog.open(); @@ -212,7 +212,7 @@ public class OpenState extends State { // proceed with the usual process. } } - + this.setNextState(new PositioningState(getStateMachine())); } 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 d20d5268..89b7d346 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 @@ -48,16 +48,16 @@ public class OutputState extends State { if (this.outputComposite == null) { this.outputComposite = getStateMachine().getGUIProvider() .createComposite(OutputComposite.class, SWT.RESIZE, this); - + ConfigProvider config = getStateMachine().getConfigProvider(); Status status = getStateMachine().getStatus(); - - File tmpDir = new File(config.getConfigurationDirectory() + File.separator + "tmp"); //$NON-NLS-1$ - + + File tmpDir = new File(config.getConfigurationDirectory() + File.separator + "tmp"); // + if(!tmpDir.exists()) { tmpDir.mkdir(); } - + this.outputComposite.setOutputDir(config.getDefaultOutputFolder()); this.outputComposite.setSaveFilePostFix(config.getSaveFilePostFix()); this.outputComposite.setTempDir(tmpDir.getAbsolutePath()); @@ -83,7 +83,7 @@ public class OutputState extends State { if (status.getSignResult() == null) { ErrorDialog error = new ErrorDialog(getStateMachine().getGUIProvider().getMainShell(), - Messages.getString("error.Signatur"), BUTTONS.RETRY_CANCEL); //$NON-NLS-1$ + Messages.getString("error.Signatur"), BUTTONS.RETRY_CANCEL); // if(error.open() == SWT.RETRY) { this.setNextState(new PrepareSigningState(getStateMachine())); } else { @@ -100,21 +100,21 @@ public class OutputState extends State { /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.workflow.states.State#cleanUp() */ @Override public void cleanUp() { - + getStateMachine().getStatus().setSignResult(null); - + if (this.outputComposite != null) this.outputComposite.dispose(); } /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.workflow.states.State#setMainWindowBehavior() */ @Override 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 6aec43fe..df157774 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 @@ -71,7 +71,7 @@ public class PositioningState extends State { private PDFFile document = null; private void closePDFDocument() { - + if (this.document != null) { this.document = null; @@ -102,7 +102,7 @@ public class PositioningState extends State { } catch (IOException e) { if (e.getCause() instanceof UnsupportedEncryptionException) - throw new IOException(Messages.getString("error.PDFProtected")); + throw new IOException(Messages.getString("error.PDFProtected")); else throw new IOException(Messages.getString("error.MayNotBeAPDF"), e); } @@ -124,7 +124,7 @@ public class PositioningState extends State { Emblem emblem = new CachedFileNameEmblem(config.getDefaultEmblem()); param.setEmblem(emblem); if(config.getSignatureNote() != null && !config.getSignatureNote().isEmpty()) { - param.setProperty("SIG_NOTE", config.getSignatureNote()); //$NON-NLS-1$ + param.setProperty("SIG_NOTE", config.getSignatureNote()); // } param.setSignatureLanguage(config.getSignatureLocale().getLanguage()); @@ -140,7 +140,7 @@ public class PositioningState extends State { this.previousPosition.getX(), this.previousPosition.getY(), this.previousPosition.getPage()); - + return this.positionComposite; } @@ -156,15 +156,15 @@ public class PositioningState extends State { if ((this.document == null) || (this.loadedDocumentPath != getStateMachine().getStatus().getDocument())) { - log.debug("Checking PDF document for encryption"); //$NON-NLS-1$ + log.debug("Checking PDF document for encryption"); // try { openPDFDocument(); - } catch (IOException e) { + } catch (IOException e) { this.positionComposite = null; - log.error("Failed to display PDF document", e); //$NON-NLS-1$ + log.error("Failed to display PDF document", e); // String message = e.getLocalizedMessage(); if (message == null) - message = Messages.getString("error.IOError"); //$NON-NLS-1$ + message = Messages.getString("error.IOError"); // ErrorDialog dialog = new ErrorDialog( getStateMachine().getGUIProvider().getMainShell(), message, BUTTONS.RETRY_CANCEL); @@ -182,10 +182,10 @@ public class PositioningState extends State { try { position = this.getPositioningComposite(this.document); } catch(Exception ex) { - log.error("Failed to create composite (probably a mac...)", ex); //$NON-NLS-1$ + log.error("Failed to create composite (probably a mac...)", ex); // ErrorDialog dialog = new ErrorDialog( getStateMachine().getGUIProvider().getMainShell(), - Messages.getString("error.PositioningNotPossible"), BUTTONS.OK); //$NON-NLS-1$ + Messages.getString("error.PositioningNotPossible"), BUTTONS.OK); // dialog.open(); status.setSignaturePosition(new SignaturePosition()); this.setNextState(new BKUSelectionState(getStateMachine())); @@ -193,13 +193,13 @@ public class PositioningState extends State { } getStateMachine().getGUIProvider().display(position); - + status.setSignaturePosition(position.getPosition()); - + if(status.getSignaturePosition() != null) { this.setNextState(new BKUSelectionState(getStateMachine())); } - + this.positionComposite.requestFocus(); } else { this.setNextState(new BKUSelectionState(getStateMachine())); 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 21343b5b..d653a07f 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 @@ -114,7 +114,7 @@ public class PrepareConfigurationState extends State { new FileInputStream( getStateMachine().getConfigProvider().getConfigurationDirectory() + FILE_SEPARATOR + filename)); - log.info("Loaded config from file : " + filename); //$NON-NLS-1$ + log.info("Loaded config from file : " + filename); // } catch (FileNotFoundException ex) { if (filename.equals(Constants.DEFAULT_CONFIG_FILENAME)) { // we only check for resource config file if it is the @@ -125,7 +125,7 @@ public class PrepareConfigurationState extends State { getStateMachine().getConfigProvider() .loadConfiguration(is); - log.info("Loaded config from resource : " + filename); //$NON-NLS-1$ + log.info("Loaded config from resource : " + filename); // } catch (Exception eex) { throw ex; } @@ -136,7 +136,7 @@ public class PrepareConfigurationState extends State { } catch (IOException ex) { throw new InitializationException( - "Failed to read configuration from config file", ex); //$NON-NLS-1$ + "Failed to read configuration from config file", ex); // } } @@ -150,7 +150,7 @@ public class PrepareConfigurationState extends State { String note = config.getSignatureNote(); Locale loc = config.getSignatureLocale(); - String note_old = Messages.getString("simple_config.Note_Default_Old", loc); //$NON-NLS-1$ + String note_old = Messages.getString("simple_config.Note_Default_Old", loc); // if (note.equals(note_old)) resetSignatureNoteField(config); } @@ -189,9 +189,9 @@ public class PrepareConfigurationState extends State { } } catch (Exception e) { log.error( - "Failed to write PDF Over config file to config directory", e); //$NON-NLS-1$ + "Failed to write PDF Over config file to config directory", e); // throw new InitializationException( - "Failed to write PDF Over config file to config directory", //$NON-NLS-1$ + "Failed to write PDF Over config file to config directory", // e); } finally { if (pdfOverConfig != null) { @@ -199,7 +199,7 @@ public class PrepareConfigurationState extends State { pdfOverConfig.close(); } catch (IOException e) { log.warn( - "Failed to close File stream for PDFOver config", e); //$NON-NLS-1$ + "Failed to close File stream for PDFOver config", e); // } } @@ -208,7 +208,7 @@ public class PrepareConfigurationState extends State { inputStream.close(); } catch (IOException e) { log.warn( - "Failed to close Resource stream for PDFOver config", e); //$NON-NLS-1$ + "Failed to close Resource stream for PDFOver config", e); // } } } @@ -229,17 +229,17 @@ public class PrepareConfigurationState extends State { String filename = getStateMachine().getConfigProvider().getConfigurationDirectory() + FILE_SEPARATOR + Constants.DEFAULT_LOG4J_FILENAME; pdfOverConfig = new FileOutputStream(filename); - + while ((byteCount = inputStream.read(buffer)) >= 0) { pdfOverConfig.write(buffer, 0, byteCount); } - + PropertyConfigurator.configureAndWatch(filename); } catch (Exception e) { log.error( - "Failed to write log4j config file to config directory", e); //$NON-NLS-1$ + "Failed to write log4j config file to config directory", e); // throw new InitializationException( - "Failed to write log4j config file to config directory", //$NON-NLS-1$ + "Failed to write log4j config file to config directory", // e); } finally { if (pdfOverConfig != null) { @@ -247,16 +247,16 @@ public class PrepareConfigurationState extends State { pdfOverConfig.close(); } catch (IOException e) { log.warn( - "Failed to close File stream for log4j config", e); //$NON-NLS-1$ + "Failed to close File stream for log4j config", e); // } } - + if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { log.warn( - "Failed to close Resource stream for log4j config", e); //$NON-NLS-1$ + "Failed to close Resource stream for log4j config", e); // } } }*/ @@ -269,9 +269,9 @@ public class PrepareConfigurationState extends State { Zipper.unzip(is, configDir.getAbsolutePath()); } catch (IOException e) { log.error( - "Failed to create local configuration directory!", e); //$NON-NLS-1$ + "Failed to create local configuration directory!", e); // throw new InitializationException( - "Failed to create local configuration directory!", //$NON-NLS-1$ + "Failed to create local configuration directory!", // e); } } @@ -280,14 +280,14 @@ public class PrepareConfigurationState extends State { File versionFile = new File(configDir, Constants.CONFIG_VERSION_FILENAME); try { BufferedWriter versionWriter = new BufferedWriter(new FileWriter(versionFile)); - String version = Constants.APP_VERSION == null ? "Unknown" : Constants.APP_VERSION; //$NON-NLS-1$ + String version = Constants.APP_VERSION == null ? "Unknown" : Constants.APP_VERSION; // versionWriter.write(version); versionWriter.close(); } catch (IOException e) { log.error( - "Failed to create configuration version file!", e); //$NON-NLS-1$ + "Failed to create configuration version file!", e); // throw new InitializationException( - "Failed to create configuration version file!", //$NON-NLS-1$ + "Failed to create configuration version file!", // e); } } @@ -295,16 +295,16 @@ public class PrepareConfigurationState extends State { private void initializeConfig() throws InitializationException { initializeFromConfigurationFile(getStateMachine() .getConfigProvider().getConfigurationFile()); - + resetSignatureNoteField(getStateMachine().getConfigProvider()); - + try { getStateMachine().getConfigManipulator().saveCurrentConfiguration(); } catch (IOException e) { log.error( - "Failed to set local configuration signature note!", e); //$NON-NLS-1$ + "Failed to set local configuration signature note!", e); // throw new InitializationException( - "Failed to set local configuration signature note!", //$NON-NLS-1$ + "Failed to set local configuration signature note!", // e); } } @@ -312,7 +312,7 @@ public class PrepareConfigurationState extends State { private void createConfiguration(File configDir) throws InitializationException { boolean allOK = false; - log.info("Creating configuration directory"); //$NON-NLS-1$ + log.info("Creating configuration directory"); // if (!configDir.exists()) { configDir.mkdir(); } @@ -345,14 +345,14 @@ public class PrepareConfigurationState extends State { String version; while ((version = versionReader.readLine()) != null) { version = version.trim(); - if (version.length() > 0 && !version.startsWith("#")) { //$NON-NLS-1$ - log.trace("configuration version from " + versionFile //$NON-NLS-1$ - + ": " + version); //$NON-NLS-1$ + if (version.length() > 0 && !version.startsWith("#")) { // + log.trace("configuration version from " + versionFile // + + ": " + version); // return version; } } } catch (IOException ex) { - log.error("failed to read configuration version from " //$NON-NLS-1$ + log.error("failed to read configuration version from " // + versionFile, ex); } finally { try { @@ -362,7 +362,7 @@ public class PrepareConfigurationState extends State { } } } - log.debug("unknown configuration version"); //$NON-NLS-1$ + log.debug("unknown configuration version"); // return null; } @@ -373,24 +373,24 @@ public class PrepareConfigurationState extends State { */ private void backupAndCreatePdfAsConfiguration(File configDir) throws InitializationException { try { - File backup = File.createTempFile(Constants.PDF_AS_CONFIG_BACKUP_FILENAME, ".zip"); //$NON-NLS-1$ + File backup = File.createTempFile(Constants.PDF_AS_CONFIG_BACKUP_FILENAME, ".zip"); // OutputStream os = new FileOutputStream(backup); - Zipper.zip(configDir + FILE_SEPARATOR + "cfg", os, true); //$NON-NLS-1$ + Zipper.zip(configDir + FILE_SEPARATOR + "cfg", os, true); // os.close(); unzipPdfAsConfig(configDir); - File b = new File(configDir, Constants.PDF_AS_CONFIG_BACKUP_FILENAME + ".zip"); //$NON-NLS-1$ + File b = new File(configDir, Constants.PDF_AS_CONFIG_BACKUP_FILENAME + ".zip"); // int i = 1; while (b.exists()) { - b = new File(configDir, Constants.PDF_AS_CONFIG_BACKUP_FILENAME + i++ + ".zip"); //$NON-NLS-1$ + b = new File(configDir, Constants.PDF_AS_CONFIG_BACKUP_FILENAME + i++ + ".zip"); // } backup.renameTo(b); updateVersionFile(configDir); } catch (FileNotFoundException e) { - log.error("Backup file not found", e); //$NON-NLS-1$ - throw new InitializationException("Backup file not found", e); //$NON-NLS-1$ + log.error("Backup file not found", e); // + throw new InitializationException("Backup file not found", e); // } catch (IOException e) { - log.error("Error creating configuration backup", e); //$NON-NLS-1$ - throw new InitializationException("Error creating configuration backup", e); //$NON-NLS-1$ + log.error("Error creating configuration backup", e); // + throw new InitializationException("Error creating configuration backup", e); // } } @@ -405,10 +405,10 @@ public class PrepareConfigurationState extends State { File configDir = new File(cDir); File configFile = new File(configDir, Constants.DEFAULT_CONFIG_FILENAME); if (!configDir.exists() || !configFile.exists()) { - log.debug("Creating configuration file"); //$NON-NLS-1$ + log.debug("Creating configuration file"); // createConfiguration(configDir); } else { - log.debug("Configuration directory exists!"); //$NON-NLS-1$ + log.debug("Configuration directory exists!"); // // Check PDF-AS config version File versionFile = new File(configDir, Constants.CONFIG_VERSION_FILENAME); String configVersion = getVersion(versionFile); @@ -422,9 +422,9 @@ public class PrepareConfigurationState extends State { initializeFromArguments(stateMachine.getCmdArgs(), this.configFileHandler); } catch (InitializationException e) { - log.error("Error in cmd line arguments: ", e); //$NON-NLS-1$ + log.error("Error in cmd line arguments: ", e); // ErrorDialog error = new ErrorDialog(gui.getMainShell(), - Messages.getString("error.CmdLineArgs") + "\n" + //$NON-NLS-1$ //$NON-NLS-2$ + Messages.getString("error.CmdLineArgs") + "\n" + // // e.getMessage(), BUTTONS.OK); error.open(); @@ -440,18 +440,18 @@ public class PrepareConfigurationState extends State { initializeFromArguments(stateMachine.getCmdArgs(), this.handler); } catch (InitializationException e) { - log.error("Error in cmd line arguments: ", e); //$NON-NLS-1$ + log.error("Error in cmd line arguments: ", e); // ErrorDialog error; - + if (e.getCause() instanceof FileNotFoundException) { error = new ErrorDialog(gui.getMainShell(), String.format( - Messages.getString("error.FileNotExist"), //$NON-NLS-1$ + Messages.getString("error.FileNotExist"), // e.getCause().getMessage()), BUTTONS.OK); } else { error = new ErrorDialog(gui.getMainShell(), - Messages.getString("error.CmdLineArgs") + "\n" + //$NON-NLS-1$ //$NON-NLS-2$ + Messages.getString("error.CmdLineArgs") + "\n" + // // e.getMessage(), BUTTONS.OK); } @@ -471,7 +471,7 @@ 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) { } @@ -480,8 +480,8 @@ public class PrepareConfigurationState extends State { @Override public void run() { Dialog info = new Dialog(gui.getMainShell(), - Messages.getString("version_check.UpdateTitle"), //$NON-NLS-1$ - String.format(Messages.getString("version_check.UpdateText"), //$NON-NLS-1$ + Messages.getString("version_check.UpdateTitle"), // + String.format(Messages.getString("version_check.UpdateText"), // version), BUTTONS.OK_CANCEL, ICON.INFORMATION); if (info.open() == SWT.OK) @@ -490,17 +490,17 @@ public class PrepareConfigurationState extends State { try { Desktop.getDesktop().browse(new URI(Constants.UPDATE_URL)); } catch (Exception e) { - log.error("Error opening update location ", e); //$NON-NLS-1$ + log.error("Error opening update location ", e); // } } else { - log.info("SWT Desktop is not supported on this platform"); //$NON-NLS-1$ + log.info("SWT Desktop is not supported on this platform"); // Program.launch(Constants.UPDATE_URL); } } } }); } catch (Exception e) { - log.error("Error downloading update information: ", e); //$NON-NLS-1$ + log.error("Error downloading update information: ", e); // } } }).start(); @@ -520,10 +520,10 @@ public class PrepareConfigurationState extends State { setNextState(new OpenState(stateMachine)); } catch (InitializationException e) { - log.error("Failed to initialize: ", e); //$NON-NLS-1$ + log.error("Failed to initialize: ", e); // ErrorDialog error = new ErrorDialog(getStateMachine() .getGUIProvider().getMainShell(), - Messages.getString("error.Initialization"), //$NON-NLS-1$ + Messages.getString("error.Initialization"), // BUTTONS.OK); // error.setException(e); // setNextState(error); 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 38049be0..11f5459a 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 @@ -80,33 +80,33 @@ public class PrepareSigningState extends State { final String proxyPass = configuration.getProxyPass(); if (proxyHost != null && !proxyHost.isEmpty()) { - log.debug("Setting proxy host to " + proxyHost); //$NON-NLS-1$ - System.setProperty("http.proxyHost", proxyHost); //$NON-NLS-1$ - System.setProperty("https.proxyHost", proxyHost); //$NON-NLS-1$ + log.debug("Setting proxy host to " + proxyHost); // + System.setProperty("http.proxyHost", proxyHost); // + System.setProperty("https.proxyHost", proxyHost); // } if (proxyPort > 0 && proxyPort <= 0xFFFF) { String port = Integer.toString(proxyPort); - log.debug("Setting proxy port to " + port); //$NON-NLS-1$ - System.setProperty("http.proxyPort", port); //$NON-NLS-1$ - System.setProperty("https.proxyPort", port); //$NON-NLS-1$ + log.debug("Setting proxy port to " + port); // + System.setProperty("http.proxyPort", port); // + System.setProperty("https.proxyPort", port); // } if (proxyUser != null && !proxyUser.isEmpty()) { - log.debug("Setting proxy username to " + proxyUser); //$NON-NLS-1$ - System.setProperty("http.proxyUser", proxyUser); //$NON-NLS-1$ - System.setProperty("https.proxyUser", proxyUser); //$NON-NLS-1$ + log.debug("Setting proxy username to " + proxyUser); // + System.setProperty("http.proxyUser", proxyUser); // + System.setProperty("https.proxyUser", proxyUser); // } if (proxyPass != null) { - log.debug("Setting proxy password"); //$NON-NLS-1$ - System.setProperty("http.proxyPassword", proxyPass); //$NON-NLS-1$ - System.setProperty("https.proxyPassword", proxyPass); //$NON-NLS-1$ + log.debug("Setting proxy password"); // + System.setProperty("http.proxyPassword", proxyPass); // + System.setProperty("https.proxyPassword", proxyPass); // } if (proxyUser != null && !proxyUser.isEmpty() && proxyPass != null && !proxyPass.isEmpty()) { - log.debug("Enabling proxy authentication"); //$NON-NLS-1$ + log.debug("Enabling proxy authentication"); // Authenticator.setDefault(new Authenticator() { /* (non-Javadoc) * @see java.net.Authenticator#getPasswordAuthentication() @@ -116,7 +116,7 @@ public class PrepareSigningState extends State { if (getRequestorType() == RequestorType.PROXY) { if (getRequestingHost().equalsIgnoreCase(proxyHost) && (getRequestingPort() == proxyPort)) { - return new PasswordAuthentication(proxyUser, + return new PasswordAuthentication(proxyUser, proxyPass.toCharArray()); } } @@ -153,7 +153,7 @@ public class PrepareSigningState extends State { if (configuration.getSignatureNote() != null && !configuration.getSignatureNote().isEmpty()) { this.state.signatureParameter.setProperty( - "SIG_NOTE", configuration.getSignatureNote()); //$NON-NLS-1$ + "SIG_NOTE", configuration.getSignatureNote()); // } this.state.signatureParameter @@ -172,7 +172,7 @@ public class PrepareSigningState extends State { .prepare(this.state.signatureParameter); } catch (Exception e) { - log.error("PrepareDocumentThread: ", e); //$NON-NLS-1$ + log.error("PrepareDocumentThread: ", e); // this.state.threadException = e; } finally { this.state.updateStateMachine(); @@ -228,7 +228,7 @@ public class PrepareSigningState extends State { if (this.threadException != null) { ErrorDialog error = new ErrorDialog(getStateMachine() .getGUIProvider().getMainShell(), - Messages.getString("error.PrepareDocument"), //$NON-NLS-1$ + Messages.getString("error.PrepareDocument"), // BUTTONS.RETRY_CANCEL); this.threadException = null; if (error.open() == SWT.RETRY) { @@ -249,7 +249,7 @@ public class PrepareSigningState extends State { } else if (status.getBKU() == BKUs.KS) { this.setNextState(new KSState(getStateMachine())); } else { - log.error("Invalid selected BKU Value \"NONE\" in PrepareSigningState!"); //$NON-NLS-1$ + log.error("Invalid selected BKU Value \"NONE\" in PrepareSigningState!"); // this.setNextState(new BKUSelectionState(getStateMachine())); } } 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 4b329b47..12412b42 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 @@ -38,12 +38,12 @@ import at.asit.pdfover.signator.Signer; public class SigningState extends State { /** - * + * */ private final class FinishSignThread implements Runnable { - + private SigningState state; - + /** * @param signingState */ @@ -56,7 +56,7 @@ public class SigningState extends State { try { Signer signer = this.state.getStateMachine().getPDFSigner().getPDFSigner(); Status status = this.state.getStateMachine().getStatus(); - + status.setSignResult(signer.sign(status.getSigningState())); } catch(Exception e) { this.state.threadException = e; @@ -77,20 +77,20 @@ public class SigningState extends State { * SLF4J Logger instance **/ static final Logger log = LoggerFactory.getLogger(SigningState.class); - + Exception threadException = null; - + @Override public void run() { Status status = getStateMachine().getStatus(); - - if(status.getSignResult() == null && + + if(status.getSignResult() == null && this.threadException == null) { Thread t = new Thread(new FinishSignThread(this)); t.start(); return; } - + if(this.threadException != null) { // workaround for PDF-AS nullpointerexception intercepting our IllegalStateException // cf. issue #52 @@ -102,19 +102,19 @@ public class SigningState extends State { this.threadException = new SignatureException(new IllegalStateException()); } - String message = Messages.getString("error.Signatur"); //$NON-NLS-1$ + String message = Messages.getString("error.Signatur"); // if (this.threadException instanceof SignatureException) { Throwable cause = this.threadException; while (cause.getCause() != null) cause = cause.getCause(); if (cause instanceof ConnectException) - message += ": " + cause.getMessage(); //$NON-NLS-1$ + message += ": " + cause.getMessage(); // if (cause instanceof IllegalStateException) { // Dummy exception - don't display error, go back to BKU Selection this.setNextState(new BKUSelectionState(getStateMachine())); return; } - + } // if we have gotten to this point, this is an actual exception diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/State.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/State.java index 54842137..55aee598 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/State.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/State.java @@ -19,7 +19,7 @@ package at.asit.pdfover.gui.workflow.states; import at.asit.pdfover.gui.workflow.StateMachine; /** - * Base state class + * Base state class */ public abstract class State { @@ -38,7 +38,7 @@ public abstract class State { this.stateMachine = stateMachine; this.nextState = this; } - + /** * Gets the next logical state or null if this their is no state transition * @return the next state (or null) @@ -46,7 +46,7 @@ public abstract class State { public State nextState() { return this.nextState; } - + /** * Sets the next logical state * @param state @@ -54,7 +54,7 @@ public abstract class State { protected void setNextState(State state) { this.nextState = state; } - + /** * Perform main logic for this state */ @@ -84,7 +84,7 @@ public abstract class State { /** * Update the main window behavior of this state if necessary - * Should update this.stateMachine.getStatus().getBehavior() + * Should update this.stateMachine.getStatus().getBehavior() */ public abstract void updateMainWindowBehavior(); } -- cgit v1.2.3