Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
-
9492f99e
by Tony CHEMIT at 2018-07-03T17:03:14Z
18 changed files:
- client/src/main/java/fr/ird/observe/client/ui/content/data/longline/BranchlineUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/longline/CatchLonglineUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/longline/GearUseFeaturesLonglineUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/longline/LonglineDetailCompositionUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/longline/LonglineGlobalCompositionUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/longline/SetLonglineUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/longline/TdrUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/seine/ActivitySeineUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/seine/FloatingObjectUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/seine/SetSeineUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/ref/common/GearUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/ref/common/LengthLengthParameterUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/ref/common/LengthWeightParameterUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/ref/common/ProgramUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/ref/common/SpeciesGroupUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/ref/common/SpeciesListUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/ref/common/SpeciesUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/ref/common/VesselUIHandler.java
Changes:
| ... | ... | @@ -43,6 +43,7 @@ import org.nuiton.util.DateUtil; |
| 43 | 43 |
import org.nuiton.validator.NuitonValidatorScope;
|
| 44 | 44 |
|
| 45 | 45 |
import javax.swing.JOptionPane;
|
| 46 |
+import javax.swing.SwingUtilities;
|
|
| 46 | 47 |
import javax.swing.event.TableModelListener;
|
| 47 | 48 |
import java.util.Calendar;
|
| 48 | 49 |
import java.util.Date;
|
| ... | ... | @@ -212,6 +212,7 @@ public class CatchLonglineUIHandler extends ContentTableUIHandler<SetLonglineCat |
| 212 | 212 |
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
|
| 213 | 213 |
computeTabValidState(errorTableModel);
|
| 214 | 214 |
|
| 215 |
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
|
|
| 215 | 216 |
}
|
| 216 | 217 |
|
| 217 | 218 |
public void resetBranchline() {
|
| ... | ... | @@ -727,7 +728,7 @@ public class CatchLonglineUIHandler extends ContentTableUIHandler<SetLonglineCat |
| 727 | 728 |
if (!newValue && getUi().getMainTabbedPane().getSelectedIndex() > 2) {
|
| 728 | 729 |
|
| 729 | 730 |
// go back to first tab
|
| 730 |
- getUi().getMainTabbedPane().setSelectedIndex(0);
|
|
| 731 |
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
|
|
| 731 | 732 |
|
| 732 | 733 |
}
|
| 733 | 734 |
|
| ... | ... | @@ -188,9 +188,8 @@ public class GearUseFeaturesLonglineUIHandler extends ContentTableUIHandler<Trip |
| 188 | 188 |
|
| 189 | 189 |
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
|
| 190 | 190 |
computeTabValidState(errorTableModel);
|
| 191 |
- |
|
| 191 |
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
|
|
| 192 | 192 |
}
|
| 193 |
- |
|
| 194 | 193 |
@Override
|
| 195 | 194 |
public void startEditUI(String... binding) {
|
| 196 | 195 |
|
| ... | ... | @@ -58,6 +58,7 @@ import org.nuiton.validator.NuitonValidatorScope; |
| 58 | 58 |
|
| 59 | 59 |
import javax.swing.JComboBox;
|
| 60 | 60 |
import javax.swing.JOptionPane;
|
| 61 |
+import javax.swing.SwingUtilities;
|
|
| 61 | 62 |
import javax.swing.event.ChangeListener;
|
| 62 | 63 |
import javax.swing.event.TableModelListener;
|
| 63 | 64 |
import java.beans.PropertyChangeListener;
|
| ... | ... | @@ -428,8 +429,6 @@ public class LonglineDetailCompositionUIHandler extends ContentUIHandler<SetLong |
| 428 | 429 |
|
| 429 | 430 |
}
|
| 430 | 431 |
|
| 431 |
- // Always go back to first tab
|
|
| 432 |
- getUi().getMainTabbedPane().setSelectedIndex(0);
|
|
| 433 | 432 |
|
| 434 | 433 |
} finally {
|
| 435 | 434 |
|
| ... | ... | @@ -441,6 +440,7 @@ public class LonglineDetailCompositionUIHandler extends ContentUIHandler<SetLong |
| 441 | 440 |
getUi().startEdit(null);
|
| 442 | 441 |
}
|
| 443 | 442 |
|
| 443 |
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
|
|
| 444 | 444 |
}
|
| 445 | 445 |
|
| 446 | 446 |
@Override
|
| ... | ... | @@ -43,6 +43,7 @@ import org.apache.commons.logging.LogFactory; |
| 43 | 43 |
import org.nuiton.jaxx.runtime.spi.UIHandler;
|
| 44 | 44 |
import org.nuiton.validator.NuitonValidatorScope;
|
| 45 | 45 |
|
| 46 |
+import javax.swing.SwingUtilities;
|
|
| 46 | 47 |
import java.util.Optional;
|
| 47 | 48 |
|
| 48 | 49 |
import static org.nuiton.i18n.I18n.t;
|
| ... | ... | @@ -208,7 +209,7 @@ public class LonglineGlobalCompositionUIHandler extends ContentUIHandler<SetLong |
| 208 | 209 |
compositionUI.open();
|
| 209 | 210 |
|
| 210 | 211 |
}
|
| 211 |
- |
|
| 212 |
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
|
|
| 212 | 213 |
}
|
| 213 | 214 |
|
| 214 | 215 |
@Override
|
| ... | ... | @@ -50,6 +50,7 @@ import org.nuiton.jaxx.widgets.gis.absolute.CoordinatesEditorModel; |
| 50 | 50 |
import org.nuiton.jaxx.widgets.hidor.HidorButton;
|
| 51 | 51 |
import org.nuiton.validator.NuitonValidatorScope;
|
| 52 | 52 |
|
| 53 |
+import javax.swing.SwingUtilities;
|
|
| 53 | 54 |
import javax.swing.event.TableModelListener;
|
| 54 | 55 |
import java.beans.PropertyChangeListener;
|
| 55 | 56 |
import java.util.HashSet;
|
| ... | ... | @@ -250,6 +251,7 @@ public class SetLonglineUIHandler extends ContentUIHandler<SetLonglineDto, SetLo |
| 250 | 251 |
getUi().startEdit(null);
|
| 251 | 252 |
}
|
| 252 | 253 |
|
| 254 |
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
|
|
| 253 | 255 |
}
|
| 254 | 256 |
|
| 255 | 257 |
@Override
|
| ... | ... | @@ -53,6 +53,7 @@ import org.nuiton.validator.NuitonValidatorScope; |
| 53 | 53 |
import javax.swing.JComponent;
|
| 54 | 54 |
import javax.swing.JOptionPane;
|
| 55 | 55 |
import javax.swing.JTable;
|
| 56 |
+import javax.swing.SwingUtilities;
|
|
| 56 | 57 |
import javax.swing.event.TableModelListener;
|
| 57 | 58 |
import javax.swing.table.DefaultTableCellRenderer;
|
| 58 | 59 |
import java.beans.PropertyChangeListener;
|
| ... | ... | @@ -225,6 +226,7 @@ public class TdrUIHandler extends ContentTableUIHandler<SetLonglineTdrDto, TdrDt |
| 225 | 226 |
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
|
| 226 | 227 |
computeTabValidState(errorTableModel);
|
| 227 | 228 |
|
| 229 |
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
|
|
| 228 | 230 |
}
|
| 229 | 231 |
|
| 230 | 232 |
@Override
|
| ... | ... | @@ -238,6 +238,8 @@ class ActivitySeineUIHandler extends ContentOpenableUIHandler<ActivitySeineDto, |
| 238 | 238 |
|
| 239 | 239 |
// on annule la modification engendree par ce binding
|
| 240 | 240 |
getModel().setModified(create);
|
| 241 |
+ |
|
| 242 |
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
|
|
| 241 | 243 |
}
|
| 242 | 244 |
|
| 243 | 245 |
@Override
|
| ... | ... | @@ -198,13 +198,11 @@ public class FloatingObjectUIHandler extends ContentUIHandler<FloatingObjectDto, |
| 198 | 198 |
getUi().startEdit(null);
|
| 199 | 199 |
}
|
| 200 | 200 |
|
| 201 |
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
|
|
| 201 | 202 |
}
|
| 202 | 203 |
|
| 203 | 204 |
@Override
|
| 204 | 205 |
protected void openedUI() {
|
| 205 |
- if (getModel().isCreatingMode()) {
|
|
| 206 |
- getUi().getMainTabbedPane().setSelectedIndex(0);
|
|
| 207 |
- }
|
|
| 208 | 206 |
|
| 209 | 207 |
SwingUtilities.invokeLater(this::forceGrabFocusOnForm);
|
| 210 | 208 |
}
|
| ... | ... | @@ -49,6 +49,7 @@ import org.nuiton.jaxx.widgets.hidor.HidorButton; |
| 49 | 49 |
import org.nuiton.util.DateUtil;
|
| 50 | 50 |
import org.nuiton.validator.NuitonValidatorScope;
|
| 51 | 51 |
|
| 52 |
+import javax.swing.SwingUtilities;
|
|
| 52 | 53 |
import javax.swing.event.TableModelListener;
|
| 53 | 54 |
import java.beans.PropertyChangeListener;
|
| 54 | 55 |
import java.util.Date;
|
| ... | ... | @@ -193,8 +194,9 @@ public class SetSeineUIHandler extends ContentUIHandler<SetSeineDto, SetSeineUI> |
| 193 | 194 |
if (mode != ContentMode.READ) {
|
| 194 | 195 |
getUi().startEdit(null);
|
| 195 | 196 |
}
|
| 197 |
+ super.openUI();
|
|
| 198 |
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
|
|
| 196 | 199 |
}
|
| 197 |
- |
|
| 198 | 200 |
@Override
|
| 199 | 201 |
public void startEditUI(String... binding) {
|
| 200 | 202 |
ContentUIModel<SetSeineDto> model = getModel();
|
| ... | ... | @@ -30,6 +30,7 @@ import org.nuiton.jaxx.validator.swing.SwingValidatorMessage; |
| 30 | 30 |
import org.nuiton.jaxx.validator.swing.SwingValidatorMessageTableModel;
|
| 31 | 31 |
import org.nuiton.validator.NuitonValidatorScope;
|
| 32 | 32 |
|
| 33 |
+import javax.swing.SwingUtilities;
|
|
| 33 | 34 |
import javax.swing.event.TableModelListener;
|
| 34 | 35 |
import java.util.HashSet;
|
| 35 | 36 |
import java.util.Set;
|
| ... | ... | @@ -73,7 +74,7 @@ public class GearUIHandler extends ContentReferenceUIHandler<GearDto, GearRefere |
| 73 | 74 |
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
|
| 74 | 75 |
computeTabValidState(errorTableModel);
|
| 75 | 76 |
|
| 76 |
- getUi().getMainTabbedPane().setSelectedIndex(0);
|
|
| 77 |
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
|
|
| 77 | 78 |
|
| 78 | 79 |
}
|
| 79 | 80 |
|
| ... | ... | @@ -30,6 +30,7 @@ import org.nuiton.jaxx.validator.swing.SwingValidatorMessage; |
| 30 | 30 |
import org.nuiton.jaxx.validator.swing.SwingValidatorMessageTableModel;
|
| 31 | 31 |
import org.nuiton.validator.NuitonValidatorScope;
|
| 32 | 32 |
|
| 33 |
+import javax.swing.SwingUtilities;
|
|
| 33 | 34 |
import javax.swing.event.TableModelListener;
|
| 34 | 35 |
import java.util.HashSet;
|
| 35 | 36 |
import java.util.Set;
|
| ... | ... | @@ -72,7 +73,7 @@ public class LengthLengthParameterUIHandler extends ContentReferenceUIHandler<Le |
| 72 | 73 |
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
|
| 73 | 74 |
computeTabValidState(errorTableModel);
|
| 74 | 75 |
|
| 75 |
- getUi().getMainTabbedPane().setSelectedIndex(0);
|
|
| 76 |
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
|
|
| 76 | 77 |
|
| 77 | 78 |
}
|
| 78 | 79 |
|
| ... | ... | @@ -30,6 +30,7 @@ import org.nuiton.jaxx.validator.swing.SwingValidatorMessage; |
| 30 | 30 |
import org.nuiton.jaxx.validator.swing.SwingValidatorMessageTableModel;
|
| 31 | 31 |
import org.nuiton.validator.NuitonValidatorScope;
|
| 32 | 32 |
|
| 33 |
+import javax.swing.SwingUtilities;
|
|
| 33 | 34 |
import javax.swing.event.TableModelListener;
|
| 34 | 35 |
import java.util.HashSet;
|
| 35 | 36 |
import java.util.Set;
|
| ... | ... | @@ -73,7 +74,7 @@ public class LengthWeightParameterUIHandler extends ContentReferenceUIHandler<Le |
| 73 | 74 |
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
|
| 74 | 75 |
computeTabValidState(errorTableModel);
|
| 75 | 76 |
|
| 76 |
- getUi().getMainTabbedPane().setSelectedIndex(0);
|
|
| 77 |
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
|
|
| 77 | 78 |
|
| 78 | 79 |
}
|
| 79 | 80 |
|
| ... | ... | @@ -30,6 +30,7 @@ import org.nuiton.jaxx.validator.swing.SwingValidatorMessage; |
| 30 | 30 |
import org.nuiton.jaxx.validator.swing.SwingValidatorMessageTableModel;
|
| 31 | 31 |
import org.nuiton.validator.NuitonValidatorScope;
|
| 32 | 32 |
|
| 33 |
+import javax.swing.SwingUtilities;
|
|
| 33 | 34 |
import javax.swing.event.TableModelListener;
|
| 34 | 35 |
import java.util.HashSet;
|
| 35 | 36 |
import java.util.Set;
|
| ... | ... | @@ -72,7 +73,7 @@ public class ProgramUIHandler extends ContentReferenceUIHandler<ProgramDto, Prog |
| 72 | 73 |
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
|
| 73 | 74 |
computeTabValidState(errorTableModel);
|
| 74 | 75 |
|
| 75 |
- getUi().getMainTabbedPane().setSelectedIndex(0);
|
|
| 76 |
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
|
|
| 76 | 77 |
|
| 77 | 78 |
}
|
| 78 | 79 |
|
| ... | ... | @@ -30,6 +30,7 @@ import org.nuiton.jaxx.validator.swing.SwingValidatorMessage; |
| 30 | 30 |
import org.nuiton.jaxx.validator.swing.SwingValidatorMessageTableModel;
|
| 31 | 31 |
import org.nuiton.validator.NuitonValidatorScope;
|
| 32 | 32 |
|
| 33 |
+import javax.swing.SwingUtilities;
|
|
| 33 | 34 |
import javax.swing.event.TableModelListener;
|
| 34 | 35 |
import java.util.HashSet;
|
| 35 | 36 |
import java.util.Set;
|
| ... | ... | @@ -67,7 +68,7 @@ public class SpeciesGroupUIHandler extends ContentReferenceUIHandler<SpeciesGrou |
| 67 | 68 |
public void selectBean(SpeciesGroupReference selectedReference) {
|
| 68 | 69 |
super.selectBean(selectedReference);
|
| 69 | 70 |
computeTabValidState(getUi().getErrorTableModel());
|
| 70 |
- getUi().getMainTabbedPane().setSelectedIndex(0);
|
|
| 71 |
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
|
|
| 71 | 72 |
}
|
| 72 | 73 |
|
| 73 | 74 |
protected void computeTabValidState(SwingValidatorMessageTableModel errorTableModel) {
|
| ... | ... | @@ -30,6 +30,7 @@ import org.nuiton.jaxx.validator.swing.SwingValidatorMessage; |
| 30 | 30 |
import org.nuiton.jaxx.validator.swing.SwingValidatorMessageTableModel;
|
| 31 | 31 |
import org.nuiton.validator.NuitonValidatorScope;
|
| 32 | 32 |
|
| 33 |
+import javax.swing.SwingUtilities;
|
|
| 33 | 34 |
import javax.swing.event.TableModelListener;
|
| 34 | 35 |
import java.util.HashSet;
|
| 35 | 36 |
import java.util.Set;
|
| ... | ... | @@ -69,7 +70,7 @@ public class SpeciesListUIHandler extends ContentReferenceUIHandler<SpeciesListD |
| 69 | 70 |
super.selectBean(selectedBean);
|
| 70 | 71 |
|
| 71 | 72 |
computeTabValidState(getUi().getErrorTableModel());
|
| 72 |
- getUi().getMainTabbedPane().setSelectedIndex(0);
|
|
| 73 |
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
|
|
| 73 | 74 |
|
| 74 | 75 |
}
|
| 75 | 76 |
|
| ... | ... | @@ -30,6 +30,7 @@ import org.nuiton.jaxx.validator.swing.SwingValidatorMessage; |
| 30 | 30 |
import org.nuiton.jaxx.validator.swing.SwingValidatorMessageTableModel;
|
| 31 | 31 |
import org.nuiton.validator.NuitonValidatorScope;
|
| 32 | 32 |
|
| 33 |
+import javax.swing.SwingUtilities;
|
|
| 33 | 34 |
import javax.swing.event.TableModelListener;
|
| 34 | 35 |
import java.util.HashSet;
|
| 35 | 36 |
import java.util.Set;
|
| ... | ... | @@ -73,7 +74,7 @@ public class SpeciesUIHandler extends ContentReferenceUIHandler<SpeciesDto, Spec |
| 73 | 74 |
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
|
| 74 | 75 |
computeTabValidState(errorTableModel);
|
| 75 | 76 |
|
| 76 |
- getUi().getMainTabbedPane().setSelectedIndex(0);
|
|
| 77 |
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
|
|
| 77 | 78 |
|
| 78 | 79 |
}
|
| 79 | 80 |
|
| ... | ... | @@ -30,6 +30,7 @@ import org.nuiton.jaxx.validator.swing.SwingValidatorMessage; |
| 30 | 30 |
import org.nuiton.jaxx.validator.swing.SwingValidatorMessageTableModel;
|
| 31 | 31 |
import org.nuiton.validator.NuitonValidatorScope;
|
| 32 | 32 |
|
| 33 |
+import javax.swing.SwingUtilities;
|
|
| 33 | 34 |
import javax.swing.event.TableModelListener;
|
| 34 | 35 |
import java.util.HashSet;
|
| 35 | 36 |
import java.util.Set;
|
| ... | ... | @@ -71,7 +72,7 @@ public class VesselUIHandler extends ContentReferenceUIHandler<VesselDto, Vessel |
| 71 | 72 |
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
|
| 72 | 73 |
computeTabValidState(errorTableModel);
|
| 73 | 74 |
|
| 74 |
- getUi().getMainTabbedPane().setSelectedIndex(0);
|
|
| 75 |
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
|
|
| 75 | 76 |
|
| 76 | 77 |
}
|
| 77 | 78 |
|