From d6aa86ff603d7acaba3137cec1484d54bae3731b Mon Sep 17 00:00:00 2001 From: Tobias Kellner Date: Thu, 30 Jun 2016 13:56:55 +0200 Subject: Clicking on Open in Open state opens the file dialog --- .../at/asit/pdfover/gui/workflow/states/OpenState.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 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/states/OpenState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java index 87792309..b77809ed 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 @@ -57,9 +57,6 @@ public class OpenState extends State { @Override public void run() { - - - Status status = getStateMachine().getStatus(); if (!(status.getPreviousState() instanceof PrepareConfigurationState) && !(status.getPreviousState() instanceof OpenState)) @@ -87,7 +84,15 @@ public class OpenState extends State { log.debug("Got Datasource: " + getStateMachine().getStatus().getDocument().getAbsolutePath()); //$NON-NLS-1$ this.setNextState(new PositioningState(getStateMachine())); } - + + /** + * Open the input document selection dialog + */ + public void openFileDialog() { + if (this.selectionComposite != null) + this.selectionComposite.openFileDialog(); + } + /* (non-Javadoc) * @see at.asit.pdfover.gui.workflow.states.State#cleanUp() */ @@ -105,6 +110,7 @@ public class OpenState extends State { MainWindowBehavior behavior = getStateMachine().getStatus().getBehavior(); behavior.reset(); behavior.setEnabled(Buttons.CONFIG, true); + behavior.setEnabled(Buttons.OPEN, true); behavior.setActive(Buttons.OPEN, true); } -- cgit v1.2.3