r989 - in trunk/tutti-ui-swing/src/main: java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter java/fr/ifremer/tutti/ui/swing/content/operation/catches/species resources/i18n
Author: kmorin Date: 2013-05-23 12:08:12 +0200 (Thu, 23 May 2013) New Revision: 989 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/989 Log: fixes #2491 [ERGO] Suppression lot : avoir un message de confirmation Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/RemoveAccidentalBatchAction.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/RemoveBenthosBatchAction.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/RemoveBenthosSubBatchAction.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/RemoveIndividualObservationBatchAction.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/RemoveMarineLitterBatchAction.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/RemoveSpeciesBatchAction.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/RemoveSpeciesSubBatchAction.java trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/RemoveAccidentalBatchAction.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/RemoveAccidentalBatchAction.java 2013-05-23 10:07:41 UTC (rev 988) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/RemoveAccidentalBatchAction.java 2013-05-23 10:08:12 UTC (rev 989) @@ -31,6 +31,10 @@ import org.apache.commons.logging.LogFactory; import org.jdesktop.swingx.JXTable; +import javax.swing.*; + +import static org.nuiton.i18n.I18n._; + /** * @author kmorin <kmorin@codelutin.com> * @since 1.4 @@ -47,6 +51,21 @@ int rowIndex; @Override + protected boolean prepareAction() throws Exception { + boolean result = super.prepareAction(); + + if (result) { + int answer = JOptionPane.showConfirmDialog(getContext().getActionUI(), + _("tutti.editAccidentalBatch.action.removeBatch.confirm.message"), + _("tutti.editAccidentalBatch.action.removeBatch.confirm.title"), + JOptionPane.YES_NO_OPTION); + result = answer == JOptionPane.YES_OPTION; + } + + return result; + } + + @Override protected void doAction() throws Exception { JXTable table = handler.getTable(); Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/RemoveBenthosBatchAction.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/RemoveBenthosBatchAction.java 2013-05-23 10:07:41 UTC (rev 988) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/RemoveBenthosBatchAction.java 2013-05-23 10:08:12 UTC (rev 989) @@ -35,8 +35,11 @@ import org.apache.commons.logging.LogFactory; import org.jdesktop.swingx.JXTable; +import javax.swing.*; import java.util.Set; +import static org.nuiton.i18n.I18n._; + /** * To remove a species batch and all his children. * @@ -49,12 +52,23 @@ private static final Log log = LogFactory.getLog(RemoveBenthosBatchAction.class); - protected RemoveBenthosSubBatchAction removeSpeciesSubBatchAction; - public RemoveBenthosBatchAction(BenthosBatchUIHandler handler) { super(handler, false); + } - removeSpeciesSubBatchAction = new RemoveBenthosSubBatchAction(handler); + @Override + protected boolean prepareAction() throws Exception { + boolean result = super.prepareAction(); + + if (result) { + int answer = JOptionPane.showConfirmDialog(getContext().getActionUI(), + _("tutti.editBenthosBatch.action.removeBatch.confirm.message"), + _("tutti.editBenthosBatch.action.removeBatch.confirm.title"), + JOptionPane.YES_NO_OPTION); + result = answer == JOptionPane.YES_OPTION; + } + + return result; } @Override Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/RemoveBenthosSubBatchAction.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/RemoveBenthosSubBatchAction.java 2013-05-23 10:07:41 UTC (rev 988) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/RemoveBenthosSubBatchAction.java 2013-05-23 10:08:12 UTC (rev 989) @@ -32,8 +32,11 @@ import fr.ifremer.tutti.ui.swing.util.table.AbstractSelectTableAction; import org.jdesktop.swingx.JXTable; +import javax.swing.*; import java.util.Set; +import static org.nuiton.i18n.I18n._; + /** * To remove a species batch children. * @@ -47,6 +50,21 @@ } @Override + protected boolean prepareAction() throws Exception { + boolean result = super.prepareAction(); + + if (result) { + int answer = JOptionPane.showConfirmDialog(getContext().getActionUI(), + _("tutti.editBenthosBatch.action.removeSubBatch.confirm.message"), + _("tutti.editBenthosBatch.action.removeSubBatch.confirm.title"), + JOptionPane.YES_NO_OPTION); + result = answer == JOptionPane.YES_OPTION; + } + + return result; + } + + @Override protected void doAction() throws Exception { TuttiPersistence persistenceService = Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/RemoveIndividualObservationBatchAction.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/RemoveIndividualObservationBatchAction.java 2013-05-23 10:07:41 UTC (rev 988) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/RemoveIndividualObservationBatchAction.java 2013-05-23 10:08:12 UTC (rev 989) @@ -31,6 +31,10 @@ import org.apache.commons.logging.LogFactory; import org.jdesktop.swingx.JXTable; +import javax.swing.*; + +import static org.nuiton.i18n.I18n._; + /** * @author kmorin <kmorin@codelutin.com> * @since 1.4 @@ -48,6 +52,21 @@ int rowIndex; @Override + protected boolean prepareAction() throws Exception { + boolean result = super.prepareAction(); + + if (result) { + int answer = JOptionPane.showConfirmDialog(getContext().getActionUI(), + _("tutti.editIndividualObservationBatch.action.removeBatch.confirm.message"), + _("tutti.editIndividualObservationBatch.action.removeBatch.confirm.title"), + JOptionPane.YES_NO_OPTION); + result = answer == JOptionPane.YES_OPTION; + } + + return result; + } + + @Override protected void doAction() throws Exception { JXTable table = handler.getTable(); Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/RemoveMarineLitterBatchAction.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/RemoveMarineLitterBatchAction.java 2013-05-23 10:07:41 UTC (rev 988) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/RemoveMarineLitterBatchAction.java 2013-05-23 10:08:12 UTC (rev 989) @@ -34,6 +34,10 @@ import org.apache.commons.logging.LogFactory; import org.jdesktop.swingx.JXTable; +import javax.swing.*; + +import static org.nuiton.i18n.I18n._; + /** * To remove a selected marine litter batch in the table. * @@ -55,6 +59,21 @@ int rowIndex; @Override + protected boolean prepareAction() throws Exception { + boolean result = super.prepareAction(); + + if (result) { + int answer = JOptionPane.showConfirmDialog(getContext().getActionUI(), + _("tutti.editMarineLitterBatch.action.removeBatch.confirm.message"), + _("tutti.editMarineLitterBatch.action.removeBatch.confirm.title"), + JOptionPane.YES_NO_OPTION); + result = answer == JOptionPane.YES_OPTION; + } + + return result; + } + + @Override protected void doAction() throws Exception { JXTable table = handler.getTable(); Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/RemoveSpeciesBatchAction.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/RemoveSpeciesBatchAction.java 2013-05-23 10:07:41 UTC (rev 988) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/RemoveSpeciesBatchAction.java 2013-05-23 10:08:12 UTC (rev 989) @@ -35,8 +35,11 @@ import org.apache.commons.logging.LogFactory; import org.jdesktop.swingx.JXTable; +import javax.swing.*; import java.util.Set; +import static org.nuiton.i18n.I18n._; + /** * To remove a species batch and all his children. * @@ -49,12 +52,23 @@ private static final Log log = LogFactory.getLog(RemoveSpeciesBatchAction.class); - protected RemoveSpeciesSubBatchAction removeSpeciesSubBatchAction; - public RemoveSpeciesBatchAction(SpeciesBatchUIHandler handler) { super(handler, false); + } - removeSpeciesSubBatchAction = new RemoveSpeciesSubBatchAction(handler); + @Override + protected boolean prepareAction() throws Exception { + boolean result = super.prepareAction(); + + if (result) { + int answer = JOptionPane.showConfirmDialog(getContext().getActionUI(), + _("tutti.editSpeciesBatch.action.removeBatch.confirm.message"), + _("tutti.editSpeciesBatch.action.removeBatch.confirm.title"), + JOptionPane.YES_NO_OPTION); + result = answer == JOptionPane.YES_OPTION; + } + + return result; } @Override Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/RemoveSpeciesSubBatchAction.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/RemoveSpeciesSubBatchAction.java 2013-05-23 10:07:41 UTC (rev 988) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/RemoveSpeciesSubBatchAction.java 2013-05-23 10:08:12 UTC (rev 989) @@ -32,8 +32,11 @@ import fr.ifremer.tutti.ui.swing.util.table.AbstractSelectTableAction; import org.jdesktop.swingx.JXTable; +import javax.swing.*; import java.util.Set; +import static org.nuiton.i18n.I18n._; + /** * To remove a species batch children. * @@ -47,6 +50,21 @@ } @Override + protected boolean prepareAction() throws Exception { + boolean result = super.prepareAction(); + + if (result) { + int answer = JOptionPane.showConfirmDialog(getContext().getActionUI(), + _("tutti.editSpeciesBatch.action.removeSubBatch.confirm.message"), + _("tutti.editSpeciesBatch.action.removeSubBatch.confirm.title"), + JOptionPane.YES_NO_OPTION); + result = answer == JOptionPane.YES_OPTION; + } + + return result; + } + + @Override protected void doAction() throws Exception { TuttiPersistence persistenceService = Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties =================================================================== --- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-05-23 10:07:41 UTC (rev 988) +++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-05-23 10:08:12 UTC (rev 989) @@ -278,6 +278,8 @@ tutti.editAccidentalBatch.action.importMultiPost.success= tutti.editAccidentalBatch.action.importMultiPost.tip= tutti.editAccidentalBatch.action.removeBatch= +tutti.editAccidentalBatch.action.removeBatch.confirm.message= +tutti.editAccidentalBatch.action.removeBatch.confirm.title= tutti.editAccidentalBatch.action.removeBatch.mnemonic= tutti.editAccidentalBatch.action.removeBatch.tip= tutti.editAccidentalBatch.table.header.comment= @@ -317,9 +319,13 @@ tutti.editBenthosBatch.action.importMultiPost.success= tutti.editBenthosBatch.action.importMultiPost.tip= tutti.editBenthosBatch.action.removeBatch= +tutti.editBenthosBatch.action.removeBatch.confirm.message= +tutti.editBenthosBatch.action.removeBatch.confirm.title= tutti.editBenthosBatch.action.removeBatch.mnemonic= tutti.editBenthosBatch.action.removeBatch.tip= tutti.editBenthosBatch.action.removeSubBatch= +tutti.editBenthosBatch.action.removeSubBatch.confirm.message= +tutti.editBenthosBatch.action.removeSubBatch.confirm.title= tutti.editBenthosBatch.action.removeSubBatch.mnemonic= tutti.editBenthosBatch.action.removeSubBatch.tip= tutti.editBenthosBatch.action.renameBatch= @@ -643,6 +649,8 @@ tutti.editIndividualObservationBatch.action.importMultiPost.success= tutti.editIndividualObservationBatch.action.importMultiPost.tip= tutti.editIndividualObservationBatch.action.removeBatch= +tutti.editIndividualObservationBatch.action.removeBatch.confirm.message= +tutti.editIndividualObservationBatch.action.removeBatch.confirm.title= tutti.editIndividualObservationBatch.action.removeBatch.mnemonic= tutti.editIndividualObservationBatch.action.removeBatch.tip= tutti.editIndividualObservationBatch.table.header.calcifiedPieceSamplingCode= @@ -688,6 +696,8 @@ tutti.editMarineLitterBatch.action.importMultiPost.success= tutti.editMarineLitterBatch.action.importMultiPost.tip= tutti.editMarineLitterBatch.action.removeBatch= +tutti.editMarineLitterBatch.action.removeBatch.confirm.message= +tutti.editMarineLitterBatch.action.removeBatch.confirm.title= tutti.editMarineLitterBatch.action.removeBatch.mnemonic= tutti.editMarineLitterBatch.action.removeBatch.tip= tutti.editMarineLitterBatch.field.marineLitterTotalWeight= @@ -851,9 +861,13 @@ tutti.editSpeciesBatch.action.importMultiPost.success= tutti.editSpeciesBatch.action.importMultiPost.tip= tutti.editSpeciesBatch.action.removeBatch= +tutti.editSpeciesBatch.action.removeBatch.confirm.message= +tutti.editSpeciesBatch.action.removeBatch.confirm.title= tutti.editSpeciesBatch.action.removeBatch.mnemonic= tutti.editSpeciesBatch.action.removeBatch.tip= tutti.editSpeciesBatch.action.removeSubBatch= +tutti.editSpeciesBatch.action.removeSubBatch.confirm.message= +tutti.editSpeciesBatch.action.removeSubBatch.confirm.title= tutti.editSpeciesBatch.action.removeSubBatch.mnemonic= tutti.editSpeciesBatch.action.removeSubBatch.tip= tutti.editSpeciesBatch.action.renameBatch= Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties =================================================================== --- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-05-23 10:07:41 UTC (rev 988) +++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-05-23 10:08:12 UTC (rev 989) @@ -272,6 +272,8 @@ tutti.editAccidentalBatch.action.importMultiPost.success=Des lots de captures accidentelles ont été importés depuis le fichier %s tutti.editAccidentalBatch.action.importMultiPost.tip=Importer des captures accidentelles créées sur un poste satellite tutti.editAccidentalBatch.action.removeBatch=Supprimer la capture courante +tutti.editAccidentalBatch.action.removeBatch.confirm.message=Vous êtes sur le point de supprimer une capture accidentelle. Êtes-vous sur de vouloir la supprimer ? +tutti.editAccidentalBatch.action.removeBatch.confirm.title=Suppression d'une capture accidentelle tutti.editAccidentalBatch.action.removeBatch.mnemonic=S tutti.editAccidentalBatch.action.removeBatch.tip=Supprimer la capture courante (celle de la ligne sélectionnée) tutti.editAccidentalBatch.table.header.comment=Commentaire @@ -311,9 +313,13 @@ tutti.editBenthosBatch.action.importMultiPost.success=Des lots de benthos ont été importés depuis le fichier %s tutti.editBenthosBatch.action.importMultiPost.tip=Importer des lots de benthos créés sur un poste satellite tutti.editBenthosBatch.action.removeBatch=Supprimer le lot +tutti.editBenthosBatch.action.removeBatch.confirm.message=Vous êtes sur le point de supprimer un lot de benthos. Êtes-vous sur de vouloir le supprimer ? +tutti.editBenthosBatch.action.removeBatch.confirm.title=Suppression d'un lot de benthos tutti.editBenthosBatch.action.removeBatch.mnemonic=S tutti.editBenthosBatch.action.removeBatch.tip=Supprimer le lot courant (celui de la ligne sélectionnée) et tous ces fils tutti.editBenthosBatch.action.removeSubBatch=Supprimer les lots fils +tutti.editBenthosBatch.action.removeSubBatch.confirm.message=Vous êtes sur le point de supprimer les fils d'un lot de benthos. Êtes-vous sur de vouloir les supprimer ? +tutti.editBenthosBatch.action.removeSubBatch.confirm.title=Suppression des fils d'un lot de benthos tutti.editBenthosBatch.action.removeSubBatch.mnemonic=f tutti.editBenthosBatch.action.removeSubBatch.tip=Supprimer tous les lots fils du lot sélectionné tutti.editBenthosBatch.action.renameBatch=Corriger l'espèce @@ -626,6 +632,8 @@ tutti.editIndividualObservationBatch.action.importMultiPost.success=Des lots d'observations individuelles ont été importés depuis le fichier %s tutti.editIndividualObservationBatch.action.importMultiPost.tip=Importer des observations créées sur un poste satellite tutti.editIndividualObservationBatch.action.removeBatch=Supprimer la ligne sélectionnée +tutti.editIndividualObservationBatch.action.removeBatch.confirm.message=Vous êtes sur le point de supprimer une observation individuelle. Êtes-vous sur de vouloir la supprimer ? +tutti.editIndividualObservationBatch.action.removeBatch.confirm.title=Suppression d'une observation individuelle tutti.editIndividualObservationBatch.action.removeBatch.mnemonic=S tutti.editIndividualObservationBatch.action.removeBatch.tip=Supprimer la ligne sélectionnée tutti.editIndividualObservationBatch.table.header.calcifiedPieceSamplingCode=Code de prélèvement pièce calcifiée @@ -671,6 +679,8 @@ tutti.editMarineLitterBatch.action.importMultiPost.success=Des lots de déchets ont été importés depuis le fichier %s tutti.editMarineLitterBatch.action.importMultiPost.tip=Importer des lots de déchets créés sur un poste satellite tutti.editMarineLitterBatch.action.removeBatch=Supprimer la ligne sélectionnée +tutti.editMarineLitterBatch.action.removeBatch.confirm.message=Vous êtes sur le point de supprimer un lot de déchets. Êtes-vous sur de vouloir le supprimer ? +tutti.editMarineLitterBatch.action.removeBatch.confirm.title=Suppression d'un lot de déchets tutti.editMarineLitterBatch.action.removeBatch.mnemonic=S tutti.editMarineLitterBatch.action.removeBatch.tip=Supprimer la ligne sélectionnée tutti.editMarineLitterBatch.field.marineLitterTotalWeight=Poids total (Kg) @@ -816,9 +826,13 @@ tutti.editSpeciesBatch.action.importMultiPost.success=Des lots d'espèces ont été importés depuis le fichier %s tutti.editSpeciesBatch.action.importMultiPost.tip=Importer des lots d'espèces créés sur un poste satellite tutti.editSpeciesBatch.action.removeBatch=Supprimer le lot +tutti.editSpeciesBatch.action.removeBatch.confirm.message=Vous êtes sur le point de supprimer un lot d'espèces. Êtes-vous sur de vouloir le supprimer ? +tutti.editSpeciesBatch.action.removeBatch.confirm.title=Suppression d'un lot d'espèces tutti.editSpeciesBatch.action.removeBatch.mnemonic=S tutti.editSpeciesBatch.action.removeBatch.tip=Supprimer le lot courant (celui de la ligne sélectionnée) et tous ces fils tutti.editSpeciesBatch.action.removeSubBatch=Supprimer les lots fils +tutti.editSpeciesBatch.action.removeSubBatch.confirm.message=Vous êtes sur le point de supprimer les fils d'un lot d'espèces. Êtes-vous sur de vouloir les supprimer ? +tutti.editSpeciesBatch.action.removeSubBatch.confirm.title=Suppression des fils d'un lot d'espèces tutti.editSpeciesBatch.action.removeSubBatch.mnemonic=f tutti.editSpeciesBatch.action.removeSubBatch.tip=Supprimer tous les lots fils du lot sélectionné tutti.editSpeciesBatch.action.renameBatch=Corriger l'espèce
participants (1)
-
kmorin@users.forge.codelutin.com