branch develop updated (9a32cf3 -> a22c103)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository tutti. See https://gitlab.nuiton.org/codelutin/tutti.git from 9a32cf3 Livrable #8221 Merge branch 'feature/8221' into develop new e2b48fc Suppression du veto sur le changement de screen (cela n'intervient pas au bon moment et il y a déjà une API pour gérer ça) (See #8190) new a22c103 Livrable #8190 Merge branch 'feature/8190' into develop The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit a22c1032d65d57ad9f66dfbc271a5733c3b50e30 Merge: 9a32cf3 e2b48fc Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Apr 12 05:50:05 2016 +0200 Livrable #8190 Merge branch 'feature/8190' into develop commit e2b48fcbb6d56038e1c508505feb5ce36b0a8e63 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Apr 12 05:49:56 2016 +0200 Suppression du veto sur le changement de screen (cela n'intervient pas au bon moment et il y a déjà une API pour gérer ça) (See #8190) Summary of changes: .../fr/ifremer/tutti/ui/swing/TuttiUIContext.java | 23 ++------- .../tutti/ui/swing/content/MainUIHandler.java | 56 ++++++++++------------ .../frequency/SpeciesFrequencyUIHandler.java | 20 +------- 3 files changed, 30 insertions(+), 69 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See https://gitlab.nuiton.org/codelutin/tutti.git commit e2b48fcbb6d56038e1c508505feb5ce36b0a8e63 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Apr 12 05:49:56 2016 +0200 Suppression du veto sur le changement de screen (cela n'intervient pas au bon moment et il y a déjà une API pour gérer ça) (See #8190) --- .../fr/ifremer/tutti/ui/swing/TuttiUIContext.java | 23 ++------- .../tutti/ui/swing/content/MainUIHandler.java | 56 ++++++++++------------ .../frequency/SpeciesFrequencyUIHandler.java | 20 +------- 3 files changed, 30 insertions(+), 69 deletions(-) diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java index ea9de60..55f1086 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java @@ -95,7 +95,6 @@ import javax.swing.JOptionPane; import java.awt.Color; import java.awt.Component; import java.beans.PropertyChangeListener; -import java.beans.PropertyVetoException; import java.io.Closeable; import java.io.File; import java.io.IOException; @@ -630,11 +629,6 @@ public class TuttiUIContext extends AbstractBean implements Closeable, UIMessage } setActionUI(null); - } catch (PropertyVetoException e) { - if (log.isErrorEnabled()) { - log.error("cannot change screen", e); - } - } finally { closed = true; if (lock != null) { @@ -967,9 +961,8 @@ public class TuttiUIContext extends AbstractBean implements Closeable, UIMessage return screen; } - public void setScreen(TuttiScreen screen) throws PropertyVetoException { + public void setScreen(TuttiScreen screen) { Object oldValue = getScreen(); - fireVetoableChange(PROPERTY_SCREEN, oldValue, screen); this.screen = screen; firePropertyChange(PROPERTY_SCREEN, oldValue, screen); } @@ -1154,16 +1147,10 @@ public class TuttiUIContext extends AbstractBean implements Closeable, UIMessage } public void setFallBackScreen() { - try { - if (isDbLoaded()) { - setScreen(TuttiScreen.SELECT_CRUISE); - } else { - setScreen(TuttiScreen.MANAGE_DB); - } - } catch (PropertyVetoException e) { - if (log.isErrorEnabled()) { - log.error("cannot change screen", e); - } + if (isDbLoaded()) { + setScreen(TuttiScreen.SELECT_CRUISE); + } else { + setScreen(TuttiScreen.MANAGE_DB); } } diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/MainUIHandler.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/MainUIHandler.java index ad2f818..6497829 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/MainUIHandler.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/MainUIHandler.java @@ -68,7 +68,6 @@ import java.awt.Cursor; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeListenerProxy; -import java.beans.PropertyVetoException; import java.util.Locale; import static org.nuiton.i18n.I18n.t; @@ -212,43 +211,36 @@ public class MainUIHandler extends AbstractTuttiUIHandler<TuttiUIContext, MainUI TuttiUIContext context = getContext(); // remove any screen - try { - context.setScreen(null); - context.removeMessageNotifier(this); - - // clean context - - PropertyChangeListener[] propertyChangeListeners = - context.getPropertyChangeListeners(); - for (PropertyChangeListener listener : propertyChangeListeners) { - if (listener instanceof PropertyChangeListenerProxy) { - PropertyChangeListenerProxy proxy = (PropertyChangeListenerProxy) listener; - listener = proxy.getListener(); - } - if (listener instanceof RemoveablePropertyChangeListener) { - if (log.isDebugEnabled()) { - log.debug("Remove listener: " + listener); - } - context.removePropertyChangeListener(listener); - } - } - - if (ui != null) { + context.setScreen(null); + context.removeMessageNotifier(this); - // clean ui + // clean context - JAXXBinding[] bindings = ui.getDataBindings(); - for (JAXXBinding binding : bindings) { - SwingUtil.removeDataBinding(ui, binding.getId()); + PropertyChangeListener[] propertyChangeListeners = + context.getPropertyChangeListeners(); + for (PropertyChangeListener listener : propertyChangeListeners) { + if (listener instanceof PropertyChangeListenerProxy) { + PropertyChangeListenerProxy proxy = (PropertyChangeListenerProxy) listener; + listener = proxy.getListener(); + } + if (listener instanceof RemoveablePropertyChangeListener) { + if (log.isDebugEnabled()) { + log.debug("Remove listener: " + listener); } - ui.setVisible(false); - ui.dispose(); + context.removePropertyChangeListener(listener); } + } + + if (ui != null) { + + // clean ui - } catch (PropertyVetoException e) { - if (log.isErrorEnabled()) { - log.error("cannot change screen", e); + JAXXBinding[] bindings = ui.getDataBindings(); + for (JAXXBinding binding : bindings) { + SwingUtil.removeDataBinding(ui, binding.getId()); } + ui.setVisible(false); + ui.dispose(); } } diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java index 0239e67..ee7faf3 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java @@ -119,7 +119,6 @@ import java.awt.event.MouseEvent; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.beans.PropertyVetoException; -import java.beans.VetoableChangeListener; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; @@ -130,7 +129,6 @@ import java.util.Optional; import java.util.Set; import static org.nuiton.i18n.I18n.t; -import static org.nuiton.i18n.LanguageEnum.fa; /** * @author Tony Chemit - chemit@codelutin.com @@ -179,8 +177,6 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci protected PropertyChangeListener obsChangedListener; - protected VetoableChangeListener changeScreenListener; - protected Optional<CaracteristicColumnIdentifier<IndividualObservationBatchRowModel>> maturityColumnId = Optional.empty(); protected SpeciesOrBenthosBatchUISupport speciesOrBenthosBatchUISupport; @@ -363,18 +359,6 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci }; - this.changeScreenListener = new VetoableChangeListener() { - - @Override - public void vetoableChange(PropertyChangeEvent evt) throws PropertyVetoException { - if (SpeciesFrequencyUIHandler.this.getModel().isModify()) { - if (!SpeciesFrequencyUIHandler.this.askCancelEditBeforeLeaving()) { - throw new PropertyVetoException("The user does not want to quit the screen.", evt); - } - } - } - }; - } //------------------------------------------------------------------------// @@ -866,7 +850,7 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci } individualObservationUICache.close(); - context.removeVetoableChangeListener(TuttiUIContext.PROPERTY_SCREEN, changeScreenListener); + } public void editBatch(FrequencyCellEditor editor, Optional<String> optionalTitle) { @@ -967,8 +951,6 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci model.setModify(false); - getContext().addVetoableChangeListener(TuttiUIContext.PROPERTY_SCREEN, changeScreenListener); - } finally { model.setInitBatchEdition(false); model.setCanDisplayNotifications(true); -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See https://gitlab.nuiton.org/codelutin/tutti.git commit a22c1032d65d57ad9f66dfbc271a5733c3b50e30 Merge: 9a32cf3 e2b48fc Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Apr 12 05:50:05 2016 +0200 Livrable #8190 Merge branch 'feature/8190' into develop .../fr/ifremer/tutti/ui/swing/TuttiUIContext.java | 23 ++------- .../tutti/ui/swing/content/MainUIHandler.java | 56 ++++++++++------------ .../frequency/SpeciesFrequencyUIHandler.java | 20 +------- 3 files changed, 30 insertions(+), 69 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm