summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/CLIArgument.java
diff options
context:
space:
mode:
authortkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 19:28:04 +0000
committertkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 19:28:04 +0000
commitc2602f46edd68e81cf66fffca3d0dccfdfab4ddc (patch)
treeeaf399ea3fa1844c13f707a70f8950570ddd81f7 /pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/CLIArgument.java
parent07c7efdfe42ccde13d777df7a6ba0a5c3e335b4f (diff)
downloadpdf-over-c2602f46edd68e81cf66fffca3d0dccfdfab4ddc.tar.gz
pdf-over-c2602f46edd68e81cf66fffca3d0dccfdfab4ddc.tar.bz2
pdf-over-c2602f46edd68e81cf66fffca3d0dccfdfab4ddc.zip
Configuration overlay added
* Commandline configuration will be stored in an overlay * This overlay won't be shown on the configuration page * This overlay won't be saved * Also slightly reworked CLI Argument creation git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@336 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/CLIArgument.java')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/CLIArgument.java49
1 files changed, 39 insertions, 10 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/CLIArgument.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/CLIArgument.java
index 26c3d12f..4c471118 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/CLIArgument.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/CLIArgument.java
@@ -16,17 +16,21 @@
package at.asit.pdfover.gui.cliarguments;
import at.asit.pdfover.gui.exceptions.InitializationException;
+import at.asit.pdfover.gui.workflow.ConfigOverlayManipulator;
import at.asit.pdfover.gui.workflow.StateMachine;
+import at.asit.pdfover.gui.workflow.Status;
/**
* CLI Argument base class
*/
public abstract class CLIArgument {
-
+
private String helpText = null;
-
+
private String[] commandOptions = null;
-
+
+ private StateMachine stateMachine;
+
/**
* @param commandOptions
* @param helpText
@@ -35,7 +39,33 @@ public abstract class CLIArgument {
this.helpText = helpText;
this.commandOptions = commandOptions;
}
-
+
+ /**
+ * Set the state machine
+ * Used for configuration overlay manipulator and status
+ * @param stateMachine the state machine
+ */
+ protected void setStateMachine(StateMachine stateMachine) {
+ this.stateMachine = stateMachine;
+ }
+
+ /**
+ * Get the configuration overlay manipulator
+ * @return the configuration overlay manipulator
+ */
+ protected ConfigOverlayManipulator getConfiguration() {
+ return this.stateMachine.getConfigOverlayManipulator();
+ }
+
+ /**
+ * Get the status
+ * @return the status
+ */
+ protected Status getStatus() {
+ return this.stateMachine.getStatus();
+ }
+
+
/**
* Set help text
*
@@ -44,7 +74,7 @@ public abstract class CLIArgument {
protected void setHelpText(String value) {
this.helpText = value;
}
-
+
/**
* Gets help text
*
@@ -53,7 +83,7 @@ public abstract class CLIArgument {
public String getHelpText() {
return this.helpText;
}
-
+
/**
* Set the command option in format: -...
*
@@ -64,7 +94,7 @@ public abstract class CLIArgument {
protected void setCommandOptions(String[] value) {
this.commandOptions = value;
}
-
+
/**
* Get the command option
*
@@ -74,7 +104,7 @@ public abstract class CLIArgument {
public String[] getCommandOptions() {
return this.commandOptions;
}
-
+
/**
* Invokes the argument to set stuff within the stateMachine
*
@@ -91,12 +121,11 @@ public abstract class CLIArgument {
* offset = 1
* returns 2
*
- * @param stateMachine
* @param args
* @param argOffset
* @param handler
* @return returns the argumentOffset ending the section of this Argument
* @throws InitializationException
*/
- public abstract int handleArgument(String[] args, int argOffset, StateMachine stateMachine, ArgumentHandler handler) throws InitializationException;
+ public abstract int handleArgument(String[] args, int argOffset, ArgumentHandler handler) throws InitializationException;
}