This is an automated email from the git hooks/post-receive script. New commit to branch develop-4.x in repository observe. See http://git.codelutin.com/observe.git commit 4ae1f9394aa7db884c0341608be328e5a3867861 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Nov 3 17:52:24 2015 +0100 Cacher la barre d'actions une fois l'action d'ouverture de base lancée (See #7673) --- .../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 | 24 ++++++++++++++++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUI.css b/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUI.css index 1fb9545..173ea78 100644 --- a/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUI.css +++ b/observe-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-swing/src/main/java/fr/ird/observe/ui/storage/StorageUI.jaxx b/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUI.jaxx index b46f1d1..404516d 100644 --- a/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUI.jaxx +++ b/observe-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-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIHandler.java b/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIHandler.java index 360f72f..e74d350 100644 --- a/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIHandler.java +++ b/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIHandler.java @@ -317,6 +317,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-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIModel.java b/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIModel.java index 5b1a8af..74635ff 100644 --- a/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIModel.java +++ b/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIModel.java @@ -113,6 +113,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"; @@ -133,6 +135,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. */ @@ -207,6 +215,12 @@ public class StorageUIModel extends WizardModel<StorageStep> { securityModel = new SecurityModel(); } + @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. @@ -946,6 +960,16 @@ public class StorageUIModel extends WizardModel<StorageStep> { firePropertyChange(VALID_PROPERTY_NAME, isValid()); } + 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 isValid() { boolean result = false; if (dbMode != null) { -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.