branch develop updated (15967ef -> 571a41e)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository observe. See http://git.codelutin.com/observe.git from 15967ef fixes #7010: [ObServePS] Avoir plus de place pour saisir les mises en oeuvre d'un équipement Merge branch 'feature/7010' into develop new 7724404 ajout de la suppression d'une mise en oeuvre de caractéristique (refs #7012) new a7b954b fixes #7012: [ObServePS] Pouvoir supprimer une mise en oeuvre de caractéristique d'un équipement Merge branch 'feature/7012' into develop new 60d9ba6 Écoute de la sélection sur le tableau des mises en oeuvre (refs #7011) new 571a41e fixes #7011: [ObServePS] Impossible de rajouter des mises en oeuvre de caractéristique à un équipement Merge branch 'feature/7011' into develop The 4 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 571a41e42d5c1ea6ab6d2ddfdb8b81ba7eded6ed Merge: a7b954b 60d9ba6 Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Apr 22 21:54:12 2015 +0200 fixes #7011: [ObServePS] Impossible de rajouter des mises en oeuvre de caractéristique à un équipement Merge branch 'feature/7011' into develop commit 60d9ba6f50dbdeff2a181c7c96168f5aa7e2838d Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Apr 22 21:54:07 2015 +0200 Écoute de la sélection sur le tableau des mises en oeuvre (refs #7011) commit a7b954b18e05c4bd96c354291c909c770d5b4695 Merge: 15967ef 7724404 Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Apr 22 21:52:38 2015 +0200 fixes #7012: [ObServePS] Pouvoir supprimer une mise en oeuvre de caractéristique d'un équipement Merge branch 'feature/7012' into develop commit 7724404c74083d27d99345be7c09a6ae73b82c57 Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Apr 22 21:48:17 2015 +0200 ajout de la suppression d'une mise en oeuvre de caractéristique (refs #7012) Summary of changes: .../table/impl/seine/GearUseFeaturesSeineUI.css | 6 ++ .../table/impl/seine/GearUseFeaturesSeineUI.jaxx | 4 + .../impl/seine/GearUseFeaturesSeineUIHandler.java | 87 +++++++++++++++++++++- .../resources/i18n/observe-swing_en_GB.properties | 3 + .../resources/i18n/observe-swing_es_ES.properties | 3 + .../resources/i18n/observe-swing_fr_FR.properties | 3 + 6 files changed, 105 insertions(+), 1 deletion(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See http://git.codelutin.com/observe.git commit 7724404c74083d27d99345be7c09a6ae73b82c57 Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Apr 22 21:48:17 2015 +0200 ajout de la suppression d'une mise en oeuvre de caractéristique (refs #7012) --- .../table/impl/seine/GearUseFeaturesSeineUI.css | 6 ++ .../table/impl/seine/GearUseFeaturesSeineUI.jaxx | 4 ++ .../impl/seine/GearUseFeaturesSeineUIHandler.java | 83 +++++++++++++++++++++- .../resources/i18n/observe-swing_en_GB.properties | 3 + .../resources/i18n/observe-swing_es_ES.properties | 3 + .../resources/i18n/observe-swing_fr_FR.properties | 3 + 6 files changed, 101 insertions(+), 1 deletion(-) diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/GearUseFeaturesSeineUI.css b/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/GearUseFeaturesSeineUI.css index 707782e..d2f186b 100644 --- a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/GearUseFeaturesSeineUI.css +++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/GearUseFeaturesSeineUI.css @@ -89,3 +89,9 @@ _tablePropertyName: {GearUseFeaturesSeine.PROPERTY_COMMENT}; text:{getStringValue(tableEditBean.getComment())}; } + +#deleteSelectedMeasurement { + text: "observe.gearUseFeaturesSeine.action.deleteSelectedMeasurement"; + toolTipText: "observe.gearUseFeaturesSeine.action.deleteSelectedMeasurement.tip"; + actionIcon: delete; +} diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/GearUseFeaturesSeineUI.jaxx b/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/GearUseFeaturesSeineUI.jaxx index ec7d6b5..bcac11b 100644 --- a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/GearUseFeaturesSeineUI.jaxx +++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/GearUseFeaturesSeineUI.jaxx @@ -78,6 +78,10 @@ errorTableModel='{getErrorTableModel()}' context='n1-update'/> + <JPopupMenu id='measurementsTablePopup'> + <JMenuItem id='deleteSelectedMeasurement' onActionPerformed='getHandler().deleteSelectedMeasurement()'/> + </JPopupMenu> + <Table id='editorPanel' fill='both' insets='0' weighty="1"> <row> <cell weightx="1" weighty="0.9"> diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/GearUseFeaturesSeineUIHandler.java b/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/GearUseFeaturesSeineUIHandler.java index 183f188..2e4911d 100644 --- a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/GearUseFeaturesSeineUIHandler.java +++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/GearUseFeaturesSeineUIHandler.java @@ -36,10 +36,13 @@ import fr.ird.observe.entities.seine.GearUseFeaturesMeasurementSeine; import fr.ird.observe.entities.seine.GearUseFeaturesMeasurementSeineDAO; import fr.ird.observe.entities.seine.GearUseFeaturesSeine; import fr.ird.observe.entities.seine.TripSeine; +import fr.ird.observe.ui.ObserveMainUI; import fr.ird.observe.ui.UIHelper; import fr.ird.observe.ui.content.ContentMode; import fr.ird.observe.ui.content.ContentUIInitializer; import fr.ird.observe.ui.content.table.ContentTableUIHandler; +import fr.ird.observe.ui.util.table.AutotSelectRowAndShowPopupActionSupport; +import fr.ird.observe.ui.util.table.EditableTableModelSupport; import jaxx.runtime.SwingUtil; import jaxx.runtime.validator.swing.SwingValidatorMessage; import jaxx.runtime.validator.swing.SwingValidatorMessageTableModel; @@ -52,7 +55,11 @@ import org.nuiton.topia.persistence.util.TopiaEntityBinder; import org.nuiton.validator.NuitonValidatorScope; import javax.swing.JComponent; +import javax.swing.JOptionPane; +import javax.swing.JPopupMenu; +import javax.swing.JScrollPane; import javax.swing.JTable; +import javax.swing.ListSelectionModel; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; import javax.swing.table.DefaultTableCellRenderer; @@ -60,6 +67,7 @@ import java.awt.GridBagConstraints; import java.awt.Insets; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; +import java.io.Serializable; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -256,13 +264,18 @@ public class GearUseFeaturesSeineUIHandler extends ContentTableUIHandler<TripSei tableModel.installTableKeyListener(getUi().getMeasurementsTable()); tableModel.addPropertyChangeListener(GearUseFeaturesMeasurementSeinesTableModel.MODIFIED_PROPERTY, measurementsTableModelModified); + new SectionTemplatesAutotSelectRowAndShowPopupAction(getUi(), getUi().getMeasurementsScrollPane(), table, getUi().getMeasurementsTablePopup()); + } + // Adapt layout to let more place for the editor + getUi().getShowForm().remove(1); getUi().getShowForm().add(SwingUtil.boxComponentWithJxLayer(getUi().getEditor()), new GridBagConstraints(0, 1, 1, 1, 1.0, 0.3, 10, 1, new Insets(0, 0, 0, 0), 0, 0), 1); - getUi().getEditor().remove(0); getUi().getEditor().add(SwingUtil.boxComponentWithJxLayer(getUi().getEditorPanel()), new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, 10, 1, new Insets(0, 0, 0, 0), 0, 0), 0); + + } @Override @@ -342,6 +355,41 @@ public class GearUseFeaturesSeineUIHandler extends ContentTableUIHandler<TripSei } + public void deleteSelectedMeasurement() { + + GearUseFeaturesMeasurementSeinesTableModel tableModel = getUi().getMeasurementsTableModel(); + + boolean selectionEmpty = tableModel.isSelectionEmpty(); + + if (!selectionEmpty) { + + GearUseFeaturesMeasurementSeine data = tableModel.getSelectedRow(); + + if (log.isInfoEnabled()) { + log.info("Delete: " + data); + } + + ObserveMainUI mainUI = ObserveContext.get().getObserveMainUI(); + int response = UIHelper.askUser(mainUI, + t("observe.title.delete"), + t("observe.measurement.delete.message"), + JOptionPane.WARNING_MESSAGE, + new Object[]{t("observe.choice.confirm.delete"), + t("observe.choice.cancel")}, + 1); + + if (response != 0) { + + // user cancel + return; + } + + tableModel.removeSelectedRow(); + + } + + } + @Override protected TripSeine onCreate(TopiaContext tx, Object parentBean, TripSeine editBean) throws TopiaException { @@ -498,4 +546,37 @@ public class GearUseFeaturesSeineUIHandler extends ContentTableUIHandler<TripSei } } + + static class SectionTemplatesAutotSelectRowAndShowPopupAction extends AutotSelectRowAndShowPopupActionSupport { + + private final GearUseFeaturesSeineUI ui; + + public SectionTemplatesAutotSelectRowAndShowPopupAction(GearUseFeaturesSeineUI ui, + JScrollPane pane, + JTable table, + JPopupMenu popup) { + super(pane, table, popup); + this.ui = ui; + } + + @Override + protected void beforeOpenPopup(int modelRowIndex, int modelColumnIndex) { + + EditableTableModelSupport model = (EditableTableModelSupport) getTable().getModel(); + + boolean canDelete = !model.isSelectionEmpty(); + + if (canDelete) { + + // check also that the row is not empty + Serializable selectedData = model.getSelectedRow(); + canDelete = model.isRowNotEmpty(selectedData); + + } + + ui.getDeleteSelectedMeasurement().setEnabled(canDelete); + + } + + } } \ No newline at end of file diff --git a/observe-swing/src/main/resources/i18n/observe-swing_en_GB.properties b/observe-swing/src/main/resources/i18n/observe-swing_en_GB.properties index d73bedb..8f762c2 100644 --- a/observe-swing/src/main/resources/i18n/observe-swing_en_GB.properties +++ b/observe-swing/src/main/resources/i18n/observe-swing_en_GB.properties @@ -1042,6 +1042,8 @@ observe.gear.selectedGearCaracteristic=Selected caracteristics observe.gear.tab.gearCaracteristic=Caracteristics of the gear observe.gear.tab.general=General caracteristics observe.gear.unit=Unit +observe.gearUseFeaturesSeine.action.deleteSelectedMeasurement= +observe.gearUseFeaturesSeine.action.deleteSelectedMeasurement.tip= observe.gearUseFeaturesSeine.comment=Comment observe.gearUseFeaturesSeine.gear=Gear observe.gearUseFeaturesSeine.number=Number @@ -1225,6 +1227,7 @@ observe.longlineGlobalComposition.tab.floatlinesComposition=Floatines observe.longlineGlobalComposition.tab.hooksComposition=Hooks observe.longlineGlobalComposition.tab.mitigationType=Mitigation observe.longlineGlobalComposition.title=Global composition +observe.measurement.delete.message= observe.menu.actions=Actions observe.menu.application.locale=Application observe.menu.configuration=Configuration diff --git a/observe-swing/src/main/resources/i18n/observe-swing_es_ES.properties b/observe-swing/src/main/resources/i18n/observe-swing_es_ES.properties index 7c004e2..8d47d26 100644 --- a/observe-swing/src/main/resources/i18n/observe-swing_es_ES.properties +++ b/observe-swing/src/main/resources/i18n/observe-swing_es_ES.properties @@ -1042,6 +1042,8 @@ observe.gear.selectedGearCaracteristic= observe.gear.tab.gearCaracteristic= observe.gear.tab.general= observe.gear.unit= +observe.gearUseFeaturesSeine.action.deleteSelectedMeasurement= +observe.gearUseFeaturesSeine.action.deleteSelectedMeasurement.tip= observe.gearUseFeaturesSeine.comment= observe.gearUseFeaturesSeine.gear= observe.gearUseFeaturesSeine.number= @@ -1225,6 +1227,7 @@ observe.longlineGlobalComposition.tab.floatlinesComposition= observe.longlineGlobalComposition.tab.hooksComposition= observe.longlineGlobalComposition.tab.mitigationType= observe.longlineGlobalComposition.title= +observe.measurement.delete.message= observe.menu.actions=Acciones observe.menu.application.locale=Aplicación observe.menu.configuration=Configuración diff --git a/observe-swing/src/main/resources/i18n/observe-swing_fr_FR.properties b/observe-swing/src/main/resources/i18n/observe-swing_fr_FR.properties index 1b9f0e4..80a126d 100644 --- a/observe-swing/src/main/resources/i18n/observe-swing_fr_FR.properties +++ b/observe-swing/src/main/resources/i18n/observe-swing_fr_FR.properties @@ -1042,6 +1042,8 @@ observe.gear.selectedGearCaracteristic=Caractéristiques utilisées observe.gear.tab.gearCaracteristic=Caractéristiques de l'équipement observe.gear.tab.general=Caractéristiques générales observe.gear.unit=Unité +observe.gearUseFeaturesSeine.action.deleteSelectedMeasurement=Supprimer +observe.gearUseFeaturesSeine.action.deleteSelectedMeasurement.tip=Supprimer la caractéristique observe.gearUseFeaturesSeine.comment=Commentaire observe.gearUseFeaturesSeine.gear=Équipement observe.gearUseFeaturesSeine.number=Nombre @@ -1223,6 +1225,7 @@ observe.longlineGlobalComposition.tab.floatlinesComposition=Orins observe.longlineGlobalComposition.tab.hooksComposition=Hameçons observe.longlineGlobalComposition.tab.mitigationType=Atténuations observe.longlineGlobalComposition.title=Composition globale de la palangre +observe.measurement.delete.message=Supprimer la caractéristique sélectionnée observe.menu.actions=Actions observe.menu.application.locale=Application observe.menu.configuration=Configuration -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See http://git.codelutin.com/observe.git commit a7b954b18e05c4bd96c354291c909c770d5b4695 Merge: 15967ef 7724404 Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Apr 22 21:52:38 2015 +0200 fixes #7012: [ObServePS] Pouvoir supprimer une mise en oeuvre de caractéristique d'un équipement Merge branch 'feature/7012' into develop .../table/impl/seine/GearUseFeaturesSeineUI.css | 6 ++ .../table/impl/seine/GearUseFeaturesSeineUI.jaxx | 4 ++ .../impl/seine/GearUseFeaturesSeineUIHandler.java | 83 +++++++++++++++++++++- .../resources/i18n/observe-swing_en_GB.properties | 3 + .../resources/i18n/observe-swing_es_ES.properties | 3 + .../resources/i18n/observe-swing_fr_FR.properties | 3 + 6 files changed, 101 insertions(+), 1 deletion(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See http://git.codelutin.com/observe.git commit 60d9ba6f50dbdeff2a181c7c96168f5aa7e2838d Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Apr 22 21:54:07 2015 +0200 Écoute de la sélection sur le tableau des mises en oeuvre (refs #7011) --- .../ui/content/table/impl/seine/GearUseFeaturesSeineUIHandler.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/GearUseFeaturesSeineUIHandler.java b/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/GearUseFeaturesSeineUIHandler.java index 2e4911d..5fa35cc 100644 --- a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/GearUseFeaturesSeineUIHandler.java +++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/GearUseFeaturesSeineUIHandler.java @@ -264,6 +264,10 @@ public class GearUseFeaturesSeineUIHandler extends ContentTableUIHandler<TripSei tableModel.installTableKeyListener(getUi().getMeasurementsTable()); tableModel.addPropertyChangeListener(GearUseFeaturesMeasurementSeinesTableModel.MODIFIED_PROPERTY, measurementsTableModelModified); + ListSelectionModel selectionModel = table.getSelectionModel(); + selectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + tableModel.installSelectionListener(table); + new SectionTemplatesAutotSelectRowAndShowPopupAction(getUi(), getUi().getMeasurementsScrollPane(), table, getUi().getMeasurementsTablePopup()); } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See http://git.codelutin.com/observe.git commit 571a41e42d5c1ea6ab6d2ddfdb8b81ba7eded6ed Merge: a7b954b 60d9ba6 Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Apr 22 21:54:12 2015 +0200 fixes #7011: [ObServePS] Impossible de rajouter des mises en oeuvre de caractéristique à un équipement Merge branch 'feature/7011' into develop .../ui/content/table/impl/seine/GearUseFeaturesSeineUIHandler.java | 4 ++++ 1 file changed, 4 insertions(+) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
participants (1)
-
codelutin.com scm