Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe

Commits:

23 changed files:

Changes:

  • client-core/src/main/java/fr/ird/observe/client/util/DtoIconHelper.java
    ... ... @@ -72,7 +72,10 @@ public class DtoIconHelper {
    72 72
         }
    
    73 73
     
    
    74 74
         public static String getIconPath(String iconPathPrefix, boolean small) {
    
    75
    -        String iconPath = "navigation." + iconPathPrefix;
    
    75
    +        String iconPath = iconPathPrefix;
    
    76
    +        if (!iconPath.startsWith("navigation.")) {
    
    77
    +            iconPath = "navigation."+iconPath;
    
    78
    +        }
    
    76 79
             if (small) {
    
    77 80
                 iconPath += "-small";
    
    78 81
             }
    

  • client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/data/open/actions/Create.java
    ... ... @@ -26,6 +26,7 @@ import fr.ird.observe.client.datasource.editor.DataSourceEditor;
    26 26
     import fr.ird.observe.client.datasource.editor.content.actions.ContentUIActionSupport;
    
    27 27
     import fr.ird.observe.client.datasource.editor.content.data.edit.ContentEditUIModel;
    
    28 28
     import fr.ird.observe.client.datasource.editor.content.data.open.ContentOpenableUI;
    
    29
    +import fr.ird.observe.client.datasource.editor.content.data.simple.ContentSimpleUIModel;
    
    29 30
     import fr.ird.observe.client.datasource.editor.tree.navigation.NavigationTree;
    
    30 31
     import fr.ird.observe.client.util.ObserveKeyStrokesSupport;
    
    31 32
     import fr.ird.observe.navigation.model.edit.CloseEditNodeVetoException;
    
    ... ... @@ -49,7 +50,7 @@ public class Create extends ContentUIActionSupport<ContentOpenableUI> {
    49 50
             super(null, null, "add", ObserveKeyStrokesSupport.KEY_STROKE_NEW_NEXT_DATA);
    
    50 51
         }
    
    51 52
     
    
    52
    -    public static void closeAndCreate(DataSourceEditor dataSourceEditor, MultipleReferenceContainerNode<?, ?> parentNode, NavigationTree tree, ContentEditUIModel<?, ?> model) {
    
    53
    +    public static void closeAndCreate(DataSourceEditor dataSourceEditor, MultipleReferenceContainerNode<?, ?> parentNode, NavigationTree tree, ContentSimpleUIModel model) {
    
    53 54
             try {
    
    54 55
                 Close.closeData(dataSourceEditor, model.getEditNode());
    
    55 56
                 tree.addUnsavedNode(parentNode);
    

  • client-datasource-editor-common/src/main/java/fr/ird/observe/client/datasource/editor/content/data/TripActionHelper.java
    ... ... @@ -22,11 +22,14 @@ package fr.ird.observe.client.datasource.editor.content.data;
    22 22
      * #L%
    
    23 23
      */
    
    24 24
     
    
    25
    +import fr.ird.observe.client.datasource.editor.content.ContentUI;
    
    25 26
     import fr.ird.observe.client.datasource.editor.content.data.list.ContentListUI;
    
    26 27
     import fr.ird.observe.client.datasource.editor.tree.navigation.NavigationTree;
    
    27 28
     import fr.ird.observe.client.main.ObserveMainUI;
    
    28 29
     import fr.ird.observe.client.util.UIHelper;
    
    29 30
     import fr.ird.observe.dto.data.TripAware;
    
    31
    +import fr.ird.observe.dto.data.ps.common.TripReference;
    
    32
    +import fr.ird.observe.navigation.tree.ReferenceNode;
    
    30 33
     import org.apache.logging.log4j.LogManager;
    
    31 34
     import org.apache.logging.log4j.Logger;
    
    32 35
     
    
    ... ... @@ -43,6 +46,15 @@ import static io.ultreia.java4all.i18n.I18n.t;
    43 46
     public class TripActionHelper {
    
    44 47
         private static final Logger log = LogManager.getLogger(TripActionHelper.class);
    
    45 48
     
    
    49
    +    public static boolean gotoTripLogbookTab(ObserveMainUI mainui, ContentUI ui, String tripId, Function<String, TripAware> servicesProvider, String message) {
    
    50
    +        TripAware tripDto = servicesProvider.apply(tripId);
    
    51
    +        boolean canExecuteAction = tripDto.isLogbookAvailability();
    
    52
    +        if (!canExecuteAction) {
    
    53
    +            askAndGotoTripMetaDataTab(mainui, ui, message, TripAware.PROPERTY_LOGBOOK_AVAILABILITY, 3);
    
    54
    +        }
    
    55
    +        return canExecuteAction;
    
    56
    +    }
    
    57
    +
    
    46 58
         public static boolean gotoTripLogbookTab(ObserveMainUI mainui, ContentListUI<?, ?, ?, ?> ui, Function<String, TripAware> servicesProvider, String message) {
    
    47 59
             String tripId = ui.getModel().getSelectedParentId();
    
    48 60
             TripAware tripDto = servicesProvider.apply(tripId);
    
    ... ... @@ -63,7 +75,7 @@ public class TripActionHelper {
    63 75
             return canExecuteAction;
    
    64 76
         }
    
    65 77
     
    
    66
    -    private static void askAndGotoTripMetaDataTab(ObserveMainUI mainui, ContentListUI<?, ?, ?, ?> ui, String message, String availabilityPropertyName, int tabIndex) {
    
    78
    +    private static void askAndGotoTripMetaDataTab(ObserveMainUI mainui, ContentUI ui, String message, String availabilityPropertyName, int tabIndex) {
    
    67 79
             // Let's ask user to fill them
    
    68 80
             int response = UIHelper.askUser(
    
    69 81
                     mainui,
    
    ... ... @@ -81,7 +93,7 @@ public class TripActionHelper {
    81 93
     
    
    82 94
                 // go to trip form
    
    83 95
                 NavigationTree tree = ui.getDataSourceEditor().getNavigationUI().getTree();
    
    84
    -            TreeNode tripNode = ui.getModel().upToParentReferenceNode(tree);
    
    96
    +            TreeNode tripNode = ReferenceNode.upToReferenceNode(TripReference.class, tree.getSelectedNode());
    
    85 97
                 tree.selectSafeNode(tripNode);
    
    86 98
                 TripUI tripUI = (TripUI) ui.getDataSourceEditor().getContentUIManager().getSelectedContentUI();
    
    87 99
                 // set availability flag to true
    

  • client-datasource-editor-ps/src/main/i18n/getters/java.getter
    ... ... @@ -40,6 +40,8 @@ observe.data.ps.landing.Landing.table.weight
    40 40
     observe.data.ps.landing.Landing.table.weight.tip
    
    41 41
     observe.data.ps.landing.Landing.table.weightCategory
    
    42 42
     observe.data.ps.landing.Landing.table.weightCategory.tip
    
    43
    +observe.data.ps.localmarket.Batch.action.create
    
    44
    +observe.data.ps.localmarket.Batch.action.create.tip
    
    43 45
     observe.data.ps.localmarket.Batch.table.count
    
    44 46
     observe.data.ps.localmarket.Batch.table.count.tip
    
    45 47
     observe.data.ps.localmarket.Batch.table.packaging
    

  • client-datasource-editor-ps/src/main/i18n/getters/jaxx.getter
    ... ... @@ -121,6 +121,7 @@ observe.data.ps.localmarket.SurveyPart.action.create
    121 121
     observe.data.ps.localmarket.SurveyPart.action.create.tip
    
    122 122
     observe.data.ps.localmarket.SurveyPart.proportion
    
    123 123
     observe.data.ps.localmarket.SurveyPart.title
    
    124
    +observe.data.ps.localmarket.title
    
    124 125
     observe.data.ps.logbook.Activity.action.close.tip
    
    125 126
     observe.data.ps.logbook.Activity.action.create
    
    126 127
     observe.data.ps.logbook.Activity.action.create.tip
    

  • client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/ObservePsKeyStrokes.java
    ... ... @@ -40,4 +40,7 @@ public class ObservePsKeyStrokes extends ObserveKeyStrokesSupport {
    40 40
         public static final KeyStroke KEY_STROKE_COPY_FLOATING_OBJECT_PART_TO_LEFT = KeyStroke.getKeyStroke("ctrl L");
    
    41 41
         public static final KeyStroke KEY_STROKE_ADD_SET_SEINE = KeyStroke.getKeyStroke("ctrl pressed L");
    
    42 42
         public static final KeyStroke KEY_STROKE_ADD_SAMPLE = KeyStroke.getKeyStroke("ctrl pressed S");
    
    43
    +    public static final KeyStroke KEY_STROKE_LOCALMARKET_ADD_BATCH = KeyStroke.getKeyStroke("ctrl pressed F1");
    
    44
    +    public static final KeyStroke KEY_STROKE_LOCALMARKET_ADD_SURVEY = KeyStroke.getKeyStroke("ctrl pressed F2");
    
    45
    +    public static final KeyStroke KEY_STROKE_LOCALMARKET_ADD_SAMPLE = KeyStroke.getKeyStroke("ctrl pressed F3");
    
    43 46
     }

  • client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/localmarket/LocalmarketUI.jaxx
    1
    +<!--
    
    2
    +  #%L
    
    3
    +  ObServe :: Client DataSource Editor PS
    
    4
    +  %%
    
    5
    +  Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io
    
    6
    +  %%
    
    7
    +  This program is free software: you can redistribute it and/or modify
    
    8
    +  it under the terms of the GNU General Public License as
    
    9
    +  published by the Free Software Foundation, either version 3 of the
    
    10
    +  License, or (at your option) any later version.
    
    11
    +
    
    12
    +  This program is distributed in the hope that it will be useful,
    
    13
    +  but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    14
    +  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    15
    +  GNU General Public License for more details.
    
    16
    +
    
    17
    +  You should have received a copy of the GNU General Public
    
    18
    +  License along with this program.  If not, see
    
    19
    +  <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    20
    +  #L%
    
    21
    +  -->
    
    22
    +<fr.ird.observe.client.datasource.editor.content.data.simple.ContentSimpleUI beanScope="bean"
    
    23
    +                                                                             i18n="fr.ird.observe.dto.data.ps.common.TripDto"
    
    24
    +                                                                             superGenericType='TripDto, LocalmarketUI'
    
    25
    +                                                                             contentTitle='{n("observe.data.ps.localmarket.title")}'>
    
    26
    +  <import>
    
    27
    +    fr.ird.observe.dto.data.ps.common.TripDto
    
    28
    +    static io.ultreia.java4all.i18n.I18n.n
    
    29
    +  </import>
    
    30
    +
    
    31
    +  <LocalmarketUIModel id='model' constructorParams='@override'/>
    
    32
    +  <TripDto id='bean'/>
    
    33
    +  <BeanValidator id='validator' context='update' errorTableModel='{getErrorTableModel()}'
    
    34
    +                 beanClass='fr.ird.observe.dto.data.ps.common.TripDto'>
    
    35
    +    <field name="localMarketBatch" component="addBatch"/>
    
    36
    +    <field name="localMarketSurvey" component="addSurvey"/>
    
    37
    +    <field name="localMarketSample" component="addSample"/>
    
    38
    +  </BeanValidator>
    
    39
    +
    
    40
    +  <JPanel id="body" layout="{new GridLayout(0,1)}">
    
    41
    +    <JButton id='addBatch'/>
    
    42
    +    <JButton id='addSurvey'/>
    
    43
    +    <JButton id='addSample'/>
    
    44
    +  </JPanel>
    
    45
    +</fr.ird.observe.client.datasource.editor.content.data.simple.ContentSimpleUI>

  • client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/localmarket/LocalmarketUIHandler.java
    1
    +package fr.ird.observe.client.datasource.editor.content.data.ps.localmarket;
    
    2
    +
    
    3
    +/*-
    
    4
    + * #%L
    
    5
    + * ObServe :: Client DataSource Editor PS
    
    6
    + * %%
    
    7
    + * Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io
    
    8
    + * %%
    
    9
    + * This program is free software: you can redistribute it and/or modify
    
    10
    + * it under the terms of the GNU General Public License as
    
    11
    + * published by the Free Software Foundation, either version 3 of the
    
    12
    + * License, or (at your option) any later version.
    
    13
    + *
    
    14
    + * This program is distributed in the hope that it will be useful,
    
    15
    + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16
    + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17
    + * GNU General Public License for more details.
    
    18
    + *
    
    19
    + * You should have received a copy of the GNU General Public
    
    20
    + * License along with this program.  If not, see
    
    21
    + * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    22
    + * #L%
    
    23
    + */
    
    24
    +
    
    25
    +import fr.ird.observe.client.datasource.editor.content.data.simple.ContentSimpleUIHandler;
    
    26
    +import fr.ird.observe.client.datasource.editor.content.ui.ObserveLayoutFocusTraversalPolicy;
    
    27
    +import fr.ird.observe.dto.data.ps.common.TripDto;
    
    28
    +import fr.ird.observe.dto.form.Form;
    
    29
    +import org.apache.logging.log4j.LogManager;
    
    30
    +import org.apache.logging.log4j.Logger;
    
    31
    +import org.nuiton.jaxx.runtime.spi.UIHandler;
    
    32
    +
    
    33
    +import java.awt.Component;
    
    34
    +import java.awt.Container;
    
    35
    +
    
    36
    +/**
    
    37
    + * Created on 09/09/2020.
    
    38
    + *
    
    39
    + * @author Tony Chemit - dev@tchemit.fr
    
    40
    + * @since 8.1.0
    
    41
    + */
    
    42
    +class LocalmarketUIHandler extends ContentSimpleUIHandler<TripDto, LocalmarketUI> implements UIHandler<LocalmarketUI> {
    
    43
    +    private static final Logger log = LogManager.getLogger(LocalmarketUIHandler.class);
    
    44
    +
    
    45
    +    @Override
    
    46
    +    protected ObserveLayoutFocusTraversalPolicy<LocalmarketUI> createFocusTraversalPolicy() {
    
    47
    +        return new ObserveLayoutFocusTraversalPolicy<LocalmarketUI>() {
    
    48
    +            @Override
    
    49
    +            protected Component getFirstComponentForEdit(Container aContainer) {
    
    50
    +                return ui.getAddBatch();
    
    51
    +            }
    
    52
    +
    
    53
    +            @Override
    
    54
    +            protected Component getLastComponentForEdit(Container aContainer) {
    
    55
    +                return ui.getAddBatch();
    
    56
    +            }
    
    57
    +        };
    
    58
    +    }
    
    59
    +
    
    60
    +    @Override
    
    61
    +    public LocalmarketUIModel getModel() {
    
    62
    +        return (LocalmarketUIModel) super.getModel();
    
    63
    +    }
    
    64
    +
    
    65
    +    @Override
    
    66
    +    protected void onOpenModel() {
    
    67
    +        super.onOpenModel();
    
    68
    +        LocalmarketUIModel model = getModel();
    
    69
    +        String tripId = model.getSelectedId();
    
    70
    +        log.info(prefix + "tripId     = " + tripId);
    
    71
    +        Form<TripDto> form = getPsCommonTripService().loadForm(tripId);
    
    72
    +        model.openForm(form);
    
    73
    +    }
    
    74
    +}

  • client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/localmarket/LocalmarketUIModel.java
    1
    +package fr.ird.observe.client.datasource.editor.content.data.ps.localmarket;
    
    2
    +
    
    3
    +/*-
    
    4
    + * #%L
    
    5
    + * ObServe :: Client DataSource Editor PS
    
    6
    + * %%
    
    7
    + * Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io
    
    8
    + * %%
    
    9
    + * This program is free software: you can redistribute it and/or modify
    
    10
    + * it under the terms of the GNU General Public License as
    
    11
    + * published by the Free Software Foundation, either version 3 of the
    
    12
    + * License, or (at your option) any later version.
    
    13
    + *
    
    14
    + * This program is distributed in the hope that it will be useful,
    
    15
    + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16
    + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17
    + * GNU General Public License for more details.
    
    18
    + *
    
    19
    + * You should have received a copy of the GNU General Public
    
    20
    + * License along with this program.  If not, see
    
    21
    + * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    22
    + * #L%
    
    23
    + */
    
    24
    +
    
    25
    +import fr.ird.observe.client.datasource.editor.content.ContentMode;
    
    26
    +import fr.ird.observe.client.datasource.editor.content.data.simple.ContentSimpleUIModel;
    
    27
    +import fr.ird.observe.dto.data.ps.common.TripDto;
    
    28
    +import fr.ird.observe.dto.form.Form;
    
    29
    +import io.ultreia.java4all.bean.spi.GenerateJavaBeanDefinition;
    
    30
    +
    
    31
    +/**
    
    32
    + * Created on 09/09/2020.
    
    33
    + *
    
    34
    + * @author Tony Chemit - dev@tchemit.fr
    
    35
    + * @since 8.1.0
    
    36
    + */
    
    37
    +@GenerateJavaBeanDefinition
    
    38
    +public class LocalmarketUIModel extends ContentSimpleUIModel<TripDto> {
    
    39
    +
    
    40
    +    public LocalmarketUIModel() {
    
    41
    +        super(TripDto.class);
    
    42
    +    }
    
    43
    +
    
    44
    +    @Override
    
    45
    +    protected ContentMode computeMode(boolean canWrite) {
    
    46
    +        return canWrite ? getContentModeFromSelf() : ContentMode.READ;
    
    47
    +    }
    
    48
    +
    
    49
    +    @Override
    
    50
    +    public void openForm(Form<TripDto> form) {
    
    51
    +        super.openForm(form);
    
    52
    +    }
    
    53
    +}

  • client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/localmarket/SurveyPartUI.jaxx
    ... ... @@ -67,7 +67,7 @@ public SwingValidatorMessageTableModel getErrorTableModel() {
    67 67
     ]]>
    
    68 68
       </script>
    
    69 69
     
    
    70
    -  <Table id='editorPanel' fill='both' insets='1'>
    
    70
    +  <Table id='editorPanel' fill='both' insets='1' beanScope="tableEditBean">
    
    71 71
     
    
    72 72
         <!-- species -->
    
    73 73
         <row>
    

  • client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/localmarket/actions/LocalmarketUIActionSupport.java
    1
    +package fr.ird.observe.client.datasource.editor.content.data.ps.localmarket.actions;
    
    2
    +
    
    3
    +/*-
    
    4
    + * #%L
    
    5
    + * ObServe :: Client DataSource Editor PS
    
    6
    + * %%
    
    7
    + * Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io
    
    8
    + * %%
    
    9
    + * This program is free software: you can redistribute it and/or modify
    
    10
    + * it under the terms of the GNU General Public License as
    
    11
    + * published by the Free Software Foundation, either version 3 of the
    
    12
    + * License, or (at your option) any later version.
    
    13
    + *
    
    14
    + * This program is distributed in the hope that it will be useful,
    
    15
    + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16
    + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17
    + * GNU General Public License for more details.
    
    18
    + *
    
    19
    + * You should have received a copy of the GNU General Public
    
    20
    + * License along with this program.  If not, see
    
    21
    + * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    22
    + * #L%
    
    23
    + */
    
    24
    +
    
    25
    +import fr.ird.observe.client.datasource.editor.content.actions.ContentUIActionSupport;
    
    26
    +import fr.ird.observe.client.datasource.editor.content.data.TripActionHelper;
    
    27
    +import fr.ird.observe.client.datasource.editor.content.data.ps.localmarket.LocalmarketUI;
    
    28
    +import fr.ird.observe.client.datasource.editor.content.data.ps.localmarket.LocalmarketUIModel;
    
    29
    +import fr.ird.observe.client.util.DtoIconHelper;
    
    30
    +
    
    31
    +import javax.swing.KeyStroke;
    
    32
    +import java.awt.event.ActionEvent;
    
    33
    +
    
    34
    +import static io.ultreia.java4all.i18n.I18n.t;
    
    35
    +
    
    36
    +/**
    
    37
    + * Created on 09/09/2020.
    
    38
    + *
    
    39
    + * @author Tony Chemit - dev@tchemit.fr
    
    40
    + * @since 8.1.0
    
    41
    + */
    
    42
    +public abstract class LocalmarketUIActionSupport extends ContentUIActionSupport<LocalmarketUI> {
    
    43
    +
    
    44
    +    protected LocalmarketUIActionSupport(String label, String shortDescription, String actionIcon, KeyStroke acceleratorKey) {
    
    45
    +        super(label, shortDescription, actionIcon, acceleratorKey);
    
    46
    +        setIcon(DtoIconHelper.getIcon(actionIcon));
    
    47
    +    }
    
    48
    +
    
    49
    +
    
    50
    +    @Override
    
    51
    +    protected boolean canExecuteAction(ActionEvent e) {
    
    52
    +        boolean canExecuteAction = super.canExecuteAction(e);
    
    53
    +        //FIXME Finshi this
    
    54
    +        if (canExecuteAction) {
    
    55
    +            LocalmarketUIModel model = ui.getModel();
    
    56
    +            canExecuteAction = TripActionHelper.gotoTripLogbookTab(getMainUI(), ui, model.getBean().getId(), getServicesProvider().getPsCommonTripService()::loadDto, t("observe.data.ps.common.Trip.message.missing.observation.metadata"));
    
    57
    +        }
    
    58
    +        return canExecuteAction;
    
    59
    +    }
    
    60
    +}

  • client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/localmarket/actions/LocalmarketUIAddBatch.java
    1
    +package fr.ird.observe.client.datasource.editor.content.data.ps.localmarket.actions;
    
    2
    +
    
    3
    +/*-
    
    4
    + * #%L
    
    5
    + * ObServe :: Client DataSource Editor PS
    
    6
    + * %%
    
    7
    + * Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io
    
    8
    + * %%
    
    9
    + * This program is free software: you can redistribute it and/or modify
    
    10
    + * it under the terms of the GNU General Public License as
    
    11
    + * published by the Free Software Foundation, either version 3 of the
    
    12
    + * License, or (at your option) any later version.
    
    13
    + *
    
    14
    + * This program is distributed in the hope that it will be useful,
    
    15
    + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16
    + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17
    + * GNU General Public License for more details.
    
    18
    + *
    
    19
    + * You should have received a copy of the GNU General Public
    
    20
    + * License along with this program.  If not, see
    
    21
    + * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    22
    + * #L%
    
    23
    + */
    
    24
    +
    
    25
    +import fr.ird.observe.client.datasource.editor.content.ObservePsKeyStrokes;
    
    26
    +import fr.ird.observe.client.datasource.editor.content.data.ps.localmarket.BatchUI;
    
    27
    +import fr.ird.observe.client.datasource.editor.content.data.ps.localmarket.LocalmarketUI;
    
    28
    +import fr.ird.observe.client.datasource.editor.tree.navigation.NavigationTree;
    
    29
    +import fr.ird.observe.client.datasource.editor.tree.navigation.nodes.NavigationTreeNodeSupport;
    
    30
    +import fr.ird.observe.client.datasource.editor.tree.navigation.nodes.data.ps.localmarket.BatchNavigationTreeNode;
    
    31
    +import fr.ird.observe.client.datasource.editor.tree.navigation.nodes.data.ps.localmarket.LocalmarketNavigationTreeNode;
    
    32
    +import fr.ird.observe.client.util.DtoIconHelper;
    
    33
    +import fr.ird.observe.dto.data.ps.localmarket.BatchDto;
    
    34
    +
    
    35
    +import javax.swing.SwingUtilities;
    
    36
    +import java.awt.event.ActionEvent;
    
    37
    +import java.awt.event.KeyListener;
    
    38
    +
    
    39
    +import static io.ultreia.java4all.i18n.I18n.t;
    
    40
    +
    
    41
    +/**
    
    42
    + * Created on 09/09/2020.
    
    43
    + *
    
    44
    + * @author Tony Chemit - dev@tchemit.fr
    
    45
    + * @since 8.1.0
    
    46
    + */
    
    47
    +public class LocalmarketUIAddBatch extends LocalmarketUIActionSupport {
    
    48
    +
    
    49
    +    public LocalmarketUIAddBatch() {
    
    50
    +        super(t("observe.data.ps.localmarket.Batch.action.create"), t("observe.data.ps.localmarket.Batch.action.create.tip"), DtoIconHelper.getIconPath(BatchDto.class), ObservePsKeyStrokes.KEY_STROKE_LOCALMARKET_ADD_BATCH);
    
    51
    +    }
    
    52
    +
    
    53
    +    @Override
    
    54
    +    public void init() {
    
    55
    +        super.init();
    
    56
    +        //FIXME Make this in UIHelper at least for any
    
    57
    +        for (KeyListener keyListener : editor.getKeyListeners()) {
    
    58
    +            if (keyListener.getClass().getName().contains("javax.swing.ToolTipManager$AccessibilityKeyListener")) {
    
    59
    +                editor.removeKeyListener(keyListener);
    
    60
    +                break;
    
    61
    +            }
    
    62
    +        }
    
    63
    +    }
    
    64
    +
    
    65
    +    @Override
    
    66
    +    protected void doActionPerformed(ActionEvent e, LocalmarketUI ui) {
    
    67
    +        NavigationTree tree = getDataSourceEditor().getNavigationUI().getTree();
    
    68
    +        LocalmarketNavigationTreeNode parentNode = (LocalmarketNavigationTreeNode) tree.getSelectedNode();
    
    69
    +        NavigationTreeNodeSupport<?> nodeToSelect = parentNode.findChildByType(BatchNavigationTreeNode.class);
    
    70
    +        tree.selectSafeNode(nodeToSelect);
    
    71
    +        BatchUI content = getDataSourceEditor().getContentUIManager().getContent();
    
    72
    +        SwingUtilities.invokeLater(() -> content.getNewEntry().doClick());
    
    73
    +
    
    74
    +    }
    
    75
    +}

  • client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/localmarket/actions/LocalmarketUIAddSample.java
    1
    +package fr.ird.observe.client.datasource.editor.content.data.ps.localmarket.actions;
    
    2
    +
    
    3
    +/*-
    
    4
    + * #%L
    
    5
    + * ObServe :: Client DataSource Editor PS
    
    6
    + * %%
    
    7
    + * Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io
    
    8
    + * %%
    
    9
    + * This program is free software: you can redistribute it and/or modify
    
    10
    + * it under the terms of the GNU General Public License as
    
    11
    + * published by the Free Software Foundation, either version 3 of the
    
    12
    + * License, or (at your option) any later version.
    
    13
    + *
    
    14
    + * This program is distributed in the hope that it will be useful,
    
    15
    + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16
    + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17
    + * GNU General Public License for more details.
    
    18
    + *
    
    19
    + * You should have received a copy of the GNU General Public
    
    20
    + * License along with this program.  If not, see
    
    21
    + * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    22
    + * #L%
    
    23
    + */
    
    24
    +
    
    25
    +import fr.ird.observe.client.datasource.editor.content.ObservePsKeyStrokes;
    
    26
    +import fr.ird.observe.client.datasource.editor.content.data.ps.localmarket.LocalmarketUI;
    
    27
    +import fr.ird.observe.client.datasource.editor.content.data.ps.localmarket.SampleListUI;
    
    28
    +import fr.ird.observe.client.datasource.editor.tree.navigation.NavigationTree;
    
    29
    +import fr.ird.observe.client.datasource.editor.tree.navigation.nodes.data.ps.localmarket.LocalmarketNavigationTreeNode;
    
    30
    +import fr.ird.observe.client.datasource.editor.tree.navigation.nodes.data.ps.localmarket.SampleListNavigationTreeNode;
    
    31
    +import fr.ird.observe.client.util.DtoIconHelper;
    
    32
    +import fr.ird.observe.dto.data.ps.localmarket.SampleDto;
    
    33
    +
    
    34
    +import javax.swing.SwingUtilities;
    
    35
    +import java.awt.event.ActionEvent;
    
    36
    +
    
    37
    +import static io.ultreia.java4all.i18n.I18n.t;
    
    38
    +
    
    39
    +/**
    
    40
    + * Created on 09/09/2020.
    
    41
    + *
    
    42
    + * @author Tony Chemit - dev@tchemit.fr
    
    43
    + * @since 8.1.0
    
    44
    + */
    
    45
    +public class LocalmarketUIAddSample extends LocalmarketUIActionSupport {
    
    46
    +
    
    47
    +    public LocalmarketUIAddSample() {
    
    48
    +        super(t("observe.data.ps.localmarket.Sample.action.create"), t("observe.data.ps.localmarket.Sample.action.create.tip"), DtoIconHelper.getIconPath(SampleDto.class), ObservePsKeyStrokes.KEY_STROKE_LOCALMARKET_ADD_SAMPLE);
    
    49
    +    }
    
    50
    +
    
    51
    +
    
    52
    +    @Override
    
    53
    +    protected void doActionPerformed(ActionEvent e, LocalmarketUI ui) {
    
    54
    +        NavigationTree tree = getDataSourceEditor().getNavigationUI().getTree();
    
    55
    +        LocalmarketNavigationTreeNode parentNode = (LocalmarketNavigationTreeNode) tree.getSelectedNode();
    
    56
    +        SampleListNavigationTreeNode nodeToSelect = (SampleListNavigationTreeNode) parentNode.findChildByType(SampleListNavigationTreeNode.class);
    
    57
    +        tree.selectSafeNode(nodeToSelect);
    
    58
    +        SampleListUI content = getDataSourceEditor().getContentUIManager().getContent();
    
    59
    +        SwingUtilities.invokeLater(() -> content.getCreate().doClick());
    
    60
    +
    
    61
    +    }
    
    62
    +}

  • client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/localmarket/actions/LocalmarketUIAddSurvey.java
    1
    +package fr.ird.observe.client.datasource.editor.content.data.ps.localmarket.actions;
    
    2
    +
    
    3
    +/*-
    
    4
    + * #%L
    
    5
    + * ObServe :: Client DataSource Editor PS
    
    6
    + * %%
    
    7
    + * Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io
    
    8
    + * %%
    
    9
    + * This program is free software: you can redistribute it and/or modify
    
    10
    + * it under the terms of the GNU General Public License as
    
    11
    + * published by the Free Software Foundation, either version 3 of the
    
    12
    + * License, or (at your option) any later version.
    
    13
    + *
    
    14
    + * This program is distributed in the hope that it will be useful,
    
    15
    + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16
    + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17
    + * GNU General Public License for more details.
    
    18
    + *
    
    19
    + * You should have received a copy of the GNU General Public
    
    20
    + * License along with this program.  If not, see
    
    21
    + * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    22
    + * #L%
    
    23
    + */
    
    24
    +
    
    25
    +import fr.ird.observe.client.datasource.editor.content.ObservePsKeyStrokes;
    
    26
    +import fr.ird.observe.client.datasource.editor.content.data.ps.localmarket.LocalmarketUI;
    
    27
    +import fr.ird.observe.client.datasource.editor.content.data.ps.localmarket.SurveyListUI;
    
    28
    +import fr.ird.observe.client.datasource.editor.tree.navigation.NavigationTree;
    
    29
    +import fr.ird.observe.client.datasource.editor.tree.navigation.nodes.data.ps.localmarket.LocalmarketNavigationTreeNode;
    
    30
    +import fr.ird.observe.client.datasource.editor.tree.navigation.nodes.data.ps.localmarket.SurveyListNavigationTreeNode;
    
    31
    +import fr.ird.observe.client.util.DtoIconHelper;
    
    32
    +import fr.ird.observe.dto.data.ps.localmarket.SurveyDto;
    
    33
    +
    
    34
    +import javax.swing.SwingUtilities;
    
    35
    +import java.awt.event.ActionEvent;
    
    36
    +
    
    37
    +import static io.ultreia.java4all.i18n.I18n.t;
    
    38
    +
    
    39
    +/**
    
    40
    + * Created on 09/09/2020.
    
    41
    + *
    
    42
    + * @author Tony Chemit - dev@tchemit.fr
    
    43
    + * @since 8.1.0
    
    44
    + */
    
    45
    +public class LocalmarketUIAddSurvey extends LocalmarketUIActionSupport {
    
    46
    +
    
    47
    +    public LocalmarketUIAddSurvey() {
    
    48
    +        super(t("observe.data.ps.localmarket.Survey.action.create"), t("observe.data.ps.localmarket.Survey.action.create.tip"), DtoIconHelper.getIconPath(SurveyDto.class), ObservePsKeyStrokes.KEY_STROKE_LOCALMARKET_ADD_SURVEY);
    
    49
    +    }
    
    50
    +
    
    51
    +    @Override
    
    52
    +    protected void doActionPerformed(ActionEvent e, LocalmarketUI ui) {
    
    53
    +        NavigationTree tree = getDataSourceEditor().getNavigationUI().getTree();
    
    54
    +        LocalmarketNavigationTreeNode parentNode = (LocalmarketNavigationTreeNode) tree.getSelectedNode();
    
    55
    +        SurveyListNavigationTreeNode nodeToSelect = (SurveyListNavigationTreeNode) parentNode.findChildByType(SurveyListNavigationTreeNode.class);
    
    56
    +        tree.selectSafeNode(nodeToSelect);
    
    57
    +        SurveyListUI content = getDataSourceEditor().getContentUIManager().getContent();
    
    58
    +        SwingUtilities.invokeLater(() -> content.getCreate().doClick());
    
    59
    +
    
    60
    +    }
    
    61
    +}

  • client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/tree/navigation/nodes/data/ps/localmarket/LocalmarketNavigationTreeNode.java
    ... ... @@ -22,8 +22,10 @@ package fr.ird.observe.client.datasource.editor.tree.navigation.nodes.data.ps.lo
    22 22
      * #L%
    
    23 23
      */
    
    24 24
     
    
    25
    +import fr.ird.observe.client.datasource.editor.content.data.ps.localmarket.LocalmarketUI;
    
    25 26
     import fr.ird.observe.client.datasource.editor.tree.navigation.nodes.StringNavigationTreeNodeSupport;
    
    26 27
     import fr.ird.observe.client.util.DtoIconHelper;
    
    28
    +import fr.ird.observe.navigation.model.ObserveNavigationNode;
    
    27 29
     
    
    28 30
     import javax.swing.Icon;
    
    29 31
     
    
    ... ... @@ -44,6 +46,21 @@ public class LocalmarketNavigationTreeNode extends StringNavigationTreeNodeSuppo
    44 46
             add(new SampleListNavigationTreeNode());
    
    45 47
         }
    
    46 48
     
    
    49
    +    @Override
    
    50
    +    public ObserveNavigationNode<?> getEditNode() {
    
    51
    +        return getEditNodeOrParentEditNode();
    
    52
    +    }
    
    53
    +
    
    54
    +    @Override
    
    55
    +    public Class<LocalmarketUI> getContentClass() {
    
    56
    +        return LocalmarketUI.class;
    
    57
    +    }
    
    58
    +
    
    59
    +    @Override
    
    60
    +    public boolean isOpen() {
    
    61
    +        return super.isOpen();
    
    62
    +    }
    
    63
    +
    
    47 64
         @Override
    
    48 65
         public final Icon getIcon(boolean small) {
    
    49 66
             return DtoIconHelper.getIcon("data.ps.localmarket", small);
    

  • client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/tree/navigation/nodes/data/ps/localmarket/SampleNavigationTreeNode.java
    ... ... @@ -27,6 +27,7 @@ import fr.ird.observe.client.datasource.editor.tree.navigation.nodes.ReferenceNa
    27 27
     import fr.ird.observe.dto.data.ps.localmarket.SampleDto;
    
    28 28
     import fr.ird.observe.dto.data.ps.localmarket.SampleReference;
    
    29 29
     import fr.ird.observe.navigation.model.edit.seine.node.ObserveSeineLocalmarketSampleEditNode;
    
    30
    +import fr.ird.observe.navigation.model.select.seine.node.ObserveSeineLocalmarketSampleSelectNode;
    
    30 31
     
    
    31 32
     import static io.ultreia.java4all.i18n.I18n.t;
    
    32 33
     
    
    ... ... @@ -34,15 +35,12 @@ import static io.ultreia.java4all.i18n.I18n.t;
    34 35
      * Created on 06/09/2020.
    
    35 36
      *
    
    36 37
      * @author Tony Chemit - dev@tchemit.fr
    
    37
    - * @since
    
    38
    + * @since 8.1.0
    
    38 39
      */
    
    39 40
     public class SampleNavigationTreeNode extends ReferenceNavigationTreeNodeSupport<SampleDto, SampleReference> {
    
    40 41
     
    
    41 42
         public SampleNavigationTreeNode(SampleReference data) {
    
    42
    -        super(data, ObserveSeineLocalmarketSampleEditNode.class, ObserveSeineLocalmarketSampleEditNode.class, true);
    
    43
    -        if (isPersisted()) {
    
    44
    -//            add(new ActivityListNavigationTreeNode());
    
    45
    -        }
    
    43
    +        super(data, ObserveSeineLocalmarketSampleSelectNode.class, ObserveSeineLocalmarketSampleEditNode.class, false);
    
    46 44
         }
    
    47 45
     
    
    48 46
         @Override
    
    ... ... @@ -53,7 +51,7 @@ public class SampleNavigationTreeNode extends ReferenceNavigationTreeNodeSupport
    53 51
     
    
    54 52
         @Override
    
    55 53
         public boolean isLeaf() {
    
    56
    -        return !isPersisted();
    
    54
    +        return true;
    
    57 55
         }
    
    58 56
     
    
    59 57
         @Override
    

  • client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/tree/navigation/nodes/data/ps/localmarket/SurveyNavigationTreeNode.java
    ... ... @@ -27,6 +27,7 @@ import fr.ird.observe.client.datasource.editor.tree.navigation.nodes.ReferenceNa
    27 27
     import fr.ird.observe.dto.data.ps.localmarket.SurveyDto;
    
    28 28
     import fr.ird.observe.dto.data.ps.localmarket.SurveyReference;
    
    29 29
     import fr.ird.observe.navigation.model.edit.seine.node.ObserveSeineLocalmarketSurveyEditNode;
    
    30
    +import fr.ird.observe.navigation.model.select.seine.node.ObserveSeineLocalmarketSurveySelectNode;
    
    30 31
     
    
    31 32
     import static io.ultreia.java4all.i18n.I18n.t;
    
    32 33
     
    
    ... ... @@ -39,10 +40,7 @@ import static io.ultreia.java4all.i18n.I18n.t;
    39 40
     public class SurveyNavigationTreeNode extends ReferenceNavigationTreeNodeSupport<SurveyDto, SurveyReference> {
    
    40 41
     
    
    41 42
         public SurveyNavigationTreeNode(SurveyReference data) {
    
    42
    -        super(data, ObserveSeineLocalmarketSurveyEditNode.class, ObserveSeineLocalmarketSurveyEditNode.class, true);
    
    43
    -        if (isPersisted()) {
    
    44
    -//            add(new ActivityListNavigationTreeNode());
    
    45
    -        }
    
    43
    +        super(data, ObserveSeineLocalmarketSurveySelectNode.class, ObserveSeineLocalmarketSurveyEditNode.class, false);
    
    46 44
         }
    
    47 45
     
    
    48 46
         @Override
    
    ... ... @@ -53,7 +51,7 @@ public class SurveyNavigationTreeNode extends ReferenceNavigationTreeNodeSupport
    53 51
     
    
    54 52
         @Override
    
    55 53
         public boolean isLeaf() {
    
    56
    -        return !isPersisted();
    
    54
    +        return true;
    
    57 55
         }
    
    58 56
     
    
    59 57
         @Override
    

  • observe-i18n/src/main/i18n/translations/observe_en_GB.properties
    ... ... @@ -1380,6 +1380,7 @@ observe.data.ps.landing.Landing.title=Landing
    1380 1380
     observe.data.ps.landing.Landing.type=Landing
    
    1381 1381
     observe.data.ps.landing.Landing.weight=Weight (t)
    
    1382 1382
     observe.data.ps.landing.Landing.weightCategory=Weight category
    
    1383
    +observe.data.ps.localmarket.Batch.action.create=Add a new batch
    
    1383 1384
     observe.data.ps.localmarket.Batch.action.create.tip=Insert this batch
    
    1384 1385
     observe.data.ps.localmarket.Batch.action.create.tip.tip=Insert this batch
    
    1385 1386
     observe.data.ps.localmarket.Batch.count=Count
    
    ... ... @@ -1455,6 +1456,7 @@ observe.data.ps.localmarket.SurveyPart.table.species=Species
    1455 1456
     observe.data.ps.localmarket.SurveyPart.table.species.tip=Species
    
    1456 1457
     observe.data.ps.localmarket.SurveyPart.title=Survey part
    
    1457 1458
     observe.data.ps.localmarket.SurveyPart.type=Survey part
    
    1459
    +observe.data.ps.localmarket.title=Local market
    
    1458 1460
     observe.data.ps.logbook.Activity.action.addFloatingObject=Add FAD
    
    1459 1461
     observe.data.ps.logbook.Activity.action.addFloatingObject.tip=Add a FAD to the activity
    
    1460 1462
     observe.data.ps.logbook.Activity.action.addSet=Add a Set
    

  • observe-i18n/src/main/i18n/translations/observe_es_ES.properties
    ... ... @@ -1380,6 +1380,7 @@ observe.data.ps.landing.Landing.title=Landing \#TODO
    1380 1380
     observe.data.ps.landing.Landing.type=Landing \#TODO
    
    1381 1381
     observe.data.ps.landing.Landing.weight=Weight (t) \#TODO
    
    1382 1382
     observe.data.ps.landing.Landing.weightCategory=Weight category \#TODO
    
    1383
    +observe.data.ps.localmarket.Batch.action.create=Add a new batch \#TODO
    
    1383 1384
     observe.data.ps.localmarket.Batch.action.create.tip=Insert this batch
    
    1384 1385
     observe.data.ps.localmarket.Batch.action.create.tip.tip=Insert this batch
    
    1385 1386
     observe.data.ps.localmarket.Batch.count=Count
    
    ... ... @@ -1455,6 +1456,7 @@ observe.data.ps.localmarket.SurveyPart.table.species=Species
    1455 1456
     observe.data.ps.localmarket.SurveyPart.table.species.tip=Species
    
    1456 1457
     observe.data.ps.localmarket.SurveyPart.title=Survey part
    
    1457 1458
     observe.data.ps.localmarket.SurveyPart.type=Survey part
    
    1459
    +observe.data.ps.localmarket.title=Local market \#TODO
    
    1458 1460
     observe.data.ps.logbook.Activity.action.addFloatingObject=Añadir un FOB
    
    1459 1461
     observe.data.ps.logbook.Activity.action.addFloatingObject.tip=Añadir un objeto flotante a la actividad
    
    1460 1462
     observe.data.ps.logbook.Activity.action.addSet=Añadir un lance
    

  • observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
    ... ... @@ -1380,6 +1380,7 @@ observe.data.ps.landing.Landing.title=Débarquements
    1380 1380
     observe.data.ps.landing.Landing.type=Débarquements
    
    1381 1381
     observe.data.ps.landing.Landing.weight=Poids (en t)
    
    1382 1382
     observe.data.ps.landing.Landing.weightCategory=Catégorie de poids
    
    1383
    +observe.data.ps.localmarket.Batch.action.create=Ajouter un lot
    
    1383 1384
     observe.data.ps.localmarket.Batch.action.create.tip=Insérer ce lot
    
    1384 1385
     observe.data.ps.localmarket.Batch.action.create.tip.tip=Insérer ce lot
    
    1385 1386
     observe.data.ps.localmarket.Batch.count=Nombre
    
    ... ... @@ -1455,6 +1456,7 @@ observe.data.ps.localmarket.SurveyPart.table.species=Espèce
    1455 1456
     observe.data.ps.localmarket.SurveyPart.table.species.tip=Espèce
    
    1456 1457
     observe.data.ps.localmarket.SurveyPart.title=Données de sondage
    
    1457 1458
     observe.data.ps.localmarket.SurveyPart.type=Données de sondage
    
    1459
    +observe.data.ps.localmarket.title=Marché local
    
    1458 1460
     observe.data.ps.logbook.Activity.action.addFloatingObject=Ajouter un DCP
    
    1459 1461
     observe.data.ps.logbook.Activity.action.addFloatingObject.tip=Ajouter un objet flottant à l'activité
    
    1460 1462
     observe.data.ps.logbook.Activity.action.addSet=Ajouter la calée
    

  • test/src/main/resources/db/8.1/dataForTestLongline.sql.gz
    No preview for this file type
  • test/src/main/resources/db/8.1/dataForTestSeine.sql.gz
    No preview for this file type
  • test/src/main/resources/db/8.1/referentiel.sql.gz
    No preview for this file type