This is an automated email from the git hooks/post-receive script. New commit to branch feature/7703 in repository observe. See http://git.codelutin.com/observe.git commit f0ef937fca32290bcac4c1f1cf7c9b70e313868d Author: Kevin Morin <morin@codelutin.com> Date: Thu Nov 12 11:08:02 2015 +0100 Cacher la barre d'actions une fois l'action d'ouverture de base lancée (fixes #7703) --- .../java/fr/ird/observe/ui/storage/StorageUI.css | 4 ++++ .../java/fr/ird/observe/ui/storage/StorageUI.jaxx | 2 +- .../ird/observe/ui/storage/StorageUIHandler.java | 2 ++ .../fr/ird/observe/ui/storage/StorageUIModel.java | 25 +++++++++++++++++++++- 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUI.css b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUI.css index 1fb9545..173ea78 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUI.css +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUI.css @@ -69,3 +69,7 @@ enabled:{getModel().isValidStep()}; visible:{getModel().getNextStep() == null}; } + +#actions { + visible:{!getModel().isAlreadyApplied()}; +} \ No newline at end of file diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUI.jaxx b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUI.jaxx index b46f1d1..404516d 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUI.jaxx +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUI.jaxx @@ -161,7 +161,7 @@ void $afterCompleteSetup() { onStateChanged='if (getSelectedStep() != null) { getModel().gotoStep(getSelectedStep()); }'/> <!-- les actions --> - <Table weightx='1' fill='both' constraints='BorderLayout.SOUTH'> + <Table id='actions' weightx='1' fill='both' constraints='BorderLayout.SOUTH'> <row> <cell weightx='0.5' fill="both"> <!-- pour annuler --> diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIHandler.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIHandler.java index 3fd86d7..1a6fcb0 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIHandler.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIHandler.java @@ -294,6 +294,8 @@ public class StorageUIHandler { public void launchApply(final StorageUI ui) { + ui.getModel().setAlreadyApplied(true); + Runnable action = WizardUILancher.APPLY_DEF.getContextValue(ui); if (action == null) { diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIModel.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIModel.java index 3b6657e..520fb3c 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIModel.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIModel.java @@ -132,6 +132,8 @@ public class StorageUIModel extends WizardModel<StorageStep> { public static final String VALID_PROPERTY_NAME = "valid"; + public static final String ALREADY_APPLIED_PROPERTY_NAME = "alreadyApplied"; + private static final char[] EMPTY_PASSWORD = new char[0]; private static final String LOGIN_REFERENTIEL = "referentiel"; @@ -156,6 +158,12 @@ public class StorageUIModel extends WizardModel<StorageStep> { protected boolean doBackup; /** + * Un drapeau pour savoir si on a déjà lancé l'action Appliquer (pour éviter le code ré-entrant). + * @since 4.0.4 + */ + protected boolean alreadyApplied; + + /** * le fichier ou effectuer la sauvegarde de la base locale si le drapeau * doBackup est active. */ @@ -205,7 +213,6 @@ public class StorageUIModel extends WizardModel<StorageStep> { /** le fichier d'import des donné */ protected File dumpFile; - /** le mode de creation d'une base */ protected CreationMode creationMode; @@ -300,6 +307,12 @@ public class StorageUIModel extends WizardModel<StorageStep> { addPropertyChangeListener(USE_SSL_PROPERTY_NAME, clearStatus); } + @Override + public void setStep(StorageStep step) { + setAlreadyApplied(false); + super.setStep(step); + } + /** * La méthode pour initialiser le modèle à partir du context applicatif et * d'un service existant. @@ -1071,6 +1084,16 @@ public class StorageUIModel extends WizardModel<StorageStep> { return result; } + public boolean isAlreadyApplied() { + return alreadyApplied; + } + + public void setAlreadyApplied(boolean alreadyApplied) { + boolean oldValue = isAlreadyApplied(); + this.alreadyApplied = alreadyApplied; + firePropertyChange(ALREADY_APPLIED_PROPERTY_NAME, oldValue, alreadyApplied); + } + public boolean isUseSelectData() { return getSteps() != null && getSteps().contains(StorageStep.SELECT_DATA); -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.