Author: tchemit Date: 2013-09-19 16:09:05 +0200 (Thu, 19 Sep 2013) New Revision: 1192 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1192 Log: fixes #3280: [CAPTURE] ?\195?\160 la cr?\195?\169ation d'un lot, scanner le protocole et proposer la cat?\195?\169gorisation du protocole Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchRowModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchTableModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchRowModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchTableModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIModel-error-validation.xml trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIModel-error-validation.xml 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/benthos/create/CreateBenthosBatchUI.css =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.css 2013-09-19 09:41:01 UTC (rev 1191) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.css 2013-09-19 14:09:05 UTC (rev 1192) @@ -105,7 +105,12 @@ } #categoryComboBox { + property: selectedCategory; + sortable: false; + showDecorator: false; + showReset: false; selectedItem: {model.getSelectedCategory()}; + data: {model.getCategory()}; } #sampleWeightLabel { Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.jaxx 2013-09-19 09:41:01 UTC (rev 1191) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.jaxx 2013-09-19 14:09:05 UTC (rev 1192) @@ -144,8 +144,9 @@ <JLabel id='categoryLabel'/> </cell> <cell weightx='1.0'> - <JComboBox id='categoryComboBox' - onActionPerformed="model.setSelectedCategory((SampleCategoryModelEntry) categoryComboBox.getSelectedItem());"/> + <BeanFilterableComboBox id='categoryComboBox' + constructorParams='this' + genericType='SampleCategoryModelEntry'/> </cell> </row> Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java 2013-09-19 09:41:01 UTC (rev 1191) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java 2013-09-19 14:09:05 UTC (rev 1192) @@ -43,7 +43,6 @@ import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.BenthosBatchUIModel; import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.split.SplitBenthosBatchRowModel; import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.split.SplitBenthosBatchTableModel; -import fr.ifremer.tutti.ui.swing.content.operation.catches.species.create.CreateSpeciesBatchUIModel; import fr.ifremer.tutti.ui.swing.util.Cancelable; import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor; import fr.ifremer.tutti.ui.swing.util.TuttiUI; @@ -57,7 +56,6 @@ import org.jdesktop.swingx.JXTable; import org.jdesktop.swingx.table.DefaultTableColumnModelExt; -import javax.swing.DefaultComboBoxModel; import javax.swing.JComponent; import java.awt.Dimension; import java.beans.PropertyChangeEvent; @@ -80,17 +78,17 @@ private final CaracteristicQualitativeValue sortedValue; - protected boolean categoryIsAdjusting; + private SampleCategoryModel sampleCategoryModel; public CreateBenthosBatchUIHandler(TuttiUI parentUi, CreateBenthosBatchUI ui) { super(parentUi.getHandler().getContext(), ui, + SplitBenthosBatchRowModel.PROPERTY_SELECTED, SplitBenthosBatchRowModel.PROPERTY_CATEGORY_VALUE, SplitBenthosBatchRowModel.PROPERTY_WEIGHT); this.persistenceService = context.getPersistenceService(); - SampleCategoryModel sampleCategoryModel = - getDataContext().getSampleCategoryModel(); + this.sampleCategoryModel = getDataContext().getSampleCategoryModel(); SampleCategoryModelEntry caracteristic = sampleCategoryModel.getCategoryById(sampleCategoryModel.getFirstCategoryId()); @@ -124,7 +122,7 @@ @Override protected boolean isRowValid(SplitBenthosBatchRowModel row) { - return row.isValid(); + return row.isSelected(); } @Override @@ -143,19 +141,33 @@ } @Override + protected void onAfterSelectedRowChanged(int oldRowIndex, + SplitBenthosBatchRowModel oldRow, + int newRowIndex, + SplitBenthosBatchRowModel newRow) { + super.onAfterSelectedRowChanged(oldRowIndex, oldRow, newRowIndex, newRow); + if (newRow != null) { + + // Recompute the valid state of the row + recomputeRowValidState(newRow); + + // Need to recompute the sample weight + computeSampleWeight(); + } + } + + @Override protected void onRowModified(int rowIndex, SplitBenthosBatchRowModel row, String propertyName, Object oldValue, Object newValue) { + // Recompute the valid state of the row recomputeRowValidState(row); - if (SplitBenthosBatchRowModel.PROPERTY_WEIGHT.equals(propertyName)) { - - // Need to recompute the sample weight - computeSampleWeight(row); - } + // Need to recompute the sample weight + computeSampleWeight(); } //------------------------------------------------------------------------// @@ -165,8 +177,6 @@ @Override public void beforeInitUI() { - SampleCategoryModel sampleCategoryModel = - getDataContext().getSampleCategoryModel(); CreateBenthosBatchUIModel model = new CreateBenthosBatchUIModel(sampleCategoryModel); ui.setContextValue(model); @@ -183,6 +193,18 @@ null, DecoratorService.FROM_PROTOCOL); + List<SampleCategoryModelEntry> categories = Lists.newArrayList(); + + // add all categories + categories.addAll(sampleCategoryModel.getCategory()); + + // remove the first one (V/HV) + categories.remove(0); + + initBeanFilterableComboBox(ui.getCategoryComboBox(), + Lists.<SampleCategoryModelEntry>newArrayList(categories), + null); + Caracteristic caracteristic = persistenceService.getSortedUnsortedCaracteristic(); @@ -206,12 +228,9 @@ if (newValue == null || source.getSpeciesUsed() == null) { - // reste V/HV category + // reset V/HV category source.setSampleCategory(null); - // reset categories - source.setCategory(null); - } else { // look for best value for V/HV category : if sorted is available then use it @@ -232,41 +251,12 @@ } source.setSampleCategory(newCategory); - // recompute possible categories - List<SampleCategoryModelEntry> categories = Lists.newArrayList(); - - SampleCategoryModel sampleCategoryModel = - getModel().getSampleCategoryModel(); - - // add all categories - categories.addAll(sampleCategoryModel.getCategory()); - - // remove the first one (V/HV) - categories.remove(0); - // reset selected category if (log.isInfoEnabled()) { log.info("Remove selected category before changing the categories..."); } source.setSelectedCategory(null); - categoryIsAdjusting = true; - - try { - - // set universe of categories - if (log.isInfoEnabled()) { - log.info("Categories to use: " + categories); - } - - source.setCategory(categories); - - // force to remove the first selected value of the combo-box - ui.getCategoryComboBox().setSelectedItem(null); - } finally { - categoryIsAdjusting = false; - } - // compute the selected sample category SampleCategoryModelEntry selectedCategory = null; @@ -294,6 +284,8 @@ if (selectedCategory == null) { // by default use the first one + List<SampleCategoryModelEntry> categories = + getUI().getCategoryComboBox().getData(); selectedCategory = categories.get(0); if (log.isInfoEnabled()) { @@ -304,56 +296,33 @@ if (log.isInfoEnabled()) { log.info("Selected category : " + selectedCategory); } - ui.getCategoryComboBox().setSelectedItem(selectedCategory); - } - } - }); + // force reset of selected category + source.setSelectedCategory(null); - // when category changed, remove selected category - model.addPropertyChangeListener(CreateSpeciesBatchUIModel.PROPERTY_CATEGORY, new PropertyChangeListener() { - @Override - public void propertyChange(PropertyChangeEvent evt) { - -// CreateSpeciesBatchUIModel source = -// (CreateSpeciesBatchUIModel) evt.getSource(); - -// // unselect previous selected category -// source.setSelectedCategory(null); - - // fill comboBox with new list - List<SampleCategoryModelEntry> data = (List<SampleCategoryModelEntry>) evt.getNewValue(); - if (data == null) { - - ui.getCategoryComboBox().setModel(new DefaultComboBoxModel()); - } else { - ui.getCategoryComboBox().setModel(new DefaultComboBoxModel(data.toArray())); + // set new selected category + source.setSelectedCategory(selectedCategory); } } }); // when selected category changed, regenerate the table model + add inside some default rows - model.addPropertyChangeListener(CreateSpeciesBatchUIModel.PROPERTY_SELECTED_CATEGORY, new PropertyChangeListener() { + model.addPropertyChangeListener(CreateBenthosBatchUIModel.PROPERTY_SELECTED_CATEGORY, new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { - if (!categoryIsAdjusting) { + // can change the selected category + CreateBenthosBatchUIModel source = + (CreateBenthosBatchUIModel) evt.getSource(); - // can change the selected category - CreateSpeciesBatchUIModel source = - (CreateSpeciesBatchUIModel) evt.getSource(); + // when selected category change, sample total weight is reset + source.setSampleWeight(null); - // when selected category change, sample total weight is reset - source.setSampleWeight(null); - - SampleCategoryModelEntry newValue = - (SampleCategoryModelEntry) evt.getNewValue(); - generateTableModel(newValue); - } + SampleCategoryModelEntry newValue = + (SampleCategoryModelEntry) evt.getNewValue(); + generateTableModel(newValue); } }); - ui.getCategoryComboBox().setRenderer(newListCellRender(SampleCategoryModelEntry.class)); - generateTableModel(null); initTable(getTable()); @@ -437,31 +406,31 @@ model.setAvailableSpecies(speciesToUse); } - public void saveAndClose() { + public void saveAndContinue() { if (log.isDebugEnabled()) { - log.debug("Save and close UI " + ui); + log.debug("Save and Continue UI " + ui); } EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class); - parent.getBenthosTabContent().getHandler().addBatch(getModel()); + BenthosBatchUI benthosTabContent = parent.getBenthosTabContent(); + benthosTabContent.getHandler().addBatch(getModel()); - // close dialog - closeUI(ui); + // re-open this screen + openUI(benthosTabContent.getModel()); } - public void saveAndContinue() { + public void saveAndClose() { if (log.isDebugEnabled()) { - log.debug("Save and continue UI " + ui); + log.debug("Save and Close UI " + ui); } EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class); - BenthosBatchUI benthosTabContent = parent.getBenthosTabContent(); - benthosTabContent.getHandler().addBatch(getModel()); + parent.getBenthosTabContent().getHandler().addBatch(getModel()); - // re-open this screen - openUI(benthosTabContent.getModel()); + // close dialog + closeUI(ui); } public Species openAddSpeciesDialog(String title, List<Species> species) { @@ -480,21 +449,19 @@ //-- Internal methods --// //------------------------------------------------------------------------// - protected void computeSampleWeight(SplitBenthosBatchRowModel row) { + protected void computeSampleWeight() { - if (log.isInfoEnabled()) { - log.info("Will recompute sample weight from row: " + row); - } - Float result = null; List<SplitBenthosBatchRowModel> rows = getTableModel().getRows(); - for (SplitBenthosBatchRowModel rowModel : rows) { - Float weight = rowModel.getWeight(); - if (weight != null) { - if (result == null) { - result = 0f; + for (SplitBenthosBatchRowModel row : rows) { + if (row.isSelected()) { + Float weight = row.getWeight(); + if (weight != null) { + if (result == null) { + result = 0f; + } + result += weight; } - result += weight; } } getModel().setSampleWeight(result); @@ -502,8 +469,8 @@ protected void generateTableModel(SampleCategoryModelEntry category) { - if (log.isInfoEnabled()) { - log.info("Generate table model for category " + category); + if (log.isDebugEnabled()) { + log.debug("Generate table model for category " + category); } // when generate a new table model, then reset previous rows from model getModel().setRows(null); @@ -536,8 +503,8 @@ if (data != null) { - if (log.isInfoEnabled()) { - log.info("Got " + data.sizeQualitativeValue() + " qualitative data to add"); + if (log.isDebugEnabled()) { + log.debug("Got " + data.sizeQualitativeValue() + " qualitative data to add"); } addColumnToModel(columnModel, null, Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIModel.java 2013-09-19 09:41:01 UTC (rev 1191) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIModel.java 2013-09-19 14:09:05 UTC (rev 1192) @@ -32,7 +32,6 @@ import fr.ifremer.tutti.persistence.entities.referential.Species; import fr.ifremer.tutti.ui.swing.content.operation.catches.SelectedCategoryAble; import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.split.SplitBenthosBatchRowModel; -import fr.ifremer.tutti.ui.swing.content.operation.catches.species.create.CreateSpeciesBatchUI; import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIModel; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -40,7 +39,7 @@ import java.util.List; /** - * Model of {@link CreateSpeciesBatchUI}. + * Model of {@link CreateBenthosBatchUI}. * * @author tchemit <chemit@codelutin.com> * @since 0.3 @@ -250,6 +249,20 @@ return result; } + public boolean isCategoryIsFilled() { + boolean result = selectedCategory != null; + if (result) { + result = false; + for (SplitBenthosBatchRowModel rowModel : getRows()) { + if (rowModel.isValid()) { + result = true; + break; + } + } + } + return result; + } + @Override protected CreateBenthosBatchUIModel newEntity() { return new CreateBenthosBatchUIModel(sampleCategoryModel); Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchRowModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchRowModel.java 2013-09-19 09:41:01 UTC (rev 1191) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchRowModel.java 2013-09-19 14:09:05 UTC (rev 1192) @@ -49,6 +49,8 @@ public static final String PROPERTY_WEIGHT = "weight"; + public static final String PROPERTY_SELECTED = "selected"; + /** * Delegate sample category which contains category value + weight. * @@ -56,6 +58,8 @@ */ protected final SampleCategory<Serializable> category = SampleCategory.newSample(null); + protected boolean selected; + protected static final Binder<SplitBenthosBatchRowModel, SplitBenthosBatchRowModel> fromBeanBinder = BinderFactory.newBinder(SplitBenthosBatchRowModel.class, SplitBenthosBatchRowModel.class); @@ -108,6 +112,16 @@ firePropertyChange(PROPERTY_WEIGHT, oldValue, weight); } + public boolean isSelected() { + return selected; + } + + public void setSelected(boolean selected) { + Object oldValue = isSelected(); + this.selected = selected; + firePropertyChange(PROPERTY_SELECTED, oldValue, selected); + } + @Override protected SplitBenthosBatchRowModel newEntity() { return new SplitBenthosBatchRowModel(); Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchTableModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchTableModel.java 2013-09-19 09:41:01 UTC (rev 1191) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchTableModel.java 2013-09-19 14:09:05 UTC (rev 1192) @@ -43,7 +43,7 @@ private static final long serialVersionUID = 1L; public static final ColumnIdentifier<SplitBenthosBatchRowModel> SELECTED = ColumnIdentifier.newId( - SplitBenthosBatchRowModel.PROPERTY_VALID, + SplitBenthosBatchRowModel.PROPERTY_SELECTED, n_("tutti.splitBenthosBatch.table.header.selected"), n_("tutti.splitBenthosBatch.table.header.selected")); Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIHandler.java 2013-09-19 09:41:01 UTC (rev 1191) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIHandler.java 2013-09-19 14:09:05 UTC (rev 1192) @@ -34,7 +34,6 @@ import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI; import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIHandler; import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.BenthosBatchRowModel; -import fr.ifremer.tutti.ui.swing.content.operation.catches.species.split.SplitSpeciesBatchTableModel; import fr.ifremer.tutti.ui.swing.util.Cancelable; import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor; import fr.ifremer.tutti.ui.swing.util.TuttiUI; @@ -72,6 +71,7 @@ public SplitBenthosBatchUIHandler(EditCatchesUI parentUi, SplitBenthosBatchUI ui) { super(parentUi.getHandler().getContext(), ui, + SplitBenthosBatchRowModel.PROPERTY_SELECTED, SplitBenthosBatchRowModel.PROPERTY_CATEGORY_VALUE, SplitBenthosBatchRowModel.PROPERTY_WEIGHT); } @@ -92,7 +92,7 @@ @Override protected boolean isRowValid(SplitBenthosBatchRowModel row) { - return row.isValid(); + return row.isSelected(); } @Override @@ -110,20 +110,32 @@ } } + @Override + protected void onAfterSelectedRowChanged(int oldRowIndex, SplitBenthosBatchRowModel oldRow, int newRowIndex, SplitBenthosBatchRowModel newRow) { + super.onAfterSelectedRowChanged(oldRowIndex, oldRow, newRowIndex, newRow); + if (newRow != null) { + + // Recompute the valid state of the row + recomputeRowValidState(newRow); + + // Need to recompute the sample weight + computeSampleWeight(); + } + } + + @Override protected void onRowModified(int rowIndex, SplitBenthosBatchRowModel row, String propertyName, Object oldValue, Object newValue) { + // Recompute the valid state of the row recomputeRowValidState(row); - if (SplitBenthosBatchRowModel.PROPERTY_WEIGHT.equals(propertyName)) { - - // Need to recompute the sample weight - computeSampleWeight(row); - } + // Need to recompute the sample weight + computeSampleWeight(); } //------------------------------------------------------------------------// @@ -316,21 +328,19 @@ //-- Internal methods --// //------------------------------------------------------------------------// - protected void computeSampleWeight(SplitBenthosBatchRowModel row) { + protected void computeSampleWeight() { - if (log.isDebugEnabled()) { - log.debug("Will recompute sample weight from row: " + row); - } - Float result = null; List<SplitBenthosBatchRowModel> rows = getTableModel().getRows(); - for (SplitBenthosBatchRowModel rowModel : rows) { - Float weight = rowModel.getWeight(); - if (weight != null) { - if (result == null) { - result = 0f; + for (SplitBenthosBatchRowModel row : rows) { + if (row.isSelected()) { + Float weight = row.getWeight(); + if (weight != null) { + if (result == null) { + result = 0f; + } + result += weight; } - result += weight; } } getModel().setSampleWeight(result); @@ -361,7 +371,7 @@ } else { editableCategoryValue = true; addFloatColumnToModel(columnModel, - SplitSpeciesBatchTableModel.EDITABLE_CATEGORY_VALUE, + SplitBenthosBatchTableModel.EDITABLE_CATEGORY_VALUE, TuttiUI.DECIMAL1_PATTERN); } @@ -373,12 +383,12 @@ addColumnToModel(columnModel, null, newTableCellRender(CaracteristicQualitativeValue.class), - SplitSpeciesBatchTableModel.READ_ONLY_CATEGORY_VALUE); + SplitBenthosBatchTableModel.READ_ONLY_CATEGORY_VALUE); } { // Weight addFloatColumnToModel(columnModel, - SplitSpeciesBatchTableModel.WEIGHT, + SplitBenthosBatchTableModel.WEIGHT, TuttiUI.DECIMAL3_PATTERN); } } Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.css =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.css 2013-09-19 09:41:01 UTC (rev 1191) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.css 2013-09-19 14:09:05 UTC (rev 1192) @@ -105,7 +105,12 @@ } #categoryComboBox { + property: selectedCategory; + sortable: false; + showDecorator: false; + showReset: false; selectedItem: {model.getSelectedCategory()}; + data: {model.getCategory()}; } #sampleWeightLabel { Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.jaxx 2013-09-19 09:41:01 UTC (rev 1191) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.jaxx 2013-09-19 14:09:05 UTC (rev 1192) @@ -144,8 +144,9 @@ <JLabel id='categoryLabel'/> </cell> <cell weightx='1.0'> - <JComboBox id='categoryComboBox' - onActionPerformed="model.setSelectedCategory((SampleCategoryModelEntry) categoryComboBox.getSelectedItem());"/> + <BeanFilterableComboBox id='categoryComboBox' + constructorParams='this' + genericType='SampleCategoryModelEntry'/> </cell> </row> Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java 2013-09-19 09:41:01 UTC (rev 1191) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java 2013-09-19 14:09:05 UTC (rev 1192) @@ -56,7 +56,6 @@ import org.jdesktop.swingx.JXTable; import org.jdesktop.swingx.table.DefaultTableColumnModelExt; -import javax.swing.DefaultComboBoxModel; import javax.swing.JComponent; import java.awt.Dimension; import java.beans.PropertyChangeEvent; @@ -80,17 +79,17 @@ private final CaracteristicQualitativeValue sortedValue; - protected boolean categoryIsAdjusting; + private SampleCategoryModel sampleCategoryModel; public CreateSpeciesBatchUIHandler(TuttiUI parentUi, CreateSpeciesBatchUI ui) { super(parentUi.getHandler().getContext(), ui, + SplitSpeciesBatchRowModel.PROPERTY_SELECTED, SplitSpeciesBatchRowModel.PROPERTY_CATEGORY_VALUE, SplitSpeciesBatchRowModel.PROPERTY_WEIGHT); this.persistenceService = context.getPersistenceService(); - SampleCategoryModel sampleCategoryModel = - getDataContext().getSampleCategoryModel(); + this.sampleCategoryModel = getDataContext().getSampleCategoryModel(); SampleCategoryModelEntry caracteristic = sampleCategoryModel.getCategoryById(sampleCategoryModel.getFirstCategoryId()); @@ -124,7 +123,7 @@ @Override protected boolean isRowValid(SplitSpeciesBatchRowModel row) { - return row.isValid(); + return row.isSelected(); } @Override @@ -143,19 +142,33 @@ } @Override + protected void onAfterSelectedRowChanged(int oldRowIndex, + SplitSpeciesBatchRowModel oldRow, + int newRowIndex, + SplitSpeciesBatchRowModel newRow) { + super.onAfterSelectedRowChanged(oldRowIndex, oldRow, newRowIndex, newRow); + if (newRow != null) { + + // Recompute the valid state of the row + recomputeRowValidState(newRow); + + // Need to recompute the sample weight + computeSampleWeight(); + } + } + + @Override protected void onRowModified(int rowIndex, SplitSpeciesBatchRowModel row, String propertyName, Object oldValue, Object newValue) { + // Recompute the valid state of the row recomputeRowValidState(row); - if (SplitSpeciesBatchRowModel.PROPERTY_WEIGHT.equals(propertyName)) { - - // Need to recompute the sample weight - computeSampleWeight(row); - } + // Need to recompute the sample weight + computeSampleWeight(); } //------------------------------------------------------------------------// @@ -165,8 +178,6 @@ @Override public void beforeInitUI() { - SampleCategoryModel sampleCategoryModel = - getDataContext().getSampleCategoryModel(); CreateSpeciesBatchUIModel model = new CreateSpeciesBatchUIModel(sampleCategoryModel); ui.setContextValue(model); @@ -183,6 +194,18 @@ null, DecoratorService.FROM_PROTOCOL); + List<SampleCategoryModelEntry> categories = Lists.newArrayList(); + + // add all categories + categories.addAll(sampleCategoryModel.getCategory()); + + // remove the first one (V/HV) + categories.remove(0); + + initBeanFilterableComboBox(ui.getCategoryComboBox(), + Lists.<SampleCategoryModelEntry>newArrayList(categories), + null); + Caracteristic caracteristic = persistenceService.getSortedUnsortedCaracteristic(); @@ -206,12 +229,9 @@ if (newValue == null || source.getSpeciesUsed() == null) { - // reste V/HV category + // reset V/HV category source.setSampleCategory(null); - // reset categories - source.setCategory(null); - } else { // look for best value for V/HV category : if sorted is available then use it @@ -232,41 +252,12 @@ } source.setSampleCategory(newCategory); - // recompute possible categories - List<SampleCategoryModelEntry> categories = Lists.newArrayList(); - - SampleCategoryModel sampleCategoryModel = - getModel().getSampleCategoryModel(); - - // add all categories - categories.addAll(sampleCategoryModel.getCategory()); - - // remove the first one (V/HV) - categories.remove(0); - // reset selected category if (log.isInfoEnabled()) { log.info("Remove selected category before changing the categories..."); } source.setSelectedCategory(null); - categoryIsAdjusting = true; - - try { - - // set universe of categories - if (log.isInfoEnabled()) { - log.info("Categories to use: " + categories); - } - - source.setCategory(categories); - - // force to remove the first selected value of the combo-box - ui.getCategoryComboBox().setSelectedItem(null); - } finally { - categoryIsAdjusting = false; - } - // compute the selected sample category SampleCategoryModelEntry selectedCategory = null; @@ -294,6 +285,8 @@ if (selectedCategory == null) { // by default use the first one + List<SampleCategoryModelEntry> categories = + getUI().getCategoryComboBox().getData(); selectedCategory = categories.get(0); if (log.isInfoEnabled()) { @@ -304,29 +297,11 @@ if (log.isInfoEnabled()) { log.info("Selected category : " + selectedCategory); } - ui.getCategoryComboBox().setSelectedItem(selectedCategory); - } - } - }); + // force reset of selected category + source.setSelectedCategory(null); - // when category changed, remove selected category - model.addPropertyChangeListener(CreateSpeciesBatchUIModel.PROPERTY_CATEGORY, new PropertyChangeListener() { - @Override - public void propertyChange(PropertyChangeEvent evt) { - -// CreateSpeciesBatchUIModel source = -// (CreateSpeciesBatchUIModel) evt.getSource(); - -// // unselect previous selected category -// source.setSelectedCategory(null); - - // fill comboBox with new list - List<SampleCategoryModelEntry> data = (List<SampleCategoryModelEntry>) evt.getNewValue(); - if (data == null) { - - ui.getCategoryComboBox().setModel(new DefaultComboBoxModel()); - } else { - ui.getCategoryComboBox().setModel(new DefaultComboBoxModel(data.toArray())); + // set new selected category + source.setSelectedCategory(selectedCategory); } } }); @@ -336,24 +311,19 @@ @Override public void propertyChange(PropertyChangeEvent evt) { - if (!categoryIsAdjusting) { + // can change the selected category + CreateSpeciesBatchUIModel source = + (CreateSpeciesBatchUIModel) evt.getSource(); - // can change the selected category - CreateSpeciesBatchUIModel source = - (CreateSpeciesBatchUIModel) evt.getSource(); + // when selected category change, sample total weight is reset + source.setSampleWeight(null); - // when selected category change, sample total weight is reset - source.setSampleWeight(null); - - SampleCategoryModelEntry newValue = - (SampleCategoryModelEntry) evt.getNewValue(); - generateTableModel(newValue); - } + SampleCategoryModelEntry newValue = + (SampleCategoryModelEntry) evt.getNewValue(); + generateTableModel(newValue); } }); - ui.getCategoryComboBox().setRenderer(newListCellRender(SampleCategoryModelEntry.class)); - generateTableModel(null); initTable(getTable()); @@ -439,7 +409,7 @@ public void saveAndContinue() { if (log.isDebugEnabled()) { - log.debug("Save UI " + ui); + log.debug("Save And Continue UI " + ui); } EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class); @@ -479,21 +449,19 @@ //-- Internal methods --// //------------------------------------------------------------------------// - protected void computeSampleWeight(SplitSpeciesBatchRowModel row) { + protected void computeSampleWeight() { - if (log.isInfoEnabled()) { - log.info("Will recompute sample weight from row: " + row); - } - Float result = null; List<SplitSpeciesBatchRowModel> rows = getTableModel().getRows(); - for (SplitSpeciesBatchRowModel rowModel : rows) { - Float weight = rowModel.getWeight(); - if (weight != null) { - if (result == null) { - result = 0f; + for (SplitSpeciesBatchRowModel row : rows) { + if (row.isSelected()) { + Float weight = row.getWeight(); + if (weight != null) { + if (result == null) { + result = 0f; + } + result += weight; } - result += weight; } } getModel().setSampleWeight(result); @@ -501,8 +469,8 @@ protected void generateTableModel(SampleCategoryModelEntry category) { - if (log.isInfoEnabled()) { - log.info("Generate table model for category " + category); + if (log.isDebugEnabled()) { + log.debug("Generate table model for category " + category); } // when generate a new table model, then reset previous rows from model getModel().setRows(null); @@ -535,8 +503,8 @@ if (data != null) { - if (log.isInfoEnabled()) { - log.info("Got " + data.sizeQualitativeValue() + " qualitative data to add"); + if (log.isDebugEnabled()) { + log.debug("Got " + data.sizeQualitativeValue() + " qualitative data to add"); } addColumnToModel(columnModel, null, Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIModel.java 2013-09-19 09:41:01 UTC (rev 1191) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIModel.java 2013-09-19 14:09:05 UTC (rev 1192) @@ -250,6 +250,20 @@ return result; } + public boolean isCategoryIsFilled() { + boolean result = selectedCategory != null; + if (result) { + result = false; + for (SplitSpeciesBatchRowModel rowModel : getRows()) { + if (rowModel.isValid()) { + result = true; + break; + } + } + } + return result; + } + @Override protected CreateSpeciesBatchUIModel newEntity() { return new CreateSpeciesBatchUIModel(sampleCategoryModel); Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchRowModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchRowModel.java 2013-09-19 09:41:01 UTC (rev 1191) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchRowModel.java 2013-09-19 14:09:05 UTC (rev 1192) @@ -46,6 +46,8 @@ public static final String PROPERTY_WEIGHT = "weight"; + public static final String PROPERTY_SELECTED = "selected"; + /** * Delegate sample category which contains category value + weight. * @@ -53,6 +55,8 @@ */ protected final SampleCategory<Serializable> category = SampleCategory.newSample(null); + protected boolean selected; + public SplitSpeciesBatchRowModel() { super(SplitSpeciesBatchRowModel.class, null, null); } @@ -97,6 +101,16 @@ firePropertyChange(PROPERTY_WEIGHT, oldValue, weight); } + public boolean isSelected() { + return selected; + } + + public void setSelected(boolean selected) { + Object oldValue = isSelected(); + this.selected = selected; + firePropertyChange(PROPERTY_SELECTED, oldValue, selected); + } + @Override protected SplitSpeciesBatchRowModel newEntity() { return new SplitSpeciesBatchRowModel(); Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchTableModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchTableModel.java 2013-09-19 09:41:01 UTC (rev 1191) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchTableModel.java 2013-09-19 14:09:05 UTC (rev 1192) @@ -43,7 +43,7 @@ private static final long serialVersionUID = 1L; public static final ColumnIdentifier<SplitSpeciesBatchRowModel> SELECTED = ColumnIdentifier.newId( - SplitSpeciesBatchRowModel.PROPERTY_VALID, + SplitSpeciesBatchRowModel.PROPERTY_SELECTED, n_("tutti.splitSpeciesBatch.table.header.selected"), n_("tutti.splitSpeciesBatch.table.header.selected")); Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java 2013-09-19 09:41:01 UTC (rev 1191) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java 2013-09-19 14:09:05 UTC (rev 1192) @@ -71,6 +71,7 @@ public SplitSpeciesBatchUIHandler(EditCatchesUI parentUi, SplitSpeciesBatchUI ui) { super(parentUi.getHandler().getContext(), ui, + SplitSpeciesBatchRowModel.PROPERTY_SELECTED, SplitSpeciesBatchRowModel.PROPERTY_CATEGORY_VALUE, SplitSpeciesBatchRowModel.PROPERTY_WEIGHT); } @@ -91,7 +92,7 @@ @Override protected boolean isRowValid(SplitSpeciesBatchRowModel row) { - return row.isValid(); + return row.isSelected(); } @Override @@ -110,19 +111,33 @@ } @Override + protected void onAfterSelectedRowChanged(int oldRowIndex, + SplitSpeciesBatchRowModel oldRow, + int newRowIndex, + SplitSpeciesBatchRowModel newRow) { + super.onAfterSelectedRowChanged(oldRowIndex, oldRow, newRowIndex, newRow); + if (newRow != null) { + + // Recompute the valid state of the row + recomputeRowValidState(newRow); + + // Need to recompute the sample weight + computeSampleWeight(); + } + } + + @Override protected void onRowModified(int rowIndex, SplitSpeciesBatchRowModel row, String propertyName, Object oldValue, Object newValue) { + // Recompute the valid state of the row recomputeRowValidState(row); - if (SplitSpeciesBatchRowModel.PROPERTY_WEIGHT.equals(propertyName)) { - - // Need to recompute the sample weight - computeSampleWeight(row); - } + // Need to recompute the sample weight + computeSampleWeight(); } //------------------------------------------------------------------------// @@ -314,21 +329,19 @@ //-- Internal methods --// //------------------------------------------------------------------------// - protected void computeSampleWeight(SplitSpeciesBatchRowModel row) { + protected void computeSampleWeight() { - if (log.isInfoEnabled()) { - log.info("Will recompute sample weight from row: " + row); - } - Float result = null; List<SplitSpeciesBatchRowModel> rows = getTableModel().getRows(); - for (SplitSpeciesBatchRowModel rowModel : rows) { - Float weight = rowModel.getWeight(); - if (weight != null) { - if (result == null) { - result = 0f; + for (SplitSpeciesBatchRowModel row : rows) { + if (row.isSelected()) { + Float weight = row.getWeight(); + if (weight != null) { + if (result == null) { + result = 0f; + } + result += weight; } - result += weight; } } getModel().setSampleWeight(result); Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIModel-error-validation.xml =================================================================== --- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIModel-error-validation.xml 2013-09-19 09:41:01 UTC (rev 1191) +++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIModel-error-validation.xml 2013-09-19 14:09:05 UTC (rev 1192) @@ -71,6 +71,28 @@ </field> + <field name="batchCount"> + <field-validator type="fieldexpression" short-circuit="true"> + <param name="expression"> + <![CDATA[ batchCount == null || !categoryIsFilled ]]> + </param> + <message> + tutti.validator.error.createSpeciesBatch.countAndCategories.notPossible + </message> + </field-validator> + </field> + + <field name="selectedCategory"> + <field-validator type="fieldexpression" short-circuit="true"> + <param name="expression"> + <![CDATA[ batchCount == null || !categoryIsFilled ]]> + </param> + <message> + tutti.validator.error.createSpeciesBatch.countAndCategories.notPossible + </message> + </field-validator> + </field> + <field name="sampleWeight"> <field-validator type="fieldexpression" short-circuit="true"> Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIModel-error-validation.xml =================================================================== --- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIModel-error-validation.xml 2013-09-19 09:41:01 UTC (rev 1191) +++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIModel-error-validation.xml 2013-09-19 14:09:05 UTC (rev 1192) @@ -70,6 +70,28 @@ </field> + <field name="batchCount"> + <field-validator type="fieldexpression" short-circuit="true"> + <param name="expression"> + <![CDATA[ batchCount == null || !categoryIsFilled ]]> + </param> + <message> + tutti.validator.error.createSpeciesBatch.countAndCategories.notPossible + </message> + </field-validator> + </field> + + <field name="selectedCategory"> + <field-validator type="fieldexpression" short-circuit="true"> + <param name="expression"> + <![CDATA[ batchCount == null || !categoryIsFilled ]]> + </param> + <message> + tutti.validator.error.createSpeciesBatch.countAndCategories.notPossible + </message> + </field-validator> + </field> + <field name="sampleWeight"> <field-validator type="fieldexpression" short-circuit="true"> 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-09-19 09:41:01 UTC (rev 1191) +++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-09-19 14:09:05 UTC (rev 1192) @@ -149,6 +149,12 @@ tutti.createAccidentalBatch.action.save= tutti.createAccidentalBatch.action.save.mnemonic= tutti.createAccidentalBatch.action.save.tip= +tutti.createAccidentalBatch.action.saveAndClose= +tutti.createAccidentalBatch.action.saveAndClose.mnemonic= +tutti.createAccidentalBatch.action.saveAndClose.tip= +tutti.createAccidentalBatch.action.saveAndContinue= +tutti.createAccidentalBatch.action.saveAndContinue.mnemonic= +tutti.createAccidentalBatch.action.saveAndContinue.tip= tutti.createAccidentalBatch.field.accidentalDeadOrAlive= tutti.createAccidentalBatch.field.accidentalDeadOrAlive.tip= tutti.createAccidentalBatch.field.accidentalGender= @@ -219,6 +225,12 @@ tutti.createMarineLitterBatch.action.save= tutti.createMarineLitterBatch.action.save.mnemonic= tutti.createMarineLitterBatch.action.save.tip= +tutti.createMarineLitterBatch.action.saveAndClose= +tutti.createMarineLitterBatch.action.saveAndClose.mnemonic= +tutti.createMarineLitterBatch.action.saveAndClose.tip= +tutti.createMarineLitterBatch.action.saveAndContinue= +tutti.createMarineLitterBatch.action.saveAndContinue.mnemonic= +tutti.createMarineLitterBatch.action.saveAndContinue.tip= tutti.createMarineLitterBatch.field.marineLitterCategory= tutti.createMarineLitterBatch.field.marineLitterCategory.tip= tutti.createMarineLitterBatch.field.marineLitterSizeCategory= @@ -1415,6 +1427,7 @@ tutti.validator.error.createMarineLitterBatch.number.invalidValue= tutti.validator.error.createMarineLitterBatch.number.required= tutti.validator.error.createSpeciesBatch.batchWeight.invalidValue= +tutti.validator.error.createSpeciesBatch.countAndCategories.notPossible= tutti.validator.error.createSpeciesBatch.sortedUnsortedCategory.required= tutti.validator.error.createSpeciesBatch.species.required= tutti.validator.error.createSpeciesBatch.speciesAndCategory.notAvailable= 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-09-19 09:41:01 UTC (rev 1191) +++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-09-19 14:09:05 UTC (rev 1192) @@ -136,9 +136,12 @@ tutti.createAccidentalBatch.action.cancel=Annuler tutti.createAccidentalBatch.action.cancel.mnemonic=A tutti.createAccidentalBatch.action.cancel.tip=Annuler la création de la capture accidentelle -tutti.createAccidentalBatch.action.save=Enregistrer -tutti.createAccidentalBatch.action.save.mnemonic=E -tutti.createAccidentalBatch.action.save.tip=Enregistrer la capture accidentelle +tutti.createAccidentalBatch.action.saveAndClose=Créer et Fermer +tutti.createAccidentalBatch.action.saveAndClose.mnemonic=F +tutti.createAccidentalBatch.action.saveAndClose.tip=Enregistrer la capture accidentelle et fermer +tutti.createAccidentalBatch.action.saveAndContinue=Créer +tutti.createAccidentalBatch.action.saveAndContinue.mnemonic=C +tutti.createAccidentalBatch.action.saveAndContinue.tip=Enregistrer la capture accidentelle et saisir une autre capture tutti.createAccidentalBatch.field.accidentalDeadOrAlive=Mort ou vivant tutti.createAccidentalBatch.field.accidentalDeadOrAlive.tip=L'animal a-t-il été remis à l'eau mort ou vivant ? tutti.createAccidentalBatch.field.accidentalGender=Sexe @@ -158,12 +161,12 @@ tutti.createBenthosBatch.action.cancel=Annuler tutti.createBenthosBatch.action.cancel.mnemonic=A tutti.createBenthosBatch.action.cancel.tip=Annuler la création du lot espèce -tutti.createBenthosBatch.action.saveAndClose=Créer et fermer +tutti.createBenthosBatch.action.saveAndClose=Créer et Fermer tutti.createBenthosBatch.action.saveAndClose.mnemonic=F tutti.createBenthosBatch.action.saveAndClose.tip=Enregistrer la création du lot espèce et quitter l'écran tutti.createBenthosBatch.action.saveAndContinue=Créer tutti.createBenthosBatch.action.saveAndContinue.mnemonic=C -tutti.createBenthosBatch.action.saveAndContinue.tip=Enregistrer la création du lot espèce +tutti.createBenthosBatch.action.saveAndContinue.tip=Enregistrer la création du lot espèce et en saisir un autre tutti.createBenthosBatch.field.batchCount=Nombre tutti.createBenthosBatch.field.batchCount.tip=Saisir le nombre d'individus dans le lot tutti.createBenthosBatch.field.batchWeight=Poids du lot (kg) @@ -203,9 +206,12 @@ tutti.createMarineLitterBatch.action.cancel=Annuler tutti.createMarineLitterBatch.action.cancel.mnemonic=A tutti.createMarineLitterBatch.action.cancel.tip=Annuler la création du lot macro-déchet -tutti.createMarineLitterBatch.action.save=Enregistrer -tutti.createMarineLitterBatch.action.save.mnemonic=E -tutti.createMarineLitterBatch.action.save.tip=Enregistrer la création du lot macro-déchet +tutti.createMarineLitterBatch.action.saveAndClose=Créer et Fermer +tutti.createMarineLitterBatch.action.saveAndClose.mnemonic=F +tutti.createMarineLitterBatch.action.saveAndClose.tip=Enregistrer la création du lot macro-déchet et fermer +tutti.createMarineLitterBatch.action.saveAndContinue=Créer +tutti.createMarineLitterBatch.action.saveAndContinue.mnemonic=C +tutti.createMarineLitterBatch.action.saveAndContinue.tip=Enregistrer la création du lot macro-déchet et en saisir un autre tutti.createMarineLitterBatch.field.marineLitterCategory=Catégorie de déchets tutti.createMarineLitterBatch.field.marineLitterCategory.tip=Type de déchets observés tutti.createMarineLitterBatch.field.marineLitterSizeCategory=Catégorie de taille @@ -224,7 +230,7 @@ tutti.createSpeciesBatch.action.saveAndClose.tip=Enregistrer la création du lot espèce et fermer l'écran tutti.createSpeciesBatch.action.saveAndContinue=Créer tutti.createSpeciesBatch.action.saveAndContinue.mnemonic=C -tutti.createSpeciesBatch.action.saveAndContinue.tip=Enregistrer la création du lot espèce +tutti.createSpeciesBatch.action.saveAndContinue.tip=Enregistrer la création du lot espèce et en saisir un autre tutti.createSpeciesBatch.field.batchCount=Nombre tutti.createSpeciesBatch.field.batchCount.tip=Saisir le nombre d'individus dans le lot tutti.createSpeciesBatch.field.batchWeight=Poids du lot (kg) @@ -1375,6 +1381,7 @@ tutti.validator.error.createMarineLitterBatch.number.invalidValue=Le nombre doit être strictement positif tutti.validator.error.createMarineLitterBatch.number.required=Le nombre est obligatoire tutti.validator.error.createSpeciesBatch.batchWeight.invalidValue=Le poids du lot doit être strictement positif +tutti.validator.error.createSpeciesBatch.countAndCategories.notPossible=Impossible de dénombrer et catégoriser en même temps tutti.validator.error.createSpeciesBatch.sortedUnsortedCategory.required=La catégorie Vrac / Hors Vrac est obligatoire tutti.validator.error.createSpeciesBatch.species.required=L'espèce est obligatoire tutti.validator.error.createSpeciesBatch.speciesAndCategory.notAvailable=Couple (espèce - Vrac/Hors Vrac) déjà utilisée