This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See https://gitlab.nuiton.org/codelutin/observe.git commit c994d131c2bafde3350829949cb459b2af6a9afc Author: Tony CHEMIT <chemit@codelutin.com> Date: Fri Nov 4 17:35:49 2016 +0100 L'action «Annuler» sur l'édition d'un référentiel affiche un formulaire vide et non pas le formulaire du réferentiel en cours d'édition (Fixes #8731) --- .../application/swing/ui/actions/shared/ResetEditUIAction.java | 10 +++------- .../swing/ui/content/ref/ContentReferenceUIHandler.java | 2 ++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ResetEditUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ResetEditUIAction.java index 44db266..ec69e07 100644 --- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ResetEditUIAction.java +++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ResetEditUIAction.java @@ -27,6 +27,7 @@ import fr.ird.observe.application.swing.ui.content.ContentUI; import javax.swing.JComponent; import javax.swing.SwingUtilities; import java.awt.event.ActionEvent; +import java.util.Objects; import static org.nuiton.i18n.I18n.n; @@ -56,13 +57,8 @@ public class ResetEditUIAction extends AbstractUIAction { public void actionPerformed(final ActionEvent e) { SwingUtilities.invokeLater(() -> { JComponent c = (JComponent) e.getSource(); - ContentUI<?> ui = (ContentUI<?>) - c.getClientProperty("ui"); - if (ui == null) { - throw new IllegalStateException( - "could not find client property " + - "ui on component" + c); - } + ContentUI<?> ui = (ContentUI<?>) c.getClientProperty("ui"); + Objects.requireNonNull(ui, "could not find client property ui on component" + c); ui.resetEdit(); }); } diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUIHandler.java index 5121fa2..6705de4 100644 --- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUIHandler.java +++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUIHandler.java @@ -601,7 +601,9 @@ public class ContentReferenceUIHandler<E extends ReferentialDto> extends Content public final void resetEditUI() { ContentMode mode = getModel().getMode(); + E selectedBean = getModel().getSelectedBean(); super.resetEditUI(); + getModel().setSelectedBean(selectedBean); if (mode == ContentMode.CREATE) { createUI(); } else { -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.