branch develop updated (62ee1a4 -> 7d19452)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository observe. See https://gitlab.nuiton.org/codelutin/observe.git from 62ee1a4 [PS] Unicité des enregistrements des rejets de thons à modifier (Fixes #7510) new 3bbaad5 Remove unused code new 7d19452 [LL][PS] Possibilité de saisie directe au clavier des dates/heures sans passer par le calendrier (Fixes #7877) 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 7d19452861cc1a3f51319db0fa56672f59d604e6 Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Nov 2 12:28:46 2016 +0100 [LL][PS] Possibilité de saisie directe au clavier des dates/heures sans passer par le calendrier (Fixes #7877) commit 3bbaad58ec811e91d519a3f43ecd77362bc51676 Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Nov 2 11:37:42 2016 +0100 Remove unused code Summary of changes: .../swing/ui/content/ContentUIInitializer.java | 49 ++++++++++++++++++++-- .../impl/seine/TargetDiscardCatchUIHandler.java | 25 ----------- 2 files changed, 45 insertions(+), 29 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 observe. See https://gitlab.nuiton.org/codelutin/observe.git commit 3bbaad58ec811e91d519a3f43ecd77362bc51676 Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Nov 2 11:37:42 2016 +0100 Remove unused code --- .../impl/seine/TargetDiscardCatchUIHandler.java | 25 ---------------------- 1 file changed, 25 deletions(-) diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetDiscardCatchUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetDiscardCatchUIHandler.java index bf23f7f..89bb705 100644 --- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetDiscardCatchUIHandler.java +++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetDiscardCatchUIHandler.java @@ -76,31 +76,6 @@ public class TargetDiscardCatchUIHandler extends ContentTableUIHandler<SetSeineT public TargetDiscardCatchUIHandler(TargetDiscardCatchUI ui) { super(ui, DataContextType.SetSeine); } -// -// protected static Collection<ReferentialReference<WeightCategoryDto>> getWeightCategoryUsed( -// ContentTableModel<SetSeineTargetCatchDto, TargetCatchDto> model) { -// -// List<ReferentialReference<WeightCategoryDto>> list = model.getColumnValues(1); -// Collection<ReferentialReference<WeightCategoryDto>> set = Sets.newHashSet(list); -// list.clear(); -// return set; -// } -// -// protected static Collection<ReferentialReference<ReasonForDiscardDto>> getReasonForDiscardUsed( -// ContentTableModel<SetSeineTargetCatchDto, TargetCatchDto> model, -// ReferentialReference<WeightCategoryDto> weightCategory) { -// -// Collection<ReferentialReference<ReasonForDiscardDto>> set = Sets.newHashSet(); -// if (weightCategory != null) { -// for (int i = 0; i < model.getRowCount(); i++) { -// TargetCatchDto c = model.getValueAt(i); -// if (c != null && weightCategory.equals(c.getWeightCategory()) && c.getReasonForDiscard() != null) { -// set.add(c.getReasonForDiscard()); -// } -// } -// } -// return set; -// } @Override public TargetDiscardCatchUI getUi() { -- 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 observe. See https://gitlab.nuiton.org/codelutin/observe.git commit 7d19452861cc1a3f51319db0fa56672f59d604e6 Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Nov 2 12:28:46 2016 +0100 [LL][PS] Possibilité de saisie directe au clavier des dates/heures sans passer par le calendrier (Fixes #7877) --- .../swing/ui/content/ContentUIInitializer.java | 49 ++++++++++++++++++++-- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java index d673053..bca314e 100644 --- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java +++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java @@ -24,6 +24,7 @@ package fr.ird.observe.application.swing.ui.content; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; +import fr.ird.observe.application.swing.I18nEnumHelper; import fr.ird.observe.application.swing.ObserveSwingApplicationContext; import fr.ird.observe.application.swing.decoration.DecoratorService; import fr.ird.observe.application.swing.decoration.ObserveI18nDecoratorHelper; @@ -33,7 +34,6 @@ import fr.ird.observe.application.swing.ui.actions.shared.AbstractUIAction; import fr.ird.observe.application.swing.ui.util.BooleanEditor; import fr.ird.observe.application.swing.ui.util.tripMap.ObserveMapPane; import fr.ird.observe.application.swing.validation.ObserveSwingValidator; -import fr.ird.observe.application.swing.I18nEnumHelper; import fr.ird.observe.services.dto.AbstractReference; import fr.ird.observe.services.dto.DataDto; import fr.ird.observe.services.dto.DataReference; @@ -74,6 +74,7 @@ import javax.swing.ActionMap; import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JComponent; +import javax.swing.JFormattedTextField; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JScrollBar; @@ -93,6 +94,7 @@ import java.awt.event.FocusEvent; import java.awt.event.ItemEvent; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; +import java.text.ParseException; import java.util.ArrayList; import java.util.Collections; import java.util.Date; @@ -336,7 +338,7 @@ public class ContentUIInitializer<E extends IdDto, UI extends ObserveContentUI<E // l'action n'est pas enregistrée throw new IllegalStateException( "action [" + actionId + "] not found for ui " + - ui.getClass().getName()); + ui.getClass().getName()); } if (log.isDebugEnabled()) { @@ -428,6 +430,25 @@ public class ContentUIInitializer<E extends IdDto, UI extends ObserveContentUI<E addAutoSelectOnFocus((JSpinner.DateEditor) editor.getHourEditor().getEditor()); addAutoSelectOnFocus((JSpinner.DateEditor) editor.getMinuteEditor().getEditor()); + addAutoSelectOnFocus(editor.getDayDateEditor().getEditor()); + editor.getDayDateEditor().getEditor().addFocusListener(new FocusAdapter() { + @Override + public void focusLost(FocusEvent e) { + + JFormattedTextField source = (JFormattedTextField) e.getSource(); + if (source.isEditValid()) { + try { + editor.getDayDateEditor().commitEdit(); + if (log.isInfoEnabled()) { + log.info("quit date editor, commit value: " + source.getValue()); + } + } catch (ParseException e1) { + // l'édition est valide donc pas de problème ici + } + } + super.focusLost(e); + } + }); } } @@ -525,9 +546,10 @@ public class ContentUIInitializer<E extends IdDto, UI extends ObserveContentUI<E protected void init(JXDatePicker picker) { if (log.isDebugEnabled()) { - log.debug("disable JXDatePicker editor" + picker.getName()); + log.debug("init JXDatePicker editor" + picker.getName()); } - picker.getEditor().setEditable(false); + JFormattedTextField editor = picker.getEditor(); + editor.setEditable(true); JXMonthView monthView = new JXMonthView(); monthView.setLowerBound(DateUtil.createDate(1, 1, 1970)); monthView.setTraversable(true); @@ -543,6 +565,25 @@ public class ContentUIInitializer<E extends IdDto, UI extends ObserveContentUI<E }); } + addAutoSelectOnFocus(editor); + editor.addFocusListener(new FocusAdapter() { + @Override + public void focusLost(FocusEvent e) { + + JFormattedTextField source = (JFormattedTextField) e.getSource(); + if (source.isEditValid()) { + try { + picker.commitEdit(); + if (log.isInfoEnabled()) { + log.info("quit date editor, commit value: " + source.getValue()); + } + } catch (ParseException e1) { + // l'édition est valide donc pas de problème ici + } + } + super.focusLost(e); + } + }); } protected <B extends Enum<B>> void init(EnumEditor<B> editor) { -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm