Observe-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
November 2016
- 1 participants
- 84 discussions
10/32: meilleure gestion du faction, réusinage des actions, ajout des actions globales
by codelutin.com scm 25 Nov '16
by codelutin.com scm 25 Nov '16
25 Nov '16
This is an automated email from the git hooks/post-receive script.
New commit to branch develop in repository observe.
See https://gitlab.nuiton.org/codelutin/observe.git
commit 8357698a5edcfa54ce08177117fbc421690be78b
Author: Tony CHEMIT <chemit(a)codelutin.com>
Date: Sun Nov 13 20:13:56 2016 +0100
meilleure gestion du faction, réusinage des actions, ajout des actions globales
---
.../CoordinateLatitudeDtoFieldValidator.java | 4 +
.../CoordinateLongitudeDtoFieldValidator.java | 4 +
.../application/swing/ui/BorderFocusListener.java | 50 ++
.../application/swing/ui/ObserveMainUI.jaxx | 4 +-
.../application/swing/ui/ObserveMainUI.jcss | 6 +-
.../application/swing/ui/ObserveMainUIHandler.java | 32 +-
.../AbstractContentUIAction.java | 3 +-
.../{shared => content}/CancelCreateUIAction.java | 3 +-
.../CloseAndCreateUIAction.java | 3 +-
.../{shared => content}/CloseOpenUIAction.java | 5 +-
.../ui/actions/content/CreateOpenUIAction.java | 29 +
.../{shared => content}/DeleteDataUIAction.java | 3 +-
.../DeleteReferenceUIAction.java | 3 +-
.../DeleteTableEntryUIAction.java | 3 +-
.../MoveActivityLonglinesUIAction.java | 2 +-
.../MoveActivitySeinesUIAction.java | 3 +-
.../{shared => content}/MoveRoutesUIAction.java | 57 +-
.../MoveTripLonglinesUIAction.java | 3 +-
.../MoveTripSeinesUIAction.java | 3 +-
.../{shared => content}/MoveTripsUIAction.java | 43 +-
.../{shared => content}/NewTableEntryUIAction.java | 3 +-
.../{shared => content}/ReOpenUIAction.java | 5 +-
.../{shared => content}/ResetEditUIAction.java | 15 +-
.../ResetTableEntryUIAction.java | 3 +-
.../{shared => content}/SaveEditUIAction.java | 6 +-
.../SaveTableEntryUIAction.java | 3 +-
.../ui/actions/global/AbstractGlobalUIAction.java | 18 +
.../actions/global/ChangeFocusGlobalUIAction.java | 60 ++
.../actions/global/DeleteDataGlobalUIAction.java | 45 +
.../actions/global/NewNextDataGlobalUIAction.java | 45 +
.../global/OpenCloseDataGlobalUIAction.java | 76 ++
.../ui/actions/global/ResetDataGlobalUIAction.java | 38 +
.../ui/actions/global/SaveDataGlobalUIAction.java | 38 +
.../swing/ui/actions/shared/AbstractUIAction.java | 21 +-
.../application/swing/ui/content/Common.jcss | 4 +
.../application/swing/ui/content/ContentUI.jcss | 2 +
.../swing/ui/content/ContentUIBlockingLayerUI.java | 10 +-
.../swing/ui/content/ContentUIHandler.java | 69 +-
.../swing/ui/content/ContentUIInitializer.java | 7 +
.../swing/ui/content/ContentUIManager.java | 54 +-
.../swing/ui/content/ObserveActionMap.java | 54 +-
.../swing/ui/content/ObserveFocusManager.java | 943 +++++++--------------
.../impl/longline/LonglineDetailCompositionUI.jaxx | 4 +-
.../impl/longline/LonglineGlobalCompositionUI.jaxx | 4 +-
.../ui/content/impl/longline/SetLonglineUI.jaxx | 8 +-
.../FloatingObjectTransmittingBuoyOperationUI.jaxx | 4 +-
.../ui/content/impl/seine/FloatingObjectUI.jaxx | 8 +-
.../swing/ui/content/impl/seine/SetSeineUI.jaxx | 8 +-
.../swing/ui/content/list/ContentListUI.jaxx | 7 +-
.../swing/ui/content/list/ContentListUI.jcss | 2 +-
.../ui/content/list/ContentListUIHandler.java | 13 +-
.../list/impl/longline/ActivityLonglinesUI.jaxx | 9 +-
.../list/impl/longline/ActivityLonglinesUI.jcss | 7 +-
.../content/list/impl/longline/CommonListUI.jcss | 4 +
.../list/impl/longline/TripLonglinesUI.jaxx | 3 +-
.../list/impl/longline/TripLonglinesUI.jcss | 8 +-
.../content/list/impl/seine/ActivitySeinesUI.jaxx | 6 +-
.../ui/content/list/impl/seine/CommonListUI.jcss | 4 +
.../swing/ui/content/list/impl/seine/RoutesUI.jaxx | 2 +-
.../ui/content/list/impl/seine/TripSeinesUI.jaxx | 2 +-
.../swing/ui/content/open/ContentOpenableUI.jaxx | 19 +-
.../swing/ui/content/open/ContentOpenableUI.jcss | 9 +-
.../open/impl/longline/ActivityLonglineUI.jaxx | 2 +-
.../content/open/impl/longline/TripLonglineUI.jaxx | 2 +-
.../content/open/impl/seine/ActivitySeineUI.jaxx | 2 +-
.../swing/ui/content/ref/ContentReferenceUI.jaxx | 6 +-
.../ui/content/ref/ContentReferenceUIHandler.java | 2 +-
.../swing/ui/content/table/CommonTable.jcss | 4 +
.../swing/ui/content/table/ContentTableUI.jaxx | 12 +-
.../ui/content/table/ContentTableUIHandler.java | 4 +-
.../table/impl/longline/SensorUsedUIHandler.java | 6 +-
.../content/table/impl/longline/TdrUIHandler.java | 6 +-
.../swing/ui/tree/ObserveTreeHelper.java | 3 +-
73 files changed, 1121 insertions(+), 841 deletions(-)
diff --git a/application-swing-validators/src/main/java/fr/ird/observe/application/swing/validators/CoordinateLatitudeDtoFieldValidator.java b/application-swing-validators/src/main/java/fr/ird/observe/application/swing/validators/CoordinateLatitudeDtoFieldValidator.java
index 597c669..86de2b7 100644
--- a/application-swing-validators/src/main/java/fr/ird/observe/application/swing/validators/CoordinateLatitudeDtoFieldValidator.java
+++ b/application-swing-validators/src/main/java/fr/ird/observe/application/swing/validators/CoordinateLatitudeDtoFieldValidator.java
@@ -62,6 +62,10 @@ public class CoordinateLatitudeDtoFieldValidator extends FieldValidatorSupport {
Map<String, CoordinatesEditor> map = (Map<String, CoordinatesEditor>) getFieldValue("coordinatesEditors", object);
CoordinatesEditor coordinatesEditor = map.get(editorName);
+ //FIXME une validation est lancé dans l'ui alors que l'on ne devrait pas et on a pas ce composant alors
+ if (coordinatesEditor == null) {
+ return;
+ }
Objects.requireNonNull(coordinatesEditor, "can't find editor named " + editorName);
CoordinateFormat format = coordinatesEditor.getModel().getFormat();
diff --git a/application-swing-validators/src/main/java/fr/ird/observe/application/swing/validators/CoordinateLongitudeDtoFieldValidator.java b/application-swing-validators/src/main/java/fr/ird/observe/application/swing/validators/CoordinateLongitudeDtoFieldValidator.java
index c94fe60..4c51cab 100644
--- a/application-swing-validators/src/main/java/fr/ird/observe/application/swing/validators/CoordinateLongitudeDtoFieldValidator.java
+++ b/application-swing-validators/src/main/java/fr/ird/observe/application/swing/validators/CoordinateLongitudeDtoFieldValidator.java
@@ -62,6 +62,10 @@ public class CoordinateLongitudeDtoFieldValidator extends FieldValidatorSupport
Map<String, CoordinatesEditor> map = (Map<String, CoordinatesEditor>) getFieldValue("coordinatesEditors", object);
CoordinatesEditor coordinatesEditor = map.get(editorName);
+ //FIXME une validation est lancé dans l'ui alors que l'on ne devrait pas et on a pas ce composant alors
+ if (coordinatesEditor == null) {
+ return;
+ }
Objects.requireNonNull(coordinatesEditor, "can't find editor named " + editorName);
CoordinateFormat format = coordinatesEditor.getModel().getFormat();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/BorderFocusListener.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/BorderFocusListener.java
new file mode 100644
index 0000000..c064f1b
--- /dev/null
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/BorderFocusListener.java
@@ -0,0 +1,50 @@
+package fr.ird.observe.application.swing.ui;
+
+import javax.swing.JComponent;
+import javax.swing.border.Border;
+import javax.swing.border.LineBorder;
+import java.awt.Color;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+
+/**
+ * Created on 10/11/16.
+ *
+ * @author Tony Chemit - chemit(a)codelutin.com
+ * @since 5.1
+ */
+public class BorderFocusListener implements FocusListener {
+
+ private final Border defaultBorder;
+ private final JComponent container2;
+ private final Border focusBorder;
+ private final JComponent container;
+ private boolean enabled;
+
+ public BorderFocusListener(ObserveMainUI mainUI) {
+ this.container = mainUI.getNavigationView();
+ this.defaultBorder = container.getBorder();
+ this.container2 = mainUI.getSplitpane2();
+ this.focusBorder = new LineBorder(Color.blue, 3, true);
+ }
+
+ @Override
+ public void focusGained(FocusEvent e) {
+ if (enabled) {
+ container.setBorder(focusBorder);
+ container2.setBorder(defaultBorder);
+ }
+ }
+
+ @Override
+ public void focusLost(FocusEvent e) {
+ if (enabled) {
+ container.setBorder(defaultBorder);
+ container2.setBorder(focusBorder);
+ }
+ }
+
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUI.jaxx
index 271c367..22ce441 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUI.jaxx
@@ -35,7 +35,7 @@
fr.ird.observe.services.dto.seine.TripSeineDto
fr.ird.observe.services.dto.constants.ReferentialLocale
- fr.ird.observe.application.swing.ui.actions.shared.ReOpenUIAction
+ fr.ird.observe.application.swing.ui.actions.content.ReOpenUIAction
fr.ird.observe.application.swing.ui.admin.AdminStep
fr.ird.observe.application.swing.ui.actions.ChangeStorageAction
@@ -341,4 +341,6 @@ void $afterCompleteSetup() {
<!-- status message bar -->
<StatusMessagePanel id='status' constraints="BorderLayout.SOUTH"/>
+ <BorderFocusListener id="borderFocusListener" constructorParams='this'/>
+
</JFrame>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUI.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUI.jcss
index 877da9e..0172c0b 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUI.jcss
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUI.jcss
@@ -50,15 +50,15 @@ JSplitPane {
// trip menu
#navigationOpenAction {
- action: {new fr.ird.observe.application.swing.ui.actions.shared.ReOpenUIAction(this)};
+ action: {new fr.ird.observe.application.swing.ui.actions.content.ReOpenUIAction(this)};
}
#navigationCloseAction {
- action: {new fr.ird.observe.application.swing.ui.actions.shared.CloseOpenUIAction(this)};
+ action: {new fr.ird.observe.application.swing.ui.actions.content.CloseOpenUIAction(this)};
}
#navigationDeleteAction {
- action: {new fr.ird.observe.application.swing.ui.actions.shared.DeleteDataUIAction(this)};
+ action: {new fr.ird.observe.application.swing.ui.actions.content.DeleteDataUIAction(this)};
}
#menuFile {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUIHandler.java
index 78fa0bc..bdb3cad 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUIHandler.java
@@ -31,7 +31,6 @@ import fr.ird.observe.application.swing.ui.content.ContentMode;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.content.ContentUIManager;
import fr.ird.observe.application.swing.ui.content.ContentUIModel;
-import fr.ird.observe.application.swing.ui.content.ObserveContentUI;
import fr.ird.observe.application.swing.ui.tree.ObserveNavigationTreeShowPopupAction;
import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper;
import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
@@ -50,6 +49,7 @@ import org.apache.commons.logging.LogFactory;
import org.nuiton.i18n.I18n;
import javax.swing.Icon;
+import javax.swing.JComponent;
import javax.swing.SwingUtilities;
import javax.swing.event.TreeExpansionEvent;
import javax.swing.event.TreeSelectionEvent;
@@ -58,6 +58,8 @@ import javax.swing.event.TreeWillExpandListener;
import javax.swing.tree.ExpandVetoException;
import javax.swing.tree.TreePath;
import java.awt.Cursor;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
@@ -101,7 +103,7 @@ public class ObserveMainUIHandler {
ContentUIManager manager = ui.getContentUIManager();
// obtain the ui type to show
- Class<? extends ObserveContentUI<?, ?>> uiClass = manager.convertNodeToContentUI(node);
+ Class<? extends ContentUI<?, ?>> uiClass = manager.convertNodeToContentUI(node);
if (log.isDebugEnabled()) {
log.debug("new selected path = " + node + ", ui = " + uiClass);
}
@@ -132,7 +134,7 @@ public class ObserveMainUIHandler {
}
}
- public void doOpencontent(ObserveMainUI ui, TreePath path, Class<? extends ObserveContentUI<?, ?>> uiClass) {
+ public void doOpencontent(ObserveMainUI ui, TreePath path, Class<? extends ContentUI<?, ?>> uiClass) {
ContentUIManager manager = ui.getContentUIManager();
@@ -157,8 +159,11 @@ public class ObserveMainUIHandler {
DataContext context = ui.getDataContext();
context.populateSelectedIds(selectedIds);
+ BorderFocusListener borderFocusListener = ui.getBorderFocusListener();
+ borderFocusListener.setEnabled(false);
+
// on recherche l'ui (voir si elle existe déjà)
- ObserveContentUI<?, ?> content = manager.getContent(uiClass);
+ ContentUI<?, ?> content = manager.getContent(uiClass);
if (content == null) {
@@ -167,6 +172,8 @@ public class ObserveMainUIHandler {
// on ouvre l'écran
manager.openContent(content);
+
+ SwingUtilities.invokeLater(() -> borderFocusListener.setEnabled(true));
}
/**
@@ -476,6 +483,23 @@ public class ObserveMainUIHandler {
Boolean newvalue = (Boolean) evt.getNewValue();
updateBusyState(ui, newvalue != null && newvalue);
});
+
+ ui.getNavigation().addFocusListener(ui.getBorderFocusListener());
+ ui.getNavigation().addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseEntered(MouseEvent e) {
+ ((JComponent) e.getSource()).grabFocus();
+ }
+ });
+ ui.getSplitpane2().addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseEntered(MouseEvent e) {
+ if (log.isInfoEnabled()) {
+ log.info("grab getSplitpane2 focus: " + e);
+ }
+ ((JComponent) e.getSource()).grabFocus();
+ }
+ });
}
protected void updateBusyState(ObserveMainUI ui, boolean busy) {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/AbstractContentUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/AbstractContentUIAction.java
similarity index 86%
rename from application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/AbstractContentUIAction.java
rename to application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/AbstractContentUIAction.java
index 309f5eb..b9853e5 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/AbstractContentUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/AbstractContentUIAction.java
@@ -1,6 +1,7 @@
-package fr.ird.observe.application.swing.ui.actions.shared;
+package fr.ird.observe.application.swing.ui.actions.content;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.shared.AbstractUIAction;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import java.awt.event.ActionEvent;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CancelCreateUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/CancelCreateUIAction.java
similarity index 92%
rename from application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CancelCreateUIAction.java
rename to application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/CancelCreateUIAction.java
index 5fa99df..e415500 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CancelCreateUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/CancelCreateUIAction.java
@@ -19,9 +19,10 @@
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
-package fr.ird.observe.application.swing.ui.actions.shared;
+package fr.ird.observe.application.swing.ui.actions.content;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.content.AbstractContentUIAction;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseAndCreateUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/CloseAndCreateUIAction.java
similarity index 97%
rename from application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseAndCreateUIAction.java
rename to application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/CloseAndCreateUIAction.java
index 90b9118..c774930 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseAndCreateUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/CloseAndCreateUIAction.java
@@ -19,10 +19,11 @@
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
-package fr.ird.observe.application.swing.ui.actions.shared;
+package fr.ird.observe.application.swing.ui.actions.content;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.content.AbstractContentUIAction;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.content.list.impl.longline.ActivityLonglinesUI;
import fr.ird.observe.application.swing.ui.content.list.impl.seine.ActivitySeinesUI;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseOpenUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/CloseOpenUIAction.java
similarity index 95%
rename from application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseOpenUIAction.java
rename to application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/CloseOpenUIAction.java
index dd838ac..d2c6a43 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseOpenUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/CloseOpenUIAction.java
@@ -19,10 +19,11 @@
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
-package fr.ird.observe.application.swing.ui.actions.shared;
+package fr.ird.observe.application.swing.ui.actions.content;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.content.AbstractContentUIAction;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.content.list.impl.longline.ActivityLonglinesUI;
import fr.ird.observe.application.swing.ui.content.list.impl.longline.TripLonglinesUI;
@@ -60,7 +61,7 @@ public class CloseOpenUIAction extends AbstractContentUIAction {
}
@Override
- protected void actionPerformed(ContentUI<?, ?> ui) {
+ public void actionPerformed(ContentUI<?, ?> ui) {
if (ui instanceof ContentOpenableUI) {
((ContentOpenableUI<?, ?>) ui).closeData();
return;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/CreateOpenUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/CreateOpenUIAction.java
new file mode 100644
index 0000000..cbb1df8
--- /dev/null
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/CreateOpenUIAction.java
@@ -0,0 +1,29 @@
+package fr.ird.observe.application.swing.ui.actions.content;
+
+import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.content.ContentUI;
+import fr.ird.observe.application.swing.ui.content.list.ContentListUI;
+
+/**
+ * Created on 11/11/16.
+ *
+ * @author Tony Chemit - chemit(a)codelutin.com
+ * @since 5.1
+ */
+public class CreateOpenUIAction extends AbstractContentUIAction {
+
+ public static final String ACTION_NAME = "createOpen";
+
+ public CreateOpenUIAction(ObserveMainUI mainUI) {
+ super(mainUI, ACTION_NAME, "<NONE>", "<NONE>", "add", "ctrl pressed N");
+ }
+
+ @Override
+ protected void actionPerformed(ContentUI<?, ?> contentUI) {
+
+ if (contentUI instanceof ContentListUI) {
+ ContentListUI ui = (ContentListUI) contentUI;
+ ui.getHandler().addChild();
+ }
+ }
+}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteDataUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/DeleteDataUIAction.java
similarity index 92%
rename from application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteDataUIAction.java
rename to application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/DeleteDataUIAction.java
index 29f16b0..10327c0 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteDataUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/DeleteDataUIAction.java
@@ -19,9 +19,10 @@
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
-package fr.ird.observe.application.swing.ui.actions.shared;
+package fr.ird.observe.application.swing.ui.actions.content;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.content.AbstractContentUIAction;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import javax.swing.SwingUtilities;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteReferenceUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/DeleteReferenceUIAction.java
similarity index 92%
rename from application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteReferenceUIAction.java
rename to application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/DeleteReferenceUIAction.java
index 6d1eac7..e205d04 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteReferenceUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/DeleteReferenceUIAction.java
@@ -19,9 +19,10 @@
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
-package fr.ird.observe.application.swing.ui.actions.shared;
+package fr.ird.observe.application.swing.ui.actions.content;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.content.AbstractContentUIAction;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import static org.nuiton.i18n.I18n.n;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteTableEntryUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/DeleteTableEntryUIAction.java
similarity index 84%
rename from application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteTableEntryUIAction.java
rename to application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/DeleteTableEntryUIAction.java
index ab78e22..b69ceef 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteTableEntryUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/DeleteTableEntryUIAction.java
@@ -1,6 +1,7 @@
-package fr.ird.observe.application.swing.ui.actions.shared;
+package fr.ird.observe.application.swing.ui.actions.content;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.content.AbstractContentUIAction;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.content.table.ContentTableUI;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveActivityLonglinesUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/MoveActivityLonglinesUIAction.java
similarity index 99%
rename from application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveActivityLonglinesUIAction.java
rename to application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/MoveActivityLonglinesUIAction.java
index 796ec5f..4fdeed0 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveActivityLonglinesUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/MoveActivityLonglinesUIAction.java
@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
-package fr.ird.observe.application.swing.ui.actions.shared;
+package fr.ird.observe.application.swing.ui.actions.content;
import fr.ird.observe.application.swing.ObserveOpenDataManager;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveActivitySeinesUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/MoveActivitySeinesUIAction.java
similarity index 98%
rename from application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveActivitySeinesUIAction.java
rename to application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/MoveActivitySeinesUIAction.java
index dca5e7d..26a9630 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveActivitySeinesUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/MoveActivitySeinesUIAction.java
@@ -19,13 +19,14 @@
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
-package fr.ird.observe.application.swing.ui.actions.shared;
+package fr.ird.observe.application.swing.ui.actions.content;
import fr.ird.observe.application.swing.ObserveOpenDataManager;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
import fr.ird.observe.application.swing.decoration.ObserveI18nDecoratorHelper;
import fr.ird.observe.application.swing.decoration.decorators.DataReferenceDecorator;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.content.AbstractContentUIAction;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.content.list.impl.seine.ActivitySeinesUI;
import fr.ird.observe.application.swing.ui.content.list.impl.seine.ActivitySeinesUIModel;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveRoutesUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/MoveRoutesUIAction.java
similarity index 79%
rename from application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveRoutesUIAction.java
rename to application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/MoveRoutesUIAction.java
index e2bdf49..7abe582 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveRoutesUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/MoveRoutesUIAction.java
@@ -19,13 +19,14 @@
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
-package fr.ird.observe.application.swing.ui.actions.shared;
+package fr.ird.observe.application.swing.ui.actions.content;
import fr.ird.observe.application.swing.ObserveOpenDataManager;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
import fr.ird.observe.application.swing.decoration.ObserveI18nDecoratorHelper;
import fr.ird.observe.application.swing.decoration.decorators.DataReferenceDecorator;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.content.AbstractContentUIAction;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.content.list.impl.seine.RoutesUI;
import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper;
@@ -37,10 +38,7 @@ import fr.ird.observe.services.dto.seine.RouteDto;
import fr.ird.observe.services.dto.seine.TripSeineDto;
import fr.ird.observe.services.service.data.seine.RouteService;
-import javax.swing.JComponent;
import javax.swing.JOptionPane;
-import javax.swing.SwingUtilities;
-import java.awt.event.ActionEvent;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
@@ -54,7 +52,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Kevin Morin (Code Lutin)
* @since 5.0
*/
-public class MoveRoutesUIAction extends AbstractUIAction {
+public class MoveRoutesUIAction extends AbstractContentUIAction {
private static final long serialVersionUID = 1L;
@@ -71,41 +69,32 @@ public class MoveRoutesUIAction extends AbstractUIAction {
}
@Override
- public void actionPerformed(ActionEvent e) {
+ protected void actionPerformed(ContentUI<?, ?> ui) {
- SwingUtilities.invokeLater(() -> {
- JComponent c = (JComponent) e.getSource();
- ContentUI<?, ?> ui = (ContentUI<?, ?>) c.getClientProperty("ui");
- if (ui == null) {
- throw new IllegalStateException("could not find client property ui on component" + c);
- }
-
- if (!(ui instanceof RoutesUI)) {
- throw new IllegalStateException("Can not come here!");
- }
-
- RoutesUI theUi = (RoutesUI) ui;
+ if (!(ui instanceof RoutesUI)) {
+ throw new IllegalStateException("Can not come here!");
+ }
- // get current tripseine id
- ObserveTreeHelper treeHelper = getMainUI().getTreeHelper();
- ObserveNode oldRoutesNode = treeHelper.getSelectedNode();
- ObserveNode oldTripSeineNode = oldRoutesNode.getParent();
+ RoutesUI theUi = (RoutesUI) ui;
- // choose the new tripseine
- String tripSeineId = chooseNewTripSeine(theUi, oldTripSeineNode);
+ // get current tripseine id
+ ObserveTreeHelper treeHelper = getMainUI().getTreeHelper();
+ ObserveNode oldRoutesNode = treeHelper.getSelectedNode();
+ ObserveNode oldTripSeineNode = oldRoutesNode.getParent();
- if (tripSeineId != null) {
- // change the tripseine of the selected routes
- List<DataReference<RouteDto>> selectedDatas = theUi.getModel().getSelectedDatas();
- List<String> routeIds = selectedDatas.stream().map(DataReference.ID_FUNCTION).collect(Collectors.toList());
- RouteService service = ObserveSwingApplicationContext.get().getMainDataSourceServicesProvider().newRouteService();
- List<Integer> positions = service.moveRoutesToTripSeine(routeIds, tripSeineId);
+ // choose the new tripseine
+ String tripSeineId = chooseNewTripSeine(theUi, oldTripSeineNode);
- // update the tree
- updateTree(oldRoutesNode, tripSeineId, routeIds);
- }
+ if (tripSeineId != null) {
+ // change the tripseine of the selected routes
+ List<DataReference<RouteDto>> selectedDatas = theUi.getModel().getSelectedDatas();
+ List<String> routeIds = selectedDatas.stream().map(DataReference.ID_FUNCTION).collect(Collectors.toList());
+ RouteService service = ObserveSwingApplicationContext.get().getMainDataSourceServicesProvider().newRouteService();
+ List<Integer> positions = service.moveRoutesToTripSeine(routeIds, tripSeineId);
- });
+ // update the tree
+ updateTree(oldRoutesNode, tripSeineId, routeIds);
+ }
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripLonglinesUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/MoveTripLonglinesUIAction.java
similarity index 95%
rename from application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripLonglinesUIAction.java
rename to application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/MoveTripLonglinesUIAction.java
index bff6c8d..8aabffd 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripLonglinesUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/MoveTripLonglinesUIAction.java
@@ -1,4 +1,4 @@
-package fr.ird.observe.application.swing.ui.actions.shared;
+package fr.ird.observe.application.swing.ui.actions.content;
/*-
* #%L
@@ -24,6 +24,7 @@ package fr.ird.observe.application.swing.ui.actions.shared;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.content.MoveTripsUIAction;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.content.list.impl.longline.TripLonglinesUI;
import fr.ird.observe.application.swing.ui.content.list.impl.longline.TripLonglinesUIModel;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripSeinesUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/MoveTripSeinesUIAction.java
similarity index 95%
rename from application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripSeinesUIAction.java
rename to application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/MoveTripSeinesUIAction.java
index 4988af1..bca7be6 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripSeinesUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/MoveTripSeinesUIAction.java
@@ -1,4 +1,4 @@
-package fr.ird.observe.application.swing.ui.actions.shared;
+package fr.ird.observe.application.swing.ui.actions.content;
/*-
* #%L
@@ -24,6 +24,7 @@ package fr.ird.observe.application.swing.ui.actions.shared;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.content.MoveTripsUIAction;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.content.list.impl.seine.TripSeinesUI;
import fr.ird.observe.application.swing.ui.content.list.impl.seine.TripSeinesUIModel;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripsUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/MoveTripsUIAction.java
similarity index 83%
rename from application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripsUIAction.java
rename to application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/MoveTripsUIAction.java
index 043fb8d..c4f73bc 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripsUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/MoveTripsUIAction.java
@@ -19,7 +19,7 @@
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
-package fr.ird.observe.application.swing.ui.actions.shared;
+package fr.ird.observe.application.swing.ui.actions.content;
import fr.ird.observe.application.swing.ObserveOpenDataManager;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
@@ -37,8 +37,6 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.swing.JOptionPane;
-import javax.swing.SwingUtilities;
-import java.awt.event.ActionEvent;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@@ -52,7 +50,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Kevin Morin (Code Lutin)
* @since 5.0
*/
-public abstract class MoveTripsUIAction<T extends DataDto> extends AbstractUIAction {
+public abstract class MoveTripsUIAction<T extends DataDto> extends AbstractContentUIAction {
private static final long serialVersionUID = 1L;
@@ -74,33 +72,28 @@ public abstract class MoveTripsUIAction<T extends DataDto> extends AbstractUIAct
}
@Override
- public void actionPerformed(ActionEvent e) {
+ protected void actionPerformed(ContentUI<?, ?> ui) {
- SwingUtilities.invokeLater(() -> {
+ checkUIClass(ui);
- ContentUI<?, ?> ui = getContentUI(e);
- checkUIClass(ui);
-
- // get current program id
- ObserveTreeHelper treeHelper = getMainUI().getTreeHelper();
- ObserveNode oldProgramNode = treeHelper.getSelectedNode();
- String oldProgramId = oldProgramNode.getId();
+ // get current program id
+ ObserveTreeHelper treeHelper = getMainUI().getTreeHelper();
+ ObserveNode oldProgramNode = treeHelper.getSelectedNode();
+ String oldProgramId = oldProgramNode.getId();
- // choose the new program
- String programId = chooseNewProgram(ui, oldProgramId);
+ // choose the new program
+ String programId = chooseNewProgram(ui, oldProgramId);
- if (programId != null) {
+ if (programId != null) {
- // change the program of the selected trips
- List<DataReference<T>> selectedDatas = ((ContentListUIModel) ui.getModel()).getSelectedDatas();
- List<String> tripIds = selectedDatas.stream().map(DataReference.ID_FUNCTION).collect(Collectors.toList());
- List<Integer> positions = getPositions(tripIds, programId);
+ // change the program of the selected trips
+ List<DataReference<T>> selectedDatas = ((ContentListUIModel) ui.getModel()).getSelectedDatas();
+ List<String> tripIds = selectedDatas.stream().map(DataReference.ID_FUNCTION).collect(Collectors.toList());
+ List<Integer> positions = getPositions(tripIds, programId);
- // update the tree
- updateTree(ui, oldProgramNode, oldProgramId, programId, tripIds, positions);
- }
-
- });
+ // update the tree
+ updateTree(ui, oldProgramNode, oldProgramId, programId, tripIds, positions);
+ }
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/NewTableEntryUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/NewTableEntryUIAction.java
similarity index 83%
rename from application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/NewTableEntryUIAction.java
rename to application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/NewTableEntryUIAction.java
index f0e129c..17fe4f7 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/NewTableEntryUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/NewTableEntryUIAction.java
@@ -1,6 +1,7 @@
-package fr.ird.observe.application.swing.ui.actions.shared;
+package fr.ird.observe.application.swing.ui.actions.content;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.content.AbstractContentUIAction;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.content.table.ContentTableUI;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ReOpenUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/ReOpenUIAction.java
similarity index 93%
rename from application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ReOpenUIAction.java
rename to application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/ReOpenUIAction.java
index b122bf9..b96e700 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ReOpenUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/ReOpenUIAction.java
@@ -19,10 +19,11 @@
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
-package fr.ird.observe.application.swing.ui.actions.shared;
+package fr.ird.observe.application.swing.ui.actions.content;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.content.AbstractContentUIAction;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.content.list.ContentListUI;
import fr.ird.observe.application.swing.ui.content.open.ContentOpenableUI;
@@ -56,7 +57,7 @@ public class ReOpenUIAction extends AbstractContentUIAction {
}
@Override
- protected void actionPerformed(ContentUI<?, ?> ui) {
+ public void actionPerformed(ContentUI<?, ?> ui) {
ContentOpenableUI<?, ?> openUI;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ResetEditUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/ResetEditUIAction.java
similarity index 74%
rename from application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ResetEditUIAction.java
rename to application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/ResetEditUIAction.java
index da7a884..b922346 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ResetEditUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/ResetEditUIAction.java
@@ -19,10 +19,12 @@
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
-package fr.ird.observe.application.swing.ui.actions.shared;
+package fr.ird.observe.application.swing.ui.actions.content;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.content.AbstractContentUIAction;
import fr.ird.observe.application.swing.ui.content.ContentUI;
+import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import static org.nuiton.i18n.I18n.n;
@@ -50,8 +52,15 @@ public class ResetEditUIAction extends AbstractContentUIAction {
}
@Override
- protected void actionPerformed(ContentUI<?, ?> contentUI) {
- contentUI.resetEdit();
+ protected void actionPerformed(ContentUI<?, ?> ui) {
+
+ if (ui.getModel().isCreatingMode()) {
+ ui.stopEdit();
+ ObserveNode parentNode = ui.getTreeHelper().removeNode(ui.getTreeHelper().getSelectedNode());
+ ui.getTreeHelper().selectNode(parentNode);
+ } else {
+ ui.resetEdit();
+ }
}
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ResetTableEntryUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/ResetTableEntryUIAction.java
similarity index 87%
rename from application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ResetTableEntryUIAction.java
rename to application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/ResetTableEntryUIAction.java
index a0c8bdd..ce0291b 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ResetTableEntryUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/ResetTableEntryUIAction.java
@@ -1,6 +1,7 @@
-package fr.ird.observe.application.swing.ui.actions.shared;
+package fr.ird.observe.application.swing.ui.actions.content;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.content.AbstractContentUIAction;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.content.table.ContentTableUI;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SaveEditUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/SaveEditUIAction.java
similarity index 91%
rename from application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SaveEditUIAction.java
rename to application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/SaveEditUIAction.java
index 04ad480..597e6ce 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SaveEditUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/SaveEditUIAction.java
@@ -19,14 +19,12 @@
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
-package fr.ird.observe.application.swing.ui.actions.shared;
+package fr.ird.observe.application.swing.ui.actions.content;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.content.AbstractContentUIAction;
import fr.ird.observe.application.swing.ui.content.ContentUI;
-import javax.swing.SwingUtilities;
-import java.awt.event.ActionEvent;
-
import static org.nuiton.i18n.I18n.n;
/**
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SaveTableEntryUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/SaveTableEntryUIAction.java
similarity index 87%
rename from application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SaveTableEntryUIAction.java
rename to application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/SaveTableEntryUIAction.java
index 469e349..018a011 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SaveTableEntryUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/content/SaveTableEntryUIAction.java
@@ -1,6 +1,7 @@
-package fr.ird.observe.application.swing.ui.actions.shared;
+package fr.ird.observe.application.swing.ui.actions.content;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.content.AbstractContentUIAction;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.content.table.ContentTableUI;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/global/AbstractGlobalUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/global/AbstractGlobalUIAction.java
new file mode 100644
index 0000000..a2df2d9
--- /dev/null
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/global/AbstractGlobalUIAction.java
@@ -0,0 +1,18 @@
+package fr.ird.observe.application.swing.ui.actions.global;
+
+import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.shared.AbstractUIAction;
+
+/**
+ * Created on 11/11/16.
+ *
+ * @author Tony Chemit - chemit(a)codelutin.com
+ * @since 5.1
+ */
+public abstract class AbstractGlobalUIAction extends AbstractUIAction {
+
+ protected AbstractGlobalUIAction(ObserveMainUI mainUI, String actionId, String acceleratorKey) {
+ super(mainUI, actionId, "<NONE>", "<NONE>", "reset", acceleratorKey);
+ }
+
+}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/global/ChangeFocusGlobalUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/global/ChangeFocusGlobalUIAction.java
new file mode 100644
index 0000000..a88b96a
--- /dev/null
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/global/ChangeFocusGlobalUIAction.java
@@ -0,0 +1,60 @@
+package fr.ird.observe.application.swing.ui.actions.global;
+
+import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.content.ContentUI;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.swing.JComponent;
+import javax.swing.JTree;
+import javax.swing.SwingUtilities;
+import java.awt.FocusTraversalPolicy;
+import java.awt.event.ActionEvent;
+
+/**
+ * Created on 11/11/16.
+ *
+ * @author Tony Chemit - chemit(a)codelutin.com
+ * @since 5.1
+ */
+public class ChangeFocusGlobalUIAction extends AbstractGlobalUIAction {
+
+ /** Logger */
+ private static final Log log = LogFactory.getLog(ChangeFocusGlobalUIAction.class);
+
+ public static final String ACTION_NAME = "focusOnTreeGlobal";
+
+ public ChangeFocusGlobalUIAction(ObserveMainUI mainUI) {
+ super(mainUI, ACTION_NAME, "pressed F1");
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ JTree navigation = getMainUI().getNavigation();
+
+ JComponent focusComponent;
+ if (navigation.isFocusOwner()) {
+ if (log.isInfoEnabled()) {
+ log.info("Focus to content");
+ }
+ ContentUI<?, ?> contentUI = getContentUI(e);
+ FocusTraversalPolicy focusTraversalPolicy = contentUI.getFocusTraversalPolicy();
+ focusComponent = (JComponent) focusTraversalPolicy.getFirstComponent(contentUI);
+// if (focusComponent instanceof JList) {
+// JList jList = (JList) focusComponent;
+// if (jList.getModel().getSize() > 0) {
+// jList.setSelectedIndex(0);
+// }
+// jList.requestFocusInWindow();
+// }
+
+ } else {
+ if (log.isInfoEnabled()) {
+ log.info("Focus to navigation");
+ }
+ focusComponent = navigation;
+ }
+
+ SwingUtilities.invokeLater(focusComponent::requestFocusInWindow);
+ }
+}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/global/DeleteDataGlobalUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/global/DeleteDataGlobalUIAction.java
new file mode 100644
index 0000000..60a64a6
--- /dev/null
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/global/DeleteDataGlobalUIAction.java
@@ -0,0 +1,45 @@
+package fr.ird.observe.application.swing.ui.actions.global;
+
+import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
+import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.global.AbstractGlobalUIAction;
+import fr.ird.observe.application.swing.ui.content.ContentUI;
+import fr.ird.observe.application.swing.ui.content.table.ContentTableUI;
+
+import javax.swing.JButton;
+import java.awt.event.ActionEvent;
+
+/**
+ * Created on 11/11/16.
+ *
+ * @author Tony Chemit - chemit(a)codelutin.com
+ * @since 5.1
+ */
+public class DeleteDataGlobalUIAction extends AbstractGlobalUIAction {
+
+ public static final String ACTION_NAME = "deleteDataGlobal";
+
+ public DeleteDataGlobalUIAction(ObserveMainUI mainUI) {
+ super(mainUI, ACTION_NAME, "pressed F6");
+ }
+
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+
+ ContentUI<?, ?> contentUI = ObserveSwingApplicationContext.get().getContentUIManager().getSelectedContentUI();
+
+ JButton button;
+ if (contentUI instanceof ContentTableUI) {
+ ContentTableUI ui = (ContentTableUI) contentUI;
+ button = ui.getDeleteEntry();
+ } else {
+ button = (JButton) contentUI.getObjectById("delete");
+ }
+ if (button != null) {
+ button.getAction().actionPerformed(e);
+ }
+
+ }
+
+}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/global/NewNextDataGlobalUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/global/NewNextDataGlobalUIAction.java
new file mode 100644
index 0000000..3b9f2e1
--- /dev/null
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/global/NewNextDataGlobalUIAction.java
@@ -0,0 +1,45 @@
+package fr.ird.observe.application.swing.ui.actions.global;
+
+import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
+import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.global.AbstractGlobalUIAction;
+import fr.ird.observe.application.swing.ui.content.ContentUI;
+import fr.ird.observe.application.swing.ui.content.list.ContentListUI;
+import fr.ird.observe.application.swing.ui.content.open.ContentOpenableUI;
+import fr.ird.observe.application.swing.ui.content.table.ContentTableUI;
+
+import java.awt.event.ActionEvent;
+
+/**
+ * Created on 11/11/16.
+ *
+ * @author Tony Chemit - chemit(a)codelutin.com
+ * @since 5.1
+ */
+public class NewNextDataGlobalUIAction extends AbstractGlobalUIAction {
+
+ public static final String ACTION_NAME = "newNextGlobal";
+
+ public NewNextDataGlobalUIAction(ObserveMainUI mainUI) {
+ super(mainUI, ACTION_NAME, "pressed F4");
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+
+ ContentUI<?, ?> contentUI = ObserveSwingApplicationContext.get().getContentUIManager().getSelectedContentUI();
+
+ if (contentUI instanceof ContentListUI) {
+ ContentListUI ui = (ContentListUI) contentUI;
+ ui.getCreateChild().getAction().actionPerformed(e);
+ } else if (contentUI instanceof ContentOpenableUI) {
+ ContentOpenableUI ui = (ContentOpenableUI) contentUI;
+ ui.getCloseAndCreate().getAction().actionPerformed(e);
+ } else if (contentUI instanceof ContentTableUI) {
+ ContentTableUI ui = (ContentTableUI) contentUI;
+ ui.getNewEntry().getAction().actionPerformed(e);
+ }
+
+ }
+
+}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/global/OpenCloseDataGlobalUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/global/OpenCloseDataGlobalUIAction.java
new file mode 100644
index 0000000..8c59d34
--- /dev/null
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/global/OpenCloseDataGlobalUIAction.java
@@ -0,0 +1,76 @@
+package fr.ird.observe.application.swing.ui.actions.global;
+
+import fr.ird.observe.application.swing.ObserveOpenDataManager;
+import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
+import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.content.CloseOpenUIAction;
+import fr.ird.observe.application.swing.ui.actions.content.ReOpenUIAction;
+import fr.ird.observe.application.swing.ui.content.ContentUI;
+import fr.ird.observe.application.swing.ui.content.list.ContentListUI;
+import fr.ird.observe.application.swing.ui.content.open.ContentOpenableUI;
+
+import java.awt.event.ActionEvent;
+import java.util.Objects;
+
+/**
+ * Created on 11/11/16.
+ *
+ * @author Tony Chemit - chemit(a)codelutin.com
+ * @since 5.1
+ */
+public class OpenCloseDataGlobalUIAction extends AbstractGlobalUIAction {
+
+ public static final String ACTION_NAME = "openCloseDataGlobal";
+
+ private final ReOpenUIAction openAction;
+ private final CloseOpenUIAction closeAction;
+
+ public OpenCloseDataGlobalUIAction(ObserveMainUI mainUI) {
+ super(mainUI, ACTION_NAME, "pressed F3");
+ openAction = new ReOpenUIAction(mainUI);
+ closeAction = new CloseOpenUIAction(mainUI);
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ ContentUI<?, ?> contentUI = ObserveSwingApplicationContext.get().getContentUIManager().getSelectedContentUI();
+
+ if (contentUI instanceof ContentListUI) {
+ ContentListUI ui = (ContentListUI) contentUI;
+
+ if (ui.getReopenChild().isEnabled()) {
+
+ // on réouvre
+ openAction.actionPerformed(ui);
+ } else if (ui.getCloseChild().isEnabled()) {
+
+ // on ferme
+ closeAction.actionPerformed(ui);
+
+ }
+
+ return;
+ }
+
+ if (contentUI.getModel().isCreatingMode() || !(contentUI instanceof ContentOpenableUI)) {
+ return;
+ }
+
+ // le seul cas où on peut intervenir (sur un ecran open et pas en mode création)
+
+ String currentId = contentUI.getModel().getBean().getId();
+ Objects.requireNonNull(currentId);
+
+ ObserveOpenDataManager openDataManager = ObserveSwingApplicationContext.get().getOpenDataManager();
+
+ boolean isOpened = openDataManager.isOpen(currentId);
+
+ if (isOpened) {
+ closeAction.actionPerformed(contentUI);
+ } else {
+ openAction.actionPerformed(contentUI);
+ }
+
+ }
+
+}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/global/ResetDataGlobalUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/global/ResetDataGlobalUIAction.java
new file mode 100644
index 0000000..75492b6
--- /dev/null
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/global/ResetDataGlobalUIAction.java
@@ -0,0 +1,38 @@
+package fr.ird.observe.application.swing.ui.actions.global;
+
+import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
+import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.global.AbstractGlobalUIAction;
+import fr.ird.observe.application.swing.ui.content.ContentUI;
+
+import javax.swing.JButton;
+import java.awt.event.ActionEvent;
+
+/**
+ * Created on 11/11/16.
+ *
+ * @author Tony Chemit - chemit(a)codelutin.com
+ * @since 5.1
+ */
+public class ResetDataGlobalUIAction extends AbstractGlobalUIAction {
+
+ public static final String ACTION_NAME = "resetDataGlobal";
+
+ public ResetDataGlobalUIAction(ObserveMainUI mainUI) {
+ super(mainUI, ACTION_NAME, "pressed F7");
+ }
+
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+
+ ContentUI<?, ?> contentUI = ObserveSwingApplicationContext.get().getContentUIManager().getSelectedContentUI();
+
+ JButton button = (JButton) contentUI.getObjectById("reset");
+ if (button != null) {
+ button.getAction().actionPerformed(e);
+ }
+
+ }
+
+}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/global/SaveDataGlobalUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/global/SaveDataGlobalUIAction.java
new file mode 100644
index 0000000..64869a4
--- /dev/null
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/global/SaveDataGlobalUIAction.java
@@ -0,0 +1,38 @@
+package fr.ird.observe.application.swing.ui.actions.global;
+
+import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
+import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.global.AbstractGlobalUIAction;
+import fr.ird.observe.application.swing.ui.content.ContentUI;
+
+import javax.swing.JButton;
+import java.awt.event.ActionEvent;
+
+/**
+ * Created on 11/11/16.
+ *
+ * @author Tony Chemit - chemit(a)codelutin.com
+ * @since 5.1
+ */
+public class SaveDataGlobalUIAction extends AbstractGlobalUIAction {
+
+ public static final String ACTION_NAME = "saveDataGlobal";
+
+ public SaveDataGlobalUIAction(ObserveMainUI mainUI) {
+ super(mainUI, ACTION_NAME, "pressed F5");
+ }
+
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+
+ ContentUI<?, ?> contentUI = ObserveSwingApplicationContext.get().getContentUIManager().getSelectedContentUI();
+
+ JButton button = (JButton) contentUI.getObjectById("save");
+ if (button != null) {
+ button.getAction().actionPerformed(e);
+ }
+
+ }
+
+}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/AbstractUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/AbstractUIAction.java
index 99fa5f1..251cac4 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/AbstractUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/AbstractUIAction.java
@@ -21,6 +21,7 @@
*/
package fr.ird.observe.application.swing.ui.actions.shared;
+import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
import fr.ird.observe.application.swing.db.DataContext;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
import fr.ird.observe.application.swing.ui.content.ContentUI;
@@ -139,13 +140,13 @@ public abstract class AbstractUIAction extends AbstractAction {
protected boolean canExecuteAction(ActionEvent e) {
JComponent editor = getEditor();
- if (!(editor.isVisible() && editor.isEnabled())) {
- if (log.isInfoEnabled()) {
- log.info("Disabled action: " + getActionCommandKey() + " :: " + this);
- }
- return false;
+ if ((editor == null || (editor.isVisible() && editor.isEnabled()))) {
+ return true;
+ }
+ if (log.isInfoEnabled()) {
+ log.info("Disabled action: " + getActionCommandKey() + " :: " + this);
}
- return true;
+ return false;
}
private JComponent getEditor() {
@@ -154,7 +155,7 @@ public abstract class AbstractUIAction extends AbstractAction {
public static boolean isOpenActivityNodeCollapsed(JTree tree, ObserveTreeHelper treeHelper, DataContext dataContext) {
- // on regarde si le noeud de l'activity ouverte est collapsé
+ // on regarde si le noeud de l'activité ouverte est collapsé
ObserveNode node = treeHelper.getSelectedNode();
@@ -173,6 +174,8 @@ public abstract class AbstractUIAction extends AbstractAction {
JComponent c = (JComponent) e.getSource();
ContentUI<?, ?> ui;
+ //FIXME On devrait peut-être toujours se baser sur le contentui manager
+ //FIXME et ne plus rien attacher aux editeurs ?
if (c instanceof ContentUI) {
ui = (ContentUI<?, ?>) c;
} else if (c.getParent() instanceof ContentUI) {
@@ -180,7 +183,9 @@ public abstract class AbstractUIAction extends AbstractAction {
} else {
ui = (ContentUI<?, ?>) c.getClientProperty("ui");
}
- Objects.requireNonNull(ui, "could not find client property ui on component" + c);
+ if (ui == null) {
+ ui = ObserveSwingApplicationContext.get().getContentUIManager().getSelectedContentUI();
+ }
return ui;
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/Common.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/Common.jcss
index f3e4867..643d755 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/Common.jcss
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/Common.jcss
@@ -20,6 +20,10 @@
* #L%
*/
+JButton {
+ _protectFocus:true;
+}
+
TimeEditor {
bean:{bean};
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUI.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUI.jcss
index 9edb264..2d23bbe 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUI.jcss
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUI.jcss
@@ -36,6 +36,7 @@
#actionDown {
_observeAction:{GoDownUIAction.ACTION_NAME};
+ _protectFocus:true;
}
#actionUpPane {
@@ -44,6 +45,7 @@
#actionUp {
_observeAction:{GoUpUIAction.ACTION_NAME};
+ _protectFocus:true;
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIBlockingLayerUI.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIBlockingLayerUI.java
index e60fbfe..5101388 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIBlockingLayerUI.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIBlockingLayerUI.java
@@ -15,7 +15,6 @@ import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
-import java.util.Objects;
import java.util.Set;
/**
@@ -49,7 +48,7 @@ public class ContentUIBlockingLayerUI extends BlockingLayerUI {
@Override
protected void processKeyEvent(KeyEvent e, JXLayer<? extends JComponent> l) {
- InputMap inputMap = ui.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+ InputMap inputMap = ui.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
ActionMap actionMap = ui.getActionMap();
boolean consumed = false;
@@ -65,10 +64,10 @@ public class ContentUIBlockingLayerUI extends BlockingLayerUI {
consumed = doAction(keyStroke, inputMap, actionMap);
}
- if (!consumed && !e.isControlDown() && !e.isShiftDown() && !e.isAltDown() && !e.isAltGraphDown()
+ if (!consumed && e.getID() == KeyEvent.KEY_PRESSED && !e.isControlDown() && !e.isShiftDown() && !e.isAltDown() && !e.isAltGraphDown()
&& !e.isMetaDown() && GLOBAL_KEY_CODES.contains(e.getKeyCode())) {
- KeyStroke keyStroke = KeyStroke.getKeyStroke("pressed " + (char) e.getKeyCode());
+ KeyStroke keyStroke = KeyStroke.getKeyStroke(e.getKeyCode(), 0);
if (keyStroke == null) {
super.processKeyEvent(e, l);
@@ -94,8 +93,7 @@ public class ContentUIBlockingLayerUI extends BlockingLayerUI {
Action action = actionMap.get(actionName);
JComponent editor = (JComponent) action.getValue(AbstractUIAction.EDITOR);
- Objects.requireNonNull(editor, "No editor on action: " + action);
- if (editor.isVisible() && editor.isEnabled()) {
+ if (editor == null || (editor.isVisible() && editor.isEnabled())) {
if (log.isInfoEnabled()) {
log.info("Found action: " + action.getValue(Action.NAME) + " for keyStroke: " + keyStroke);
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIHandler.java
index f19ecba..d5d0443 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIHandler.java
@@ -244,17 +244,17 @@ public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U
return wasClosed;
}
- public static <E extends IdDto, U extends ContentUI<E,U>> void addMessage(U ui, NuitonValidatorScope scope, String fieldName, String message) {
+ public static <E extends IdDto, U extends ContentUI<E, U>> void addMessage(U ui, NuitonValidatorScope scope, String fieldName, String message) {
SwingValidatorMessageTableModel model = ui.getErrorTableModel();
model.addMessages(ui, fieldName, scope, message);
}
- public static <E extends IdDto, U extends ContentUI<E,U>>void removeAllMessages(U ui, NuitonValidatorScope scope, String fieldName) {
+ public static <E extends IdDto, U extends ContentUI<E, U>> void removeAllMessages(U ui, NuitonValidatorScope scope, String fieldName) {
SwingValidatorMessageTableModel model = ui.getErrorTableModel();
model.removeMessages(ui, fieldName, scope);
}
- protected static <E extends IdDto, U extends ContentUI<E,U>> void removeAllMessages(U ui) {
+ protected static <E extends IdDto, U extends ContentUI<E, U>> void removeAllMessages(U ui) {
SwingValidatorMessageTableModel model = ui.getErrorTableModel();
model.removeMessages(ui, null);
}
@@ -303,7 +303,59 @@ public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U
getModel().addPropertyChangeListener(ContentUIModel.PROPERTY_FORM, evt -> updateUiWithReferenceSetsFromModel());
- ObserveSwingApplicationContext.get().getFocusManager().setFocusTraversalPolicy(ui);
+ ObserveSwingApplicationContext.get().getFocusManager().installFocusTraversalPolicy(ui);
+
+// addFocusabelOnForm();
+
+ }
+
+ protected void addFocusabelOnForm() {
+ getModel().addPropertyChangeListener(ContentUIModel.PROPERTY_MODE, evt -> updateFocusable((ContentMode) evt.getNewValue()));
+ updateFocusable(ContentMode.READ);
+ }
+
+ public void updateFocusable(ContentMode newMode) {
+ if (newMode == null) {
+ return;
+ }
+ switch (newMode) {
+ case CREATE:
+ case UPDATE:
+ ui.get$objectMap().values().stream().filter(o -> o instanceof JComponent).forEach(o -> {
+ JComponent component = (JComponent) o;
+ if (BooleanUtils.isTrue((Boolean) component.getClientProperty("protectFocus"))) {
+ return;
+ }
+ if (component instanceof BeanComboBox) {
+ BeanComboBox beanComboBox = (BeanComboBox) component;
+ component = beanComboBox.getCombobox();
+ }
+ Boolean focusable = (Boolean) component.getClientProperty("_focusable");
+ component.setFocusable(BooleanUtils.isTrue(focusable));
+
+ });
+ break;
+ case READ:
+
+ // remove all focusables
+ ui.get$objectMap().values().stream().filter(o -> o instanceof JComponent).forEach(o -> {
+ JComponent component = (JComponent) o;
+ if (BooleanUtils.isTrue((Boolean) component.getClientProperty("protectFocus"))) {
+ return;
+ }
+ if (component instanceof BeanComboBox) {
+ BeanComboBox beanComboBox = (BeanComboBox) component;
+ component = beanComboBox.getCombobox();
+ }
+ boolean focusable = component.isFocusable();
+ if (focusable) {
+ component.putClientProperty("_focusable", true);
+ component.setFocusable(false);
+ }
+
+ });
+ break;
+ }
}
public void openUI() {
@@ -324,8 +376,7 @@ public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U
// suppression des messages de validation
removeAllMessages(ui);
ObserveTreeHelper treeHelper = getTreeHelper(ui);
- AbstractObserveTreeCellRenderer render =
- treeHelper.getTreeCellRenderer();
+ AbstractObserveTreeCellRenderer render = treeHelper.getTreeCellRenderer();
ObserveNode node = treeHelper.getSelectedNode();
if (ContentReferenceUIHandler.class.isAssignableFrom(getClass())) {
node = node.getParent();
@@ -333,6 +384,12 @@ public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U
ui.setContentIcon(render.getNavigationIcon(node));
updateActions();
+
+ JComponent firstComponent = (JComponent) ui.getFocusTraversalPolicy().getFirstComponent(ui);
+ if (log.isInfoEnabled()) {
+ log.info("Grab focus on first component: " + firstComponent);
+ }
+ firstComponent.grabFocus();
}
public Icon getErrorIconIfFalse(boolean valid) {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java
index bf5e7c1..6d15481 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java
@@ -207,6 +207,9 @@ public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>>
Set<String> doNotBlockComponentIds = new HashSet<>();
+ ui.getActionMap().setParent(actionMap);
+ ui.setInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW ,ObserveSwingApplicationContext.get().getMainUI().getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW));
+
for (String name : ui.get$objectMap().keySet()) {
Object o = ui.getObjectById(name);
@@ -493,6 +496,10 @@ public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>>
}
editor.setFormat(ObserveSwingApplicationContext.get().getConfig().getCoordinateFormat());
editor.init();
+ editor.getDmdFormat().setFocusable(false);
+ editor.getDmsFormat().setFocusable(false);
+ editor.getDdFormat().setFocusable(false);
+
}
protected void init(JTextField editor) {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIManager.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIManager.java
index 1e70471..0182303 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIManager.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIManager.java
@@ -99,7 +99,11 @@ import org.apache.commons.logging.LogFactory;
import javax.swing.JComponent;
import javax.swing.JPanel;
+import javax.swing.JTree;
+import javax.swing.SwingUtilities;
import java.awt.Component;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
import java.lang.reflect.Constructor;
import java.util.Map;
import java.util.TreeMap;
@@ -121,7 +125,7 @@ public class ContentUIManager {
/** Logger */
static private final Log log = LogFactory.getLog(ContentUIManager.class);
- private final Map<String, Class<? extends ObserveContentUI<?, ?>>> mapping;
+ private final Map<String, Class<? extends ContentUI<?, ?>>> mapping;
public ContentUIManager() {
@@ -191,7 +195,7 @@ public class ContentUIManager {
}
- public Class<? extends ObserveContentUI<?, ?>> convertNodeToContentUI(ObserveNode node) {
+ public Class<? extends ContentUI<?, ?>> convertNodeToContentUI(ObserveNode node) {
if (log.isDebugEnabled()) {
log.debug("Entrer for node = " + node);
}
@@ -230,7 +234,7 @@ public class ContentUIManager {
return mapping.get(mappingKey);
}
- public <U extends ObserveContentUI<?, ?>> U getContent(Class<U> uiClass) {
+ public <U extends ContentUI<?, ?>> U getContent(Class<U> uiClass) {
CardLayout2 layout = getLayout();
JPanel layoutContent = getLayoutContent();
@@ -250,7 +254,7 @@ public class ContentUIManager {
return content;
}
- public <U extends ObserveContentUI<?, ?>> U createContent(Class<U> uiClass) {
+ public <U extends ContentUI<?, ?>> U createContent(Class<U> uiClass) {
String constraints = uiClass.getName();
@@ -271,14 +275,33 @@ public class ContentUIManager {
try {
// ajout du content dans son parent
- getLayoutContent().add((JComponent) result, constraints);
-
+ getLayoutContent().add(result, constraints);
if (log.isDebugEnabled()) {
log.debug("Add new content [" + constraints + "] : " + result.getClass().getName());
}
// initialisation du content
result.init();
+ result.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseEntered(MouseEvent e) {
+ if (log.isInfoEnabled()) {
+ log.info("grab enter focus: " + e);
+ }
+ ((JComponent) e.getSource()).grabFocus();
+ }
+
+ @Override
+ public void mouseMoved(MouseEvent e) {
+ if (!((JComponent) e.getSource()).isFocusOwner()) {
+ if (log.isInfoEnabled()) {
+ log.info("grab moved focus: " + e);
+ }
+ ((JComponent) e.getSource()).grabFocus();
+ }
+ }
+ });
+
return result;
} catch (Exception e) {
@@ -286,12 +309,7 @@ public class ContentUIManager {
}
}
- public ObserveContentUI<?, ?> getCurrentContent() {
- return (ObserveContentUI<?, ?>)
- getLayout().getVisibleComponent(getLayoutContent());
- }
-
- public void openContent(ObserveContentUI<?, ?> content) {
+ public void openContent(ContentUI<?, ?> content) {
String constraints = content.getClass().getName();
@@ -299,12 +317,15 @@ public class ContentUIManager {
log.debug("Will open ui [" + constraints + "] : " + content.getClass());
}
+ JTree navigation = getMainUI().getNavigation();
+ boolean focusOnNavigation = navigation.isFocusOwner();
+
// on ouvre l'ui
try {
content.open();
ObserveSwingSessionHelper swingSessionHelper = ObserveSwingApplicationContext.get().getSwingSessionHelper();
- swingSessionHelper.addComponent((Component) content, true);
+ swingSessionHelper.addComponent(content, true);
swingSessionHelper.save();
} catch (Exception e) {
@@ -314,6 +335,11 @@ public class ContentUIManager {
// on affiche l'ui quoi qu'il arrive ?
getLayout().show(getLayoutContent(), constraints);
}
+
+ if (focusOnNavigation) {
+ SwingUtilities.invokeLater(navigation::grabFocus);
+ }
+
}
public void close() {
@@ -409,7 +435,7 @@ public class ContentUIManager {
if (log.isDebugEnabled()) {
log.debug("Add key: " + key + " → " + contentClass.getName());
}
- mapping.put(key, (Class<? extends ContentUI<?, ?>>) contentClass);
+ mapping.put(key, (Class) contentClass);
}
private String getMappingKey(String prefix, Class<?> klass, String context) {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ObserveActionMap.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ObserveActionMap.java
index c59c0e2..71556dd 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ObserveActionMap.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ObserveActionMap.java
@@ -3,6 +3,7 @@ package fr.ird.observe.application.swing.ui.content;
import com.google.common.collect.ImmutableMap;
import fr.ird.observe.application.swing.ObserveSwingTechnicalException;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.global.AbstractGlobalUIAction;
import fr.ird.observe.application.swing.ui.actions.shared.AbstractUIAction;
import org.apache.commons.beanutils.ConstructorUtils;
import org.apache.commons.logging.Log;
@@ -11,6 +12,8 @@ import org.reflections.Reflections;
import javax.swing.Action;
import javax.swing.ActionMap;
+import javax.swing.InputMap;
+import javax.swing.JComponent;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;
import java.util.Set;
@@ -27,40 +30,82 @@ public class ObserveActionMap extends ActionMap {
private static final Log log = LogFactory.getLog(ObserveActionMap.class);
private final ObserveMainUI ui;
-
private final ImmutableMap<String, Class<? extends AbstractUIAction>> mapping;
+ private final ImmutableMap<String, ? extends AbstractGlobalUIAction> globalActions;
public ObserveActionMap(ObserveMainUI ui) {
this.ui = ui;
- Set<Class<? extends AbstractUIAction>> actionTypes = new Reflections("fr.ird.observe.application.swing.ui.actions.shared").getSubTypesOf(AbstractUIAction.class);
+ Set<Class<? extends AbstractUIAction>> actionTypes = new Reflections("fr.ird.observe.application.swing.ui.actions").getSubTypesOf(AbstractUIAction.class);
+
+ InputMap inputMap = ui.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
ImmutableMap.Builder<String, Class<? extends AbstractUIAction>> mappingBuilder = ImmutableMap.builder();
+ ImmutableMap.Builder<String, AbstractGlobalUIAction> globalActionsBuilder = ImmutableMap.builder();
for (Class<? extends AbstractUIAction> actionType : actionTypes) {
if (Modifier.isAbstract(actionType.getModifiers())) {
continue;
}
+ String actionId;
try {
- String actionId = (String) actionType.getDeclaredField("ACTION_NAME").get(null);
- mappingBuilder.put(actionId, actionType);
+ actionId = (String) actionType.getDeclaredField("ACTION_NAME").get(null);
} catch (IllegalAccessException | NoSuchFieldException e) {
throw new ObserveSwingTechnicalException("Can't find ACTION_NAME field on action: " + actionType.getName());
}
+ if (AbstractGlobalUIAction.class.isAssignableFrom(actionType)) {
+
+ // action globale
+ Class<? extends AbstractGlobalUIAction> globalActionType = (Class) actionType;
+ if (log.isInfoEnabled()) {
+ log.info("Register global action: " + actionId + " - type: " + globalActionType.getName());
+ }
+ AbstractGlobalUIAction globalUIAction = newAction(actionId, globalActionType);
+ globalActionsBuilder.put(actionId, globalUIAction);
+ inputMap.put(globalUIAction.getAcceleratorKey(), actionId);
+
+ } else {
+
+ // action simple
+ if (log.isInfoEnabled()) {
+ log.info("Register action: " + actionId + " - type: " + actionType.getName());
+ }
+ mappingBuilder.put(actionId, actionType);
+
+ }
+
}
mapping = mappingBuilder.build();
+ globalActions = globalActionsBuilder.build();
+
}
@Override
public Action get(Object key) {
+
+ AbstractGlobalUIAction globalUIAction = globalActions.get(key);
+ if (globalUIAction != null) {
+ return globalUIAction;
+ }
+
Class<? extends AbstractUIAction> actionType = mapping.get(key);
if (actionType == null) {
return super.get(key);
}
+ return newAction((String) key, actionType);
+
+ }
+
+ public ImmutableMap<String, ? extends AbstractGlobalUIAction> getGlobalActions() {
+ return globalActions;
+ }
+
+ private <A extends AbstractUIAction> A newAction(String key, Class<A> actionType) {
+
try {
if (log.isInfoEnabled()) {
log.info("Create action: " + key + ", type: " + actionType.getName());
@@ -71,4 +116,5 @@ public class ObserveActionMap extends ActionMap {
}
}
+
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ObserveFocusManager.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ObserveFocusManager.java
index c649f10..c5c28fe 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ObserveFocusManager.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ObserveFocusManager.java
@@ -7,6 +7,12 @@ import fr.ird.observe.application.swing.ui.content.impl.seine.FloatingObjectTran
import fr.ird.observe.application.swing.ui.content.impl.seine.FloatingObjectUI;
import fr.ird.observe.application.swing.ui.content.impl.seine.SetSeineUI;
import fr.ird.observe.application.swing.ui.content.list.ContentListUI;
+import fr.ird.observe.application.swing.ui.content.list.impl.longline.ActivityLonglinesUI;
+import fr.ird.observe.application.swing.ui.content.list.impl.longline.TripLonglinesUI;
+import fr.ird.observe.application.swing.ui.content.list.impl.seine.ActivitySeinesUI;
+import fr.ird.observe.application.swing.ui.content.list.impl.seine.RoutesUI;
+import fr.ird.observe.application.swing.ui.content.list.impl.seine.TripSeinesUI;
+import fr.ird.observe.application.swing.ui.content.open.ContentOpenableUI;
import fr.ird.observe.application.swing.ui.content.open.impl.longline.ActivityLonglineUI;
import fr.ird.observe.application.swing.ui.content.open.impl.longline.TripLonglineUI;
import fr.ird.observe.application.swing.ui.content.open.impl.seine.ActivitySeineUI;
@@ -37,6 +43,10 @@ import fr.ird.observe.application.swing.ui.content.table.impl.seine.SchoolEstima
import fr.ird.observe.application.swing.ui.content.table.impl.seine.TargetCatchUI;
import fr.ird.observe.application.swing.ui.content.table.impl.seine.TargetDiscardCatchUI;
import fr.ird.observe.application.swing.ui.content.table.impl.seine.TargetSampleUI;
+import jaxx.runtime.swing.editor.NumberEditor;
+import jaxx.runtime.swing.editor.bean.BeanComboBox;
+import org.jdesktop.swingx.JXDatePicker;
+import org.nuiton.jaxx.widgets.select.FilterableDoubleList;
import javax.swing.JButton;
import javax.swing.JComponent;
@@ -61,12 +71,9 @@ public class ObserveFocusManager {
private final ImmutableMap<Class<? extends ContentUI>, ObserveLayoutFocusTraversalPolicy> policies;
- public <U extends ContentUI> void setFocusTraversalPolicy(U ui) {
+ public <U extends ContentUI> void installFocusTraversalPolicy(U ui) {
Objects.requireNonNull(ui);
Class<? extends ContentUI> uiClass = ui.getClass();
- if (ui instanceof ContentListUI) {
- uiClass = ContentListUI.class;
- }
ObserveLayoutFocusTraversalPolicy policy = policies.get(uiClass);
if (policy == null && ui instanceof ContentReferenceUI) {
uiClass = ContentReferenceUI.class;
@@ -86,22 +93,7 @@ public class ObserveFocusManager {
builder.put(LonglineDetailCompositionUI.class, new ObserveLayoutFocusTraversalPolicy<LonglineDetailCompositionUI>() {
@Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- LonglineDetailCompositionUI ui = getUi();
- int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
- if (selectedIndex == 2) {
- if (aComponent.equals(ui.getBranchlineDetailUI().getTopType().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- if (aComponent.equals(ui.getBranchlineDetailUI().getHookType().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
LonglineDetailCompositionUI ui = getUi();
int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
if (selectedIndex == 2) {
@@ -117,8 +109,7 @@ public class ObserveFocusManager {
}
@Override
- public Component getLastComponent(Container aContainer) {
-
+ protected Component getLastComponentForEdit(Container aContainer) {
LonglineDetailCompositionUI ui = getUi();
if (ui.getSave().isEnabled()) {
return ui.getSave();
@@ -132,12 +123,13 @@ public class ObserveFocusManager {
}
return super.getLastComponent(aContainer);
}
+
});
builder.put(SetLonglineUI.class, new ObserveLayoutFocusTraversalPolicy<SetLonglineUI>() {
@Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
SetLonglineUI ui = getUi();
int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
switch (selectedIndex) {
@@ -152,42 +144,20 @@ public class ObserveFocusManager {
}
@Override
- public Component getLastComponent(Container aContainer) {
+ protected Component getLastComponentForEdit(Container aContainer) {
return getUi().getDelete();
}
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- SetLonglineUI ui = getUi();
- if (aComponent.equals(ui.getHomeId())) {
- return getLastComponent(aContainer);
- }
- if (aComponent.equals(ui.getHaulingDirectionSameAsSetting())) {
- return getLastComponent(aContainer);
- }
- if (aComponent.equals(ui.getSettingShape().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
});
builder.put(FloatingObjectTransmittingBuoyOperationUI.class, new ObserveLayoutFocusTraversalPolicy<FloatingObjectTransmittingBuoyOperationUI>() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
-
- if (aComponent.equals(getUi().getTypeOperation())) {
- return getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
@Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
return getUi().getTypeOperation();
}
@Override
- public Component getLastComponent(Container aContainer) {
+ protected Component getLastComponentForEdit(Container aContainer) {
FloatingObjectTransmittingBuoyOperationUI ui = getUi();
if (ui.getSave().isEnabled()) {
return ui.getSave();
@@ -201,25 +171,9 @@ public class ObserveFocusManager {
});
builder.put(SetSeineUI.class, new ObserveLayoutFocusTraversalPolicy<SetSeineUI>() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- SetSeineUI ui = getUi();
- int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- if (aComponent.getParent().equals(ui.getStartTime().getHourEditor().getEditor())) {
- return getLastComponent(aContainer);
- }
- case 1:
- if (aComponent.equals(ui.getSchoolThickness().getTextField())) {
- return getLastComponent(aContainer);
- }
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
@Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
SetSeineUI ui = getUi();
int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
switch (selectedIndex) {
@@ -233,7 +187,7 @@ public class ObserveFocusManager {
}
@Override
- public Component getLastComponent(Container aContainer) {
+ protected Component getLastComponentForEdit(Container aContainer) {
SetSeineUI ui = getUi();
if (ui.getDelete().isVisible() && ui.getDelete().isEnabled()) {
return ui.getDelete();
@@ -243,25 +197,18 @@ public class ObserveFocusManager {
}
return ui.getReset();
}
+
});
builder.put(FloatingObjectUI.class, new ObserveLayoutFocusTraversalPolicy<FloatingObjectUI>() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- FloatingObjectUI ui = getUi();
- if (aComponent.equals(ui.getObjectOperation().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
@Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
return getUi().getObjectOperation();
}
@Override
- public Component getLastComponent(Container aContainer) {
+ protected Component getLastComponentForEdit(Container aContainer) {
FloatingObjectUI ui = getUi();
if (ui.getDelete().isVisible() && ui.getDelete().isEnabled()) {
return ui.getDelete();
@@ -271,145 +218,75 @@ public class ObserveFocusManager {
}
return ui.getReset();
}
- });
-
- builder.put(ContentListUI.class, new ObserveLayoutFocusTraversalPolicy<ContentListUI>() {
-
- private List<JComponent> actions;
-
- @Override
- public Component getFirstComponent(Container aContainer) {
- return getUi().getList();
- }
-
- public List<JComponent> getActions() {
- if (actions == null) {
-
- actions = new ArrayList<>();
- actions.add(getUi().getGotoSelectedChild());
- actions.add(getUi().getReopenChild());
- actions.add(getUi().getCloseChild());
- actions.add(getUi().getGotoOpenChild());
- actions.add(getUi().getGotoOpenChild2());
- actions.add(getUi().getCreateChild());
- for (Component component : getUi().getExtraActions().getComponents()) {
- if (component instanceof JButton) {
- actions.add((JComponent) component);
- }
- }
- actions.add(getUi().getMoveSelectedChildren());
-
- }
- List<JComponent> result = new ArrayList<>(actions);
- Collections.reverse(result);
- return result;
- }
-
- @Override
- public Component getLastComponent(Container aContainer) {
- Optional<JComponent> optional = getActions().stream().filter(a -> a.isEnabled() && a.isVisible()).findFirst();
- return optional.isPresent() ? optional.get() : super.getLastComponent(aContainer);
- }
-
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- if (aComponent.equals(getUi().getList())) {
- return getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
});
+ builder.put(TripSeinesUI.class, new ContentListUIObserveLayoutFocusTraversalPolicy());
+ builder.put(RoutesUI.class, new ContentListUIObserveLayoutFocusTraversalPolicy());
+ builder.put(ActivitySeinesUI.class, new ContentListUIObserveLayoutFocusTraversalPolicy());
+ builder.put(TripLonglinesUI.class, new ContentListUIObserveLayoutFocusTraversalPolicy());
+ builder.put(ActivityLonglinesUI.class, new ContentListUIObserveLayoutFocusTraversalPolicy());
+
builder.put(TripLonglineUI.class, new ObserveLayoutFocusTraversalPolicy<TripLonglineUI>() {
@Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
TripLonglineUI ui = getUi();
- if (aComponent.equals(ui.getTripType().getCombobox().getEditor().getEditorComponent())) {
- if (ui.getCloseAndCreate().isEnabled()) {
- return ui.getCloseAndCreate();
+ if (ui.getModel().isReadingMode()) {
+ if (ui.getReopen().isVisible()) {
+ return ui.getReopen();
}
- return ui.getDelete();
+ if (ui.getActionUp().isEnabled()) {
+ return ui.getActionUp();
+ }
+ return ui.getActionDown();
}
- return super.getComponentBefore(aContainer, aComponent);
+ return ui.getTripType();
}
@Override
- public Component getComponentAfter(Container aContainer, Component aComponent) {
+ protected Component getLastComponentForEdit(Container aContainer) {
TripLonglineUI ui = getUi();
- if (!ui.getCloseAndCreate().isEnabled() && aComponent.equals(ui.getDelete())) {
-
- // retour au début
- return ui.getTripType();
+ if (ui.getCloseAndCreate().isVisible() && ui.getCloseAndCreate().isEnabled()) {
+ return ui.getCloseAndCreate();
}
- if (aComponent.equals(ui.getCloseAndCreate())) {
-
- // retour au début
- return ui.getTripType();
+ if (ui.getDelete().isVisible() && ui.getDelete().isEnabled()) {
+ return ui.getDelete();
}
- return super.getComponentAfter(aContainer, aComponent);
+ if (ui.getModel().isReadingMode()) {
+ if (ui.getReopen().isVisible()) {
+ return ui.getReopen();
+ }
+ if (ui.getActionDown().isEnabled()) {
+ return ui.getActionDown();
+ }
+ return ui.getActionUp();
+ }
+ return ui.getActionUp();
}
+
});
builder.put(ActivityLonglineUI.class, new ObserveLayoutFocusTraversalPolicy<ActivityLonglineUI>() {
@Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- ActivityLonglineUI ui = getUi();
- if (aComponent.equals(ui.getTimeStamp().getDayDateEditor().getEditor())) {
- if (ui.getCloseAndCreate().isEnabled()) {
- return ui.getCloseAndCreate();
- }
- return ui.getDelete();
- }
- return super.getComponentBefore(aContainer, aComponent);
+ protected Component getFirstComponentForEdit(Container aContainer) {
+ return getUi().getTimeStamp().getDayDateEditor();
}
@Override
- public Component getComponentAfter(Container aContainer, Component aComponent) {
+ protected Component getLastComponentForEdit(Container aContainer) {
ActivityLonglineUI ui = getUi();
- if (!ui.getCloseAndCreate().isEnabled() && aComponent.equals(ui.getDelete())) {
-
- // retour au début
- return ui.getTimeStamp().getDayDateEditor().getEditor();
- }
- if (aComponent.equals(ui.getCloseAndCreate())) {
-
- // retour au début
- return ui.getTimeStamp().getDayDateEditor().getEditor();
+ if (ui.getCloseAndCreate().isEnabled()) {
+ return ui.getCloseAndCreate();
}
- return super.getComponentAfter(aContainer, aComponent);
+ return ui.getDelete();
}
+
});
builder.put(ActivitySeineUI.class, new ObserveLayoutFocusTraversalPolicy<ActivitySeineUI>() {
@Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- ActivitySeineUI ui = getUi();
- int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- if (aComponent.getParent().equals(ui.getTime().getHourEditor().getEditor())) {
- if (ui.getCloseAndCreate().isEnabled()) {
- return ui.getCloseAndCreate();
- }
- return ui.getDelete();
- }
- break;
- case 1:
- if (aComponent.equals(ui.getVesselSpeed().getTextField())) {
- return getLastComponent(aContainer);
- }
- case 2:
- if (aComponent.equals(ui.getObservedSystem().getUniverseList())) {
- return getLastComponent(aContainer);
- }
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
ActivitySeineUI ui = getUi();
int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
switch (selectedIndex) {
@@ -425,7 +302,7 @@ public class ObserveFocusManager {
}
@Override
- public Component getLastComponent(Container aContainer) {
+ protected Component getLastComponentForEdit(Container aContainer) {
ActivitySeineUI ui = getUi();
if (ui.getModel().isCreatingMode()) {
if (ui.getSave().isEnabled()) {
@@ -435,99 +312,47 @@ public class ObserveFocusManager {
} else
return ui.getCloseAndCreate();
}
+
});
builder.put(TripSeineUI.class, new ObserveLayoutFocusTraversalPolicy<TripSeineUI>() {
@Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- TripSeineUI ui = getUi();
- if (aComponent.equals(ui.getCaptain().getCombobox().getEditor().getEditorComponent())) {
- if (ui.getCloseAndCreate().isEnabled()) {
- return ui.getCloseAndCreate();
- }
- return ui.getDelete();
- }
- return super.getComponentBefore(aContainer, aComponent);
+ protected Component getFirstComponentForEdit(Container aContainer) {
+ return getUi().getCaptain();
}
@Override
- public Component getComponentAfter(Container aContainer, Component aComponent) {
+ protected Component getLastComponentForEdit(Container aContainer) {
TripSeineUI ui = getUi();
- if (!ui.getCloseAndCreate().isEnabled() && aComponent.equals(ui.getDelete())) {
-
- // retour au début
- return ui.getCaptain();
- }
- if (aComponent.equals(ui.getCloseAndCreate())) {
-
- // retour au début
- return ui.getCaptain();
+ if (!ui.getCloseAndCreate().isEnabled()) {
+ return ui.getDelete();
}
- return super.getComponentAfter(aContainer, aComponent);
+ return ui.getCloseAndCreate();
}
+
});
+
builder.put(RouteUI.class, new ObserveLayoutFocusTraversalPolicy<RouteUI>() {
@Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- RouteUI ui = getUi();
- if (aComponent.equals(ui.getDate().getEditor())) {
- if (ui.getCloseAndCreate().isEnabled()) {
- return ui.getCloseAndCreate();
- }
- return ui.getDelete();
- }
- return super.getComponentBefore(aContainer, aComponent);
+ protected Component getFirstComponentForEdit(Container aContainer) {
+ return getUi().getDate();
}
@Override
- public Component getComponentAfter(Container aContainer, Component aComponent) {
+ protected Component getLastComponentForEdit(Container aContainer) {
RouteUI ui = getUi();
- if (!ui.getCloseAndCreate().isEnabled() && aComponent.equals(ui.getDelete())) {
-
- // retour au début
- return ui.getDate();
- }
- if (aComponent.equals(ui.getCloseAndCreate())) {
-
- // retour au début
- return ui.getDate();
+ if (ui.getCloseAndCreate().isEnabled()) {
+ return ui.getCloseAndCreate();
}
- return super.getComponentAfter(aContainer, aComponent);
+ return ui.getDelete();
}
+
});
builder.put(TdrUI.class, new ObserveLayoutFocusTraversalPolicy<TdrUI>() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- TdrUI ui = getUi();
- int selectedIndex = ui.getEditTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- if (aComponent.equals(ui.getHomeId())) {
- return getLastComponent(aContainer);
- }
- case 1:
- if (aComponent.equals(ui.getSection().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- case 2:
- if (aComponent.equals(ui.getEnableTimestamp())) {
- return getLastComponent(aContainer);
- }
- case 3:
- if (aComponent.equals(ui.getFishingStartDepth())) {
- return getLastComponent(aContainer);
- }
- case 4:
- if (aComponent.equals(ui.getSpecies().getUniverseList())) {
- return getLastComponent(aContainer);
- }
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
@Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
TdrUI ui = getUi();
int selectedIndex = ui.getEditTabPane().getSelectedIndex();
switch (selectedIndex) {
@@ -546,7 +371,7 @@ public class ObserveFocusManager {
}
@Override
- public Component getLastComponent(Container aContainer) {
+ protected Component getLastComponentForEdit(Container aContainer) {
TdrUI ui = getUi();
if (ui.getSave().isEnabled()) {
return ui.getSave();
@@ -566,24 +391,18 @@ public class ObserveFocusManager {
return super.getLastComponent(aContainer);
}
+
+
});
builder.put(SensorUsedUI.class, new ObserveLayoutFocusTraversalPolicy<SensorUsedUI>() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- SensorUsedUI ui = getUi();
- if (aComponent.equals(ui.getSensorType().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
@Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
return getUi().getSensorType();
}
@Override
- public Component getLastComponent(Container aContainer) {
+ protected Component getLastComponentForEdit(Container aContainer) {
SensorUsedUI ui = getUi();
if (ui.getSave().isEnabled()) {
return ui.getSave();
@@ -593,23 +412,11 @@ public class ObserveFocusManager {
}
return ui.getComment2();
}
+
});
builder.put(GearUseFeaturesLonglineUI.class, new ObserveLayoutFocusTraversalPolicy<GearUseFeaturesLonglineUI>() {
@Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- GearUseFeaturesLonglineUI ui = getUi();
- int selectedIndex = ui.getGearUseFeaturesTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- if (aComponent.equals(ui.getGear().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
GearUseFeaturesLonglineUI ui = getUi();
int selectedIndex = ui.getGearUseFeaturesTabPane().getSelectedIndex();
switch (selectedIndex) {
@@ -620,27 +427,20 @@ public class ObserveFocusManager {
}
@Override
- public Component getLastComponent(Container aContainer) {
- return getDefaultLastComponent(getUi(), null);
+ protected Component getLastComponentForEdit(Container aContainer) {
+ return getTableDefaultLastComponent(getUi(), null);
}
+
});
builder.put(EncounterUI.class, new ObserveLayoutFocusTraversalPolicy<EncounterUI>() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- EncounterUI ui = getUi();
- if (aComponent.equals(ui.getEncounterType().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
@Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
return getUi().getEncounterType();
}
@Override
- public Component getLastComponent(Container aContainer) {
+ protected Component getLastComponentForEdit(Container aContainer) {
EncounterUI ui = getUi();
if (ui.getSave().isEnabled()) {
return ui.getSave();
@@ -650,42 +450,12 @@ public class ObserveFocusManager {
}
return ui.getComment2();
}
+
});
builder.put(CatchLonglineUI.class, new ObserveLayoutFocusTraversalPolicy<CatchLonglineUI>() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- CatchLonglineUI ui = getUi();
- int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- if (ui.getTableModel().isCreate()) {
- if (aComponent.equals(ui.getAcquisitionModeIndividual())) {
- return getLastComponent(aContainer);
- }
- } else {
- if (aComponent.equals(ui.getSection().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- }
-
- case 1:
- if (aComponent.equals(ui.getDepredated())) {
- return getLastComponent(aContainer);
- }
- case 2:
- if (aComponent.equals(ui.getStomacFullness().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- case 5:
- if (aComponent.equals(ui.getDepthRecorder())) {
- return getLastComponent(aContainer);
- }
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
@Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
CatchLonglineUI ui = getUi();
int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
switch (selectedIndex) {
@@ -706,25 +476,15 @@ public class ObserveFocusManager {
}
@Override
- public Component getLastComponent(Container aContainer) {
- return getDefaultLastComponent(getUi(), null);
+ protected Component getLastComponentForEdit(Container aContainer) {
+ return getTableDefaultLastComponent(getUi(), null);
}
+
});
builder.put(TargetSampleUI.class, new ObserveLayoutFocusTraversalPolicy<TargetSampleUI>() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- TargetSampleUI ui = getUi();
- if (aComponent.equals(ui.getAcquisitionModeEffectif())) {
- return getLastComponent(aContainer);
- }
- if (aComponent.equals(ui.getSizeMeasureType().getCombobox().getEditor().getEditorComponent()) && !ui.getAcquisitionModeEffectif().isEnabled()) {
- return super.getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
@Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
TargetSampleUI ui = getUi();
if (ui.getAcquisitionModeEffectif().isEnabled()) {
return ui.getAcquisitionModeEffectif();
@@ -733,27 +493,16 @@ public class ObserveFocusManager {
}
@Override
- public Component getLastComponent(Container aContainer) {
+ protected Component getLastComponentForEdit(Container aContainer) {
TargetSampleUI ui = getUi();
- return getDefaultLastComponent(ui, ui.getComment2());
+ return getTableDefaultLastComponent(ui, ui.getComment2());
}
+
});
builder.put(TargetDiscardCatchUI.class, new ObserveLayoutFocusTraversalPolicy<TargetDiscardCatchUI>() {
@Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- TargetDiscardCatchUI ui = getUi();
- if (aComponent.equals(ui.getSpecies().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- if (aComponent.equals(ui.getCatchWeight().getTextField()) && !ui.getSpecies().isEnabled()) {
- return super.getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
TargetDiscardCatchUI ui = getUi();
if (ui.getSpecies().isEnabled()) {
return ui.getSpecies();
@@ -762,26 +511,16 @@ public class ObserveFocusManager {
}
@Override
- public Component getLastComponent(Container aContainer) {
+ protected Component getLastComponentForEdit(Container aContainer) {
TargetDiscardCatchUI ui = getUi();
- return getDefaultLastComponent(ui, ui.getTargetDiscardCatchCompositionEstimatedByObserver());
+ return getTableDefaultLastComponent(ui, ui.getTargetDiscardCatchCompositionEstimatedByObserver());
}
+
});
builder.put(TargetCatchUI.class, new ObserveLayoutFocusTraversalPolicy<TargetCatchUI>() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- TargetCatchUI ui = getUi();
- if (aComponent.equals(ui.getSpecies().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- if (aComponent.equals(ui.getCatchWeight().getTextField()) && !ui.getSpecies().isEnabled()) {
- return super.getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
@Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
TargetCatchUI ui = getUi();
if (ui.getSpecies().isEnabled()) {
return ui.getSpecies();
@@ -790,26 +529,16 @@ public class ObserveFocusManager {
}
@Override
- public Component getLastComponent(Container aContainer) {
+ protected Component getLastComponentForEdit(Container aContainer) {
TargetCatchUI ui = getUi();
- return getDefaultLastComponent(ui, ui.getTargetCatchCompositionEstimatedByObserver());
+ return getTableDefaultLastComponent(ui, ui.getTargetCatchCompositionEstimatedByObserver());
}
+
});
builder.put(SchoolEstimateUI.class, new ObserveLayoutFocusTraversalPolicy<SchoolEstimateUI>() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- SchoolEstimateUI ui = getUi();
- if (aComponent.equals(ui.getSpecies().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- if (aComponent.equals(ui.getTotalWeight().getTextField()) && !ui.getSpecies().isEnabled()) {
- return getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
@Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
SchoolEstimateUI ui = getUi();
if (ui.getSpecies().isEnabled()) {
return ui.getSpecies();
@@ -818,69 +547,44 @@ public class ObserveFocusManager {
}
@Override
- public Component getLastComponent(Container aContainer) {
+ protected Component getLastComponentForEdit(Container aContainer) {
SchoolEstimateUI ui = getUi();
- return getDefaultLastComponent(ui, ui.getComment2());
+ return getTableDefaultLastComponent(ui, ui.getComment2());
}
});
builder.put(ObjectSchoolEstimateUI.class, new ObserveLayoutFocusTraversalPolicy<ObjectSchoolEstimateUI>() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- if (aComponent.equals(getUi().getSpecies().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
@Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
return getUi().getSpecies();
}
@Override
- public Component getLastComponent(Container aContainer) {
+ protected Component getLastComponentForEdit(Container aContainer) {
ObjectSchoolEstimateUI ui = getUi();
- return getDefaultLastComponent(ui, ui.getComment2());
+ return getTableDefaultLastComponent(ui, ui.getComment2());
}
});
builder.put(ObjectObservedSpeciesUI.class, new ObserveLayoutFocusTraversalPolicy<ObjectObservedSpeciesUI>() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- if (aComponent.equals(getUi().getSpecies().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
@Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
return getUi().getSpecies();
}
@Override
- public Component getLastComponent(Container aContainer) {
+ protected Component getLastComponentForEdit(Container aContainer) {
ObjectObservedSpeciesUI ui = getUi();
- return getDefaultLastComponent(ui, ui.getComment2());
+ return getTableDefaultLastComponent(ui, ui.getComment2());
}
});
builder.put(NonTargetSampleUI.class, new ObserveLayoutFocusTraversalPolicy<NonTargetSampleUI>() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- NonTargetSampleUI ui = getUi();
- if (aComponent.equals(ui.getAcquisitionModeEffectif())) {
- return getLastComponent(aContainer);
- }
- if (aComponent.equals(ui.getSizeMeasureType().getCombobox().getEditor().getEditorComponent()) && !ui.getAcquisitionModeEffectif().isEnabled()) {
- return super.getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
@Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
NonTargetSampleUI ui = getUi();
if (ui.getAcquisitionModeEffectif().isEnabled()) {
return ui.getAcquisitionModeEffectif();
@@ -889,48 +593,29 @@ public class ObserveFocusManager {
}
@Override
- public Component getLastComponent(Container aContainer) {
+ protected Component getLastComponentForEdit(Container aContainer) {
NonTargetSampleUI ui = getUi();
- return getDefaultLastComponent(ui, ui.getComment2());
+ return getTableDefaultLastComponent(ui, ui.getComment2());
}
});
builder.put(NonTargetCatchUI.class, new ObserveLayoutFocusTraversalPolicy<NonTargetCatchUI>() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- if (aComponent.equals(getUi().getSpecies().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
@Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
return getUi().getSpecies();
}
@Override
- public Component getLastComponent(Container aContainer) {
- return getDefaultLastComponent(getUi(), null);
+ protected Component getLastComponentForEdit(Container aContainer) {
+ return getTableDefaultLastComponent(getUi(), null);
}
});
builder.put(GearUseFeaturesSeineUI.class, new ObserveLayoutFocusTraversalPolicy<GearUseFeaturesSeineUI>() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- GearUseFeaturesSeineUI ui = getUi();
- int selectedIndex = ui.getGearUseFeaturesTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- if (aComponent.equals(ui.getGear().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
@Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
GearUseFeaturesSeineUI ui = getUi();
int selectedIndex = ui.getGearUseFeaturesTabPane().getSelectedIndex();
switch (selectedIndex) {
@@ -941,55 +626,42 @@ public class ObserveFocusManager {
}
@Override
- public Component getLastComponent(Container aContainer) {
- return getDefaultLastComponent(getUi(), null);
+ protected Component getLastComponentForEdit(Container aContainer) {
+ return getTableDefaultLastComponent(getUi(), null);
}
+
});
builder.put(ContentReferenceUI.class, new ObserveLayoutFocusTraversalPolicy<ContentReferenceUI>() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- if (aComponent.equals(getUi().getUri())) {
- return getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
@Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
return getUi().getUri();
}
@Override
- public Component getLastComponent(Container aContainer) {
+ protected Component getLastComponentForEdit(Container aContainer) {
return getUi().getBackToList();
}
- });
- builder.put(ReferenceHomeUI.class, new ObserveLayoutFocusTraversalPolicy<ReferenceHomeUI>());
+ });
- builder.put(VesselUI.class, new ObserveLayoutFocusTraversalPolicy<VesselUI>() {
+ builder.put(ReferenceHomeUI.class, new ObserveLayoutFocusTraversalPolicy<ReferenceHomeUI>() {
@Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- VesselUI ui = getUi();
- int selectedIndex = ui.getTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- if (aComponent.equals(ui.getKeelCode().getTextField())) {
- return getLastComponent(aContainer);
- }
- break;
- case 1:
- if (aComponent.equals(ui.getLength().getTextField())) {
- return getLastComponent(aContainer);
- }
- break;
- }
+ protected Component getFirstComponentForEdit(Container aContainer) {
+ return null;
+ }
- return super.getComponentBefore(aContainer, aComponent);
+ @Override
+ protected Component getLastComponentForEdit(Container aContainer) {
+ return null;
}
+ });
+
+ builder.put(VesselUI.class, new ObserveLayoutFocusTraversalPolicy<VesselUI>() {
+
@Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
VesselUI ui = getUi();
int selectedIndex = ui.getTabPane().getSelectedIndex();
switch (selectedIndex) {
@@ -1002,34 +674,16 @@ public class ObserveFocusManager {
}
@Override
- public Component getLastComponent(Container aContainer) {
+ protected Component getLastComponentForEdit(Container aContainer) {
return getUi().getBackToList();
}
+
});
builder.put(SpeciesUI.class, new ObserveLayoutFocusTraversalPolicy<SpeciesUI>() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- SpeciesUI ui = getUi();
- int selectedIndex = ui.getTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- if (aComponent.equals(ui.getUri())) {
- return getLastComponent(aContainer);
- }
- break;
- case 1:
- if (aComponent.equals(ui.getSizeMeasureType().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- break;
- }
-
- return super.getComponentBefore(aContainer, aComponent);
- }
@Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
SpeciesUI ui = getUi();
int selectedIndex = ui.getTabPane().getSelectedIndex();
switch (selectedIndex) {
@@ -1042,34 +696,16 @@ public class ObserveFocusManager {
}
@Override
- public Component getLastComponent(Container aContainer) {
+ protected Component getLastComponentForEdit(Container aContainer) {
return getUi().getBackToList();
}
+
});
builder.put(SpeciesListUI.class, new ObserveLayoutFocusTraversalPolicy<SpeciesListUI>() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- SpeciesListUI ui = getUi();
- int selectedIndex = ui.getTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- if (aComponent.equals(ui.getUri())) {
- return getLastComponent(aContainer);
- }
- break;
- case 1:
- if (aComponent.equals(ui.getSpecies().getUniverseList())) {
- return getLastComponent(aContainer);
- }
- break;
- }
-
- return super.getComponentBefore(aContainer, aComponent);
- }
@Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
SpeciesListUI ui = getUi();
int selectedIndex = ui.getTabPane().getSelectedIndex();
switch (selectedIndex) {
@@ -1082,34 +718,16 @@ public class ObserveFocusManager {
}
@Override
- public Component getLastComponent(Container aContainer) {
+ protected Component getLastComponentForEdit(Container aContainer) {
return getUi().getBackToList();
}
+
});
builder.put(ProgramUI.class, new ObserveLayoutFocusTraversalPolicy<ProgramUI>() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- ProgramUI ui = getUi();
- int selectedIndex = ui.getTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- if (aComponent.equals(ui.getUri())) {
- return getLastComponent(aContainer);
- }
- break;
- case 1:
- if (aComponent.equals(ui.getNonTargetObservation())) {
- return getLastComponent(aContainer);
- }
- break;
- }
-
- return super.getComponentBefore(aContainer, aComponent);
- }
@Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
ProgramUI ui = getUi();
int selectedIndex = ui.getTabPane().getSelectedIndex();
switch (selectedIndex) {
@@ -1122,41 +740,16 @@ public class ObserveFocusManager {
}
@Override
- public Component getLastComponent(Container aContainer) {
+ protected Component getLastComponentForEdit(Container aContainer) {
return getUi().getBackToList();
}
+
});
builder.put(LengthWeightParameterUI.class, new ObserveLayoutFocusTraversalPolicy<LengthWeightParameterUI>() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- LengthWeightParameterUI ui = getUi();
- int selectedIndex = ui.getTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- if (ui.getModel().isCreatingMode()) {
- if (aComponent.equals(ui.getSex().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- } else {
-
- if (aComponent.equals(ui.getStartDate().getEditor())) {
- return getLastComponent(aContainer);
- }
- }
- break;
- case 1:
- if (aComponent.equals(ui.getCoefficients())) {
- return getLastComponent(aContainer);
- }
- break;
- }
-
- return super.getComponentBefore(aContainer, aComponent);
- }
@Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
LengthWeightParameterUI ui = getUi();
int selectedIndex = ui.getTabPane().getSelectedIndex();
switch (selectedIndex) {
@@ -1174,41 +767,16 @@ public class ObserveFocusManager {
}
@Override
- public Component getLastComponent(Container aContainer) {
+ protected Component getLastComponentForEdit(Container aContainer) {
return getUi().getBackToList();
}
+
});
builder.put(LengthLengthParameterUI.class, new ObserveLayoutFocusTraversalPolicy<LengthLengthParameterUI>() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- LengthLengthParameterUI ui = getUi();
- int selectedIndex = ui.getTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- if (ui.getModel().isCreatingMode()) {
- if (aComponent.equals(ui.getInputSizeMeasureType().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- } else {
-
- if (aComponent.equals(ui.getUri())) {
- return getLastComponent(aContainer);
- }
- }
- break;
- case 1:
- if (aComponent.equals(ui.getCoefficients())) {
- return getLastComponent(aContainer);
- }
- break;
- }
-
- return super.getComponentBefore(aContainer, aComponent);
- }
@Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
LengthLengthParameterUI ui = getUi();
int selectedIndex = ui.getTabPane().getSelectedIndex();
switch (selectedIndex) {
@@ -1226,34 +794,16 @@ public class ObserveFocusManager {
}
@Override
- public Component getLastComponent(Container aContainer) {
+ protected Component getLastComponentForEdit(Container aContainer) {
return getUi().getBackToList();
}
+
});
builder.put(GearUI.class, new ObserveLayoutFocusTraversalPolicy<GearUI>() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- GearUI ui = getUi();
- int selectedIndex = ui.getTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- if (aComponent.equals(ui.getUri())) {
- return getLastComponent(aContainer);
- }
- break;
- case 1:
- if (aComponent.equals(ui.getGearCaracteristic().getUniverseList())) {
- return getLastComponent(aContainer);
- }
- break;
- }
-
- return super.getComponentBefore(aContainer, aComponent);
- }
@Override
- public Component getFirstComponent(Container aContainer) {
+ protected Component getFirstComponentForEdit(Container aContainer) {
GearUI ui = getUi();
int selectedIndex = ui.getTabPane().getSelectedIndex();
switch (selectedIndex) {
@@ -1266,38 +816,41 @@ public class ObserveFocusManager {
}
@Override
- public Component getLastComponent(Container aContainer) {
+ protected Component getLastComponentForEdit(Container aContainer) {
return getUi().getBackToList();
}
});
builder.put(WeightCategoryUI.class, new ObserveLayoutFocusTraversalPolicy<WeightCategoryUI>() {
+
@Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- WeightCategoryUI ui = getUi();
- if (aComponent.equals(ui.getSpecies().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
+ protected Component getFirstComponentForEdit(Container aContainer) {
+ return getUi().getSpecies();
}
@Override
- public Component getFirstComponent(Container aContainer) {
- return getUi().getSpecies();
+ protected Component getLastComponentForEdit(Container aContainer) {
+ return getUi().getBackToList();
}
@Override
- public Component getLastComponent(Container aContainer) {
+ protected Component getFirstComponentForRead(Container aContainer) {
return getUi().getBackToList();
}
+
+ @Override
+ protected Component getLastComponentForRead(Container aContainer) {
+ return getUi().getBackToList();
+ }
+
});
policies = builder.build();
}
- public static class ObserveLayoutFocusTraversalPolicy<U extends ContentUI> extends LayoutFocusTraversalPolicy {
+ public static abstract class ObserveLayoutFocusTraversalPolicy<U extends ContentUI> extends LayoutFocusTraversalPolicy {
private Supplier<U> uiSupplier;
@@ -1309,7 +862,101 @@ public class ObserveFocusManager {
return uiSupplier.get();
}
- protected <UU extends ContentTableUI> Component getDefaultLastComponent(UU ui, Component optionalComponent) {
+ protected abstract Component getFirstComponentForEdit(Container aContainer);
+
+ protected abstract Component getLastComponentForEdit(Container aContainer);
+
+ protected Component getFirstComponentForRead(Container aContainer) {
+ if (getUi() instanceof ContentOpenableUI) {
+ ContentOpenableUI ui = (ContentOpenableUI) getUi();
+ if (ui.getReopen().isEnabled() && ui.getReopen().isVisible()) {
+ return ui.getReopen();
+ }
+ } else if (getUi() instanceof ContentReferenceUI) {
+ ContentReferenceUI ui = (ContentReferenceUI) getUi();
+ return ui.getBackToList();
+ }
+ if (getUi().getActionUp().isEnabled()) {
+ return getUi().getActionUp();
+ }
+ return getUi().getActionDown();
+ }
+
+ protected Component getLastComponentForRead(Container aContainer) {
+ if (getUi() instanceof ContentOpenableUI) {
+ ContentOpenableUI ui = (ContentOpenableUI) getUi();
+ if (ui.getReopen().isEnabled() && ui.getReopen().isVisible()) {
+ return ui.getReopen();
+ }
+ } else if (getUi() instanceof ContentReferenceUI) {
+ ContentReferenceUI ui = (ContentReferenceUI) getUi();
+ return ui.getBackToList();
+
+ }
+ if (getUi().getActionDown().isEnabled()) {
+ return getUi().getActionDown();
+ }
+ return getUi().getActionUp();
+ }
+
+ @Override
+ public final Component getComponentAfter(Container aContainer, Component aComponent) {
+ Component lastComponent = getLastComponent(aContainer);
+ lastComponent = getRealFocusComponent(lastComponent);
+ if (aComponent.equals(lastComponent)) {
+ return getFirstComponent(aContainer);
+ }
+ return super.getComponentAfter(aContainer, aComponent);
+ }
+
+ @Override
+ public final Component getComponentBefore(Container aContainer, Component aComponent) {
+
+ Component firstComponent = getFirstComponent(aContainer);
+ firstComponent = getRealFocusComponent(firstComponent);
+ if (aComponent.equals(firstComponent)) {
+ return getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ protected Component getRealFocusComponent(Component firstComponent) {
+ if (firstComponent instanceof BeanComboBox) {
+ BeanComboBox component = (BeanComboBox) firstComponent;
+ firstComponent = component.getCombobox().getEditor().getEditorComponent();
+ } else if (firstComponent instanceof JSpinner) {
+ JSpinner component = (JSpinner) firstComponent;
+ firstComponent = component.getEditor();
+ } else if (firstComponent instanceof NumberEditor) {
+ NumberEditor component = (NumberEditor) firstComponent;
+ firstComponent = component.getTextField();
+ } else if (firstComponent instanceof JXDatePicker) {
+ JXDatePicker component = (JXDatePicker) firstComponent;
+ firstComponent = component.getEditor();
+ } else if (firstComponent instanceof FilterableDoubleList) {
+ FilterableDoubleList component = (FilterableDoubleList) firstComponent;
+ firstComponent = component.getUniverseList();
+ }
+ return firstComponent;
+ }
+
+ @Override
+ public final Component getFirstComponent(Container aContainer) {
+ if (getUi().getModel().isReadingMode()) {
+ return getFirstComponentForRead(aContainer);
+ }
+ return getFirstComponentForEdit(aContainer);
+ }
+
+ @Override
+ public final Component getLastComponent(Container aContainer) {
+ if (getUi().getModel().isReadingMode()) {
+ return getLastComponentForRead(aContainer);
+ }
+ return getLastComponentForEdit(aContainer);
+ }
+
+ protected <UU extends ContentTableUI> Component getTableDefaultLastComponent(UU ui, Component optionalComponent) {
if (ui.getSave().isEnabled()) {
return ui.getSave();
}
@@ -1334,4 +981,54 @@ public class ObserveFocusManager {
}
+ private static class ContentListUIObserveLayoutFocusTraversalPolicy extends ObserveLayoutFocusTraversalPolicy<ContentListUI> {
+
+ private List<JComponent> actions;
+
+ @Override
+ protected Component getFirstComponentForEdit(Container aContainer) {
+ return getUi().getList();
+ }
+
+ @Override
+ protected Component getLastComponentForEdit(Container aContainer) {
+ Optional<JComponent> optional = getActions().stream().filter(a -> a.isEnabled() && a.isVisible()).findFirst();
+ return optional.isPresent() ? optional.get() : null;
+ }
+
+ @Override
+ protected Component getFirstComponentForRead(Container aContainer) {
+ return getUi().getList();
+ }
+
+ @Override
+ protected Component getLastComponentForRead(Container aContainer) {
+ Optional<JComponent> optional = getActions().stream().filter(a -> a.isEnabled() && a.isVisible()).findFirst();
+ return optional.isPresent() ? optional.get() : null;
+ }
+
+ public List<JComponent> getActions() {
+ if (actions == null) {
+
+ actions = new ArrayList<>();
+ actions.add(getUi().getGotoSelectedChild());
+ actions.add(getUi().getReopenChild());
+ actions.add(getUi().getCloseChild());
+ actions.add(getUi().getGotoOpenChild());
+ actions.add(getUi().getGotoOpenChild2());
+ actions.add(getUi().getCreateChild());
+ for (Component component : getUi().getExtraActions().getComponents()) {
+ if (component instanceof JButton) {
+ actions.add((JComponent) component);
+ }
+ }
+ actions.add(getUi().getMoveSelectedChildren());
+
+ }
+ List<JComponent> result = new ArrayList<>(actions);
+ Collections.reverse(result);
+ return result;
+ }
+
+ }
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineDetailCompositionUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineDetailCompositionUI.jaxx
index c9eb46d..f3a398a 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineDetailCompositionUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineDetailCompositionUI.jaxx
@@ -25,8 +25,8 @@
<import>
fr.ird.observe.application.swing.ObserveSwingApplicationContext
fr.ird.observe.services.dto.longline.SetLonglineDetailCompositionDto
- fr.ird.observe.application.swing.ui.actions.shared.ResetEditUIAction
- fr.ird.observe.application.swing.ui.actions.shared.SaveEditUIAction
+ fr.ird.observe.application.swing.ui.actions.content.ResetEditUIAction
+ fr.ird.observe.application.swing.ui.actions.content.SaveEditUIAction
fr.ird.observe.application.swing.ui.util.JVetoableTabbedPane
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineGlobalCompositionUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineGlobalCompositionUI.jaxx
index 91de3f7..372a383 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineGlobalCompositionUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineGlobalCompositionUI.jaxx
@@ -28,8 +28,8 @@
fr.ird.observe.services.dto.longline.SetLonglineGlobalCompositionDto
fr.ird.observe.services.dto.referential.ReferentialReference
fr.ird.observe.services.dto.referential.longline.MitigationTypeDto
- fr.ird.observe.application.swing.ui.actions.shared.ResetEditUIAction
- fr.ird.observe.application.swing.ui.actions.shared.SaveEditUIAction
+ fr.ird.observe.application.swing.ui.actions.content.ResetEditUIAction
+ fr.ird.observe.application.swing.ui.actions.content.SaveEditUIAction
fr.ird.observe.application.swing.ui.content.table.impl.longline.BaitsCompositionUI
fr.ird.observe.application.swing.ui.content.table.impl.longline.BaitsCompositionUIModel
fr.ird.observe.application.swing.ui.content.table.impl.longline.BranchlinesCompositionUI
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/SetLonglineUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/SetLonglineUI.jaxx
index 0fd6436..36225bd 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/SetLonglineUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/SetLonglineUI.jaxx
@@ -32,10 +32,10 @@
fr.ird.observe.services.dto.referential.longline.LightsticksTypeDto
fr.ird.observe.services.dto.referential.longline.LightsticksColorDto
- fr.ird.observe.application.swing.ui.actions.shared.CancelCreateUIAction
- fr.ird.observe.application.swing.ui.actions.shared.DeleteDataUIAction
- fr.ird.observe.application.swing.ui.actions.shared.ResetEditUIAction
- fr.ird.observe.application.swing.ui.actions.shared.SaveEditUIAction
+ fr.ird.observe.application.swing.ui.actions.content.CancelCreateUIAction
+ fr.ird.observe.application.swing.ui.actions.content.DeleteDataUIAction
+ fr.ird.observe.application.swing.ui.actions.content.ResetEditUIAction
+ fr.ird.observe.application.swing.ui.actions.content.SaveEditUIAction
fr.ird.observe.application.swing.ui.content.ContentUIModel
fr.ird.observe.application.swing.ui.util.BooleanEditor
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectTransmittingBuoyOperationUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectTransmittingBuoyOperationUI.jaxx
index cde2155..8bfa13f 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectTransmittingBuoyOperationUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectTransmittingBuoyOperationUI.jaxx
@@ -33,8 +33,8 @@
fr.ird.observe.services.dto.referential.ReferentialReference
fr.ird.observe.services.dto.referential.seine.TransmittingBuoyOperationDto
fr.ird.observe.services.dto.referential.seine.TransmittingBuoyTypeDto
- fr.ird.observe.application.swing.ui.actions.shared.ResetEditUIAction
- fr.ird.observe.application.swing.ui.actions.shared.SaveEditUIAction
+ fr.ird.observe.application.swing.ui.actions.content.ResetEditUIAction
+ fr.ird.observe.application.swing.ui.actions.content.SaveEditUIAction
jaxx.runtime.swing.editor.bean.BeanComboBox
java.awt.Dimension
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectUI.jaxx
index 47721bb..ae8fae4 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectUI.jaxx
@@ -29,10 +29,10 @@
fr.ird.observe.services.dto.referential.seine.ObjectFateDto
fr.ird.observe.services.dto.referential.seine.ObjectOperationDto
fr.ird.observe.services.dto.referential.seine.ObjectTypeDto
- fr.ird.observe.application.swing.ui.actions.shared.CancelCreateUIAction
- fr.ird.observe.application.swing.ui.actions.shared.DeleteDataUIAction
- fr.ird.observe.application.swing.ui.actions.shared.ResetEditUIAction
- fr.ird.observe.application.swing.ui.actions.shared.SaveEditUIAction
+ fr.ird.observe.application.swing.ui.actions.content.CancelCreateUIAction
+ fr.ird.observe.application.swing.ui.actions.content.DeleteDataUIAction
+ fr.ird.observe.application.swing.ui.actions.content.ResetEditUIAction
+ fr.ird.observe.application.swing.ui.actions.content.SaveEditUIAction
jaxx.runtime.swing.editor.NumberEditor
jaxx.runtime.swing.editor.bean.BeanComboBox
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/SetSeineUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/SetSeineUI.jaxx
index 638dc60..784199b 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/SetSeineUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/SetSeineUI.jaxx
@@ -28,10 +28,10 @@
fr.ird.observe.services.dto.seine.SetSeineDto
fr.ird.observe.services.dto.referential.ReferentialReference
fr.ird.observe.services.dto.referential.seine.ReasonForNullSetDto
- fr.ird.observe.application.swing.ui.actions.shared.CancelCreateUIAction
- fr.ird.observe.application.swing.ui.actions.shared.DeleteDataUIAction
- fr.ird.observe.application.swing.ui.actions.shared.ResetEditUIAction
- fr.ird.observe.application.swing.ui.actions.shared.SaveEditUIAction
+ fr.ird.observe.application.swing.ui.actions.content.CancelCreateUIAction
+ fr.ird.observe.application.swing.ui.actions.content.DeleteDataUIAction
+ fr.ird.observe.application.swing.ui.actions.content.ResetEditUIAction
+ fr.ird.observe.application.swing.ui.actions.content.SaveEditUIAction
fr.ird.observe.application.swing.ui.util.BooleanEditor
jaxx.runtime.swing.editor.NumberEditor
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUI.jaxx
index f0091a0..349a395 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUI.jaxx
@@ -25,8 +25,9 @@
genericType='E extends IdDto, C extends DataDto, U extends ContentListUI<E,C, U>'>
<import>
- fr.ird.observe.application.swing.ui.actions.shared.CloseOpenUIAction
- fr.ird.observe.application.swing.ui.actions.shared.ReOpenUIAction
+ fr.ird.observe.application.swing.ui.actions.content.CloseOpenUIAction
+ fr.ird.observe.application.swing.ui.actions.content.CreateOpenUIAction
+ fr.ird.observe.application.swing.ui.actions.content.ReOpenUIAction
fr.ird.observe.application.swing.ui.actions.shared.SelectNodeUIAction
fr.ird.observe.services.dto.IdDto
@@ -104,7 +105,7 @@ public final List<DataReference<C>> getSelectedDatas() {
<JButton id='gotoOpenChild2'/>
</cell>
<cell>
- <JButton id='createChild' onActionPerformed='getHandler().addChild()'/>
+ <JButton id='createChild'/>
</cell>
</row>
<row>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUI.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUI.jcss
index 1ea4dae..03a4753 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUI.jcss
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUI.jcss
@@ -68,8 +68,8 @@
}
#createChild {
- actionIcon:"add";
visible:{model.isCreatingMode()};
+ _observeAction:{CreateOpenUIAction.ACTION_NAME};
}
#moveSelectedChildren {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUIHandler.java
index d98dabe..915a071 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUIHandler.java
@@ -40,20 +40,14 @@ import org.apache.commons.logging.LogFactory;
import javax.swing.DefaultListCellRenderer;
import javax.swing.Icon;
import javax.swing.JButton;
-import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JList;
-import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.ListCellRenderer;
import javax.swing.SwingUtilities;
import java.awt.Color;
import java.awt.Component;
-import java.awt.Container;
import java.awt.event.MouseEvent;
-import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
-import java.util.Optional;
import static org.nuiton.i18n.I18n.t;
@@ -108,6 +102,11 @@ public abstract class ContentListUIHandler<E extends IdDto, C extends DataDto, U
}
@Override
+ protected void addFocusabelOnForm() {
+ // pas besoin de gérer le focus, pas de formulaire
+ }
+
+ @Override
public final void openUI() {
super.openUI();
@@ -176,7 +175,7 @@ public abstract class ContentListUIHandler<E extends IdDto, C extends DataDto, U
getUi().getShowTechnicalInformations().setEnabled(false);
}
- void addChild() {
+ public void addChild() {
addChild(getModel().getChildType());
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/ActivityLonglinesUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/ActivityLonglinesUI.jaxx
index 89140dc..b2e3ddb 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/ActivityLonglinesUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/ActivityLonglinesUI.jaxx
@@ -28,10 +28,10 @@
<import>
fr.ird.observe.services.dto.longline.ActivityLonglineDto
fr.ird.observe.services.dto.longline.TripLonglineDto
- fr.ird.observe.application.swing.ui.actions.shared.CloseAndCreateUIAction
- fr.ird.observe.application.swing.ui.actions.shared.CloseOpenUIAction
+ fr.ird.observe.application.swing.ui.actions.content.CloseAndCreateUIAction
+ fr.ird.observe.application.swing.ui.actions.content.CloseOpenUIAction
fr.ird.observe.application.swing.ui.actions.shared.SelectOpenNodeUIAction
- fr.ird.observe.application.swing.ui.actions.shared.MoveActivityLonglinesUIAction
+ fr.ird.observe.application.swing.ui.actions.content.MoveActivityLonglinesUIAction
static org.nuiton.i18n.I18n.n
</import>
@@ -59,9 +59,6 @@
<!-- extra actions -->
<Table id='extraActions' fill="both" weightx="1" insets='2'>
<row>
- <cell weightx="0.5" fill="both">
- <JButton id='close'/>
- </cell>
<cell weightx="0.5">
<JButton id='closeAndCreate'/>
</cell>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/ActivityLonglinesUI.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/ActivityLonglinesUI.jcss
index e53824b..ed15846 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/ActivityLonglinesUI.jcss
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/ActivityLonglinesUI.jcss
@@ -31,16 +31,15 @@
}
#createChild {
- text:"observe.content.action.activity";
- toolTipText:"observe.content.action.activity.tip";
+ _text:{t("observe.content.action.activity")};
+ _toolTipText:{t("observe.content.action.activity.tip")};
}
#extraActions {
visible:{model.isUpdatingMode() && getDataContext().isOpenActivity()};
}
-#close {
- _observeAction:{CloseOpenUIAction.ACTION_NAME};
+#closeChild {
_toolTipText:{t("observe.action.close.activity.tip")};
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/CommonListUI.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/CommonListUI.jcss
index c1806f1..bfd407c 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/CommonListUI.jcss
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/CommonListUI.jcss
@@ -20,6 +20,10 @@
* #L%
*/
+JButton {
+ _protectFocus:true;
+}
+
#model {
enabled: true;
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/TripLonglinesUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/TripLonglinesUI.jaxx
index 4bfe978..0fbb378 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/TripLonglinesUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/TripLonglinesUI.jaxx
@@ -28,9 +28,10 @@
fr.ird.observe.services.dto.longline.TripLonglineDto
fr.ird.observe.services.dto.referential.ProgramDto
fr.ird.observe.application.swing.ui.actions.shared.SelectOpenNodeUIAction
- fr.ird.observe.application.swing.ui.actions.shared.MoveTripLonglinesUIAction
+ fr.ird.observe.application.swing.ui.actions.content.MoveTripLonglinesUIAction
static org.nuiton.i18n.I18n.n
+ static org.nuiton.i18n.I18n.t
</import>
<style source="CommonListUI.jcss"/>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/TripLonglinesUI.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/TripLonglinesUI.jcss
index e61a170..eb85cca 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/TripLonglinesUI.jcss
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/TripLonglinesUI.jcss
@@ -31,13 +31,13 @@
}
#createChild {
- text:"observe.content.action.trip";
- toolTipText:"observe.content.action.trip.tip";
+ _text:{t("observe.content.action.trip")};
+ _toolTipText:{t("observe.content.action.trip.tip")};
}
#moveSelectedChildren {
- text:"observe.content.action.move.trips";
- toolTipText:"observe.content.action.move.trips.tip";
+ _text:{t("observe.content.action.move.trips")};
+ _toolTipText:{t("observe.content.action.move.trips.tip")};
_observeAction:{MoveTripLonglinesUIAction.ACTION_NAME};
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/ActivitySeinesUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/ActivitySeinesUI.jaxx
index 0a453d7..e81401b 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/ActivitySeinesUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/ActivitySeinesUI.jaxx
@@ -28,10 +28,10 @@
<import>
fr.ird.observe.services.dto.seine.ActivitySeineDto
fr.ird.observe.services.dto.seine.RouteDto
- fr.ird.observe.application.swing.ui.actions.shared.CloseAndCreateUIAction
- fr.ird.observe.application.swing.ui.actions.shared.CloseOpenUIAction
+ fr.ird.observe.application.swing.ui.actions.content.CloseAndCreateUIAction
+ fr.ird.observe.application.swing.ui.actions.content.CloseOpenUIAction
fr.ird.observe.application.swing.ui.actions.shared.SelectOpenNodeUIAction
- fr.ird.observe.application.swing.ui.actions.shared.MoveActivitySeinesUIAction
+ fr.ird.observe.application.swing.ui.actions.content.MoveActivitySeinesUIAction
static org.nuiton.i18n.I18n.n
</import>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/CommonListUI.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/CommonListUI.jcss
index 2feab9c..fe34dfb 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/CommonListUI.jcss
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/CommonListUI.jcss
@@ -24,6 +24,10 @@
enabled: true;
}
+JButton {
+ _protectFocus:true;
+}
+
.gotoOpenTrip {
visible:{model.isUpdatingMode() && dataContext.isOpenTrip()};
_observeAction:{SelectOpenNodeUIAction.ACTION_NAME};
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/RoutesUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/RoutesUI.jaxx
index bdc29a5..4a44aa8 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/RoutesUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/RoutesUI.jaxx
@@ -30,7 +30,7 @@
fr.ird.observe.services.dto.seine.TripSeineDto
fr.ird.observe.services.dto.seine.RouteDto
fr.ird.observe.application.swing.ui.actions.shared.SelectOpenNodeUIAction
- fr.ird.observe.application.swing.ui.actions.shared.MoveRoutesUIAction
+ fr.ird.observe.application.swing.ui.actions.content.MoveRoutesUIAction
static org.nuiton.i18n.I18n.n
</import>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/TripSeinesUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/TripSeinesUI.jaxx
index 4701fef..3dcaa27 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/TripSeinesUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/TripSeinesUI.jaxx
@@ -29,7 +29,7 @@
fr.ird.observe.services.dto.seine.RouteDto
fr.ird.observe.services.dto.referential.ProgramDto
fr.ird.observe.application.swing.ui.actions.shared.SelectOpenNodeUIAction
- fr.ird.observe.application.swing.ui.actions.shared.MoveTripSeinesUIAction
+ fr.ird.observe.application.swing.ui.actions.content.MoveTripSeinesUIAction
static org.nuiton.i18n.I18n.n
</import>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUI.jaxx
index bc7195b..795e0cf 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUI.jaxx
@@ -27,13 +27,12 @@
<import>
fr.ird.observe.services.dto.IdDto
- fr.ird.observe.application.swing.ui.actions.shared.CancelCreateUIAction
- fr.ird.observe.application.swing.ui.actions.shared.CloseAndCreateUIAction
- fr.ird.observe.application.swing.ui.actions.shared.CloseOpenUIAction
- fr.ird.observe.application.swing.ui.actions.shared.DeleteDataUIAction
- fr.ird.observe.application.swing.ui.actions.shared.ReOpenUIAction
- fr.ird.observe.application.swing.ui.actions.shared.ResetEditUIAction
- fr.ird.observe.application.swing.ui.actions.shared.SaveEditUIAction
+ fr.ird.observe.application.swing.ui.actions.content.CloseAndCreateUIAction
+ fr.ird.observe.application.swing.ui.actions.content.CloseOpenUIAction
+ fr.ird.observe.application.swing.ui.actions.content.DeleteDataUIAction
+ fr.ird.observe.application.swing.ui.actions.content.ReOpenUIAction
+ fr.ird.observe.application.swing.ui.actions.content.ResetEditUIAction
+ fr.ird.observe.application.swing.ui.actions.content.SaveEditUIAction
javax.swing.SwingConstants
@@ -67,9 +66,6 @@
<cell fill="both">
<Table id='editActions' fill="both" weightx="1" insets='2'>
<row>
- <cell weightx="0.5" fill="both">
- <JButton id='cancel'/>
- </cell>
<cell weightx="0.5">
<JButton id='reset'/>
</cell>
@@ -85,8 +81,7 @@
</row>
<row insets='0'>
<cell fill='both'>
- <Table id='extraActions' fill="both" weightx="1" insets='2'
- visible='{model.isUpdatingMode()}'/>
+ <Table id='extraActions' fill="both" weightx="1" insets='2' visible='{model.isUpdatingMode()}'/>
</cell>
</row>
<row>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUI.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUI.jcss
index 2626b6e..f1255cc 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUI.jcss
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUI.jcss
@@ -24,15 +24,10 @@
visible:{!model.isReadingMode()};
}
-#cancel {
- _observeAction:{CancelCreateUIAction.ACTION_NAME};
- visible:{model.isCreatingMode()};
-}
-
#reset {
_observeAction:{ResetEditUIAction.ACTION_NAME};
- visible:{model.isUpdatingMode()};
- enabled:{model.isModified()};
+ visible:{!model.isReadingMode()};
+ enabled:{model.isCreatingMode() ? true : model.isModified()};
horizontalTextPosition:{SwingConstants.RIGHT};
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/ActivityLonglineUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/ActivityLonglineUI.jaxx
index 03c3ef9..46ee176 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/ActivityLonglineUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/ActivityLonglineUI.jaxx
@@ -33,7 +33,7 @@
fr.ird.observe.services.dto.referential.ReferentialReference
fr.ird.observe.services.dto.referential.FpaZoneDto
fr.ird.observe.services.dto.referential.longline.VesselActivityLonglineDto
- fr.ird.observe.application.swing.ui.actions.shared.DeleteDataUIAction
+ fr.ird.observe.application.swing.ui.actions.content.DeleteDataUIAction
jaxx.runtime.swing.editor.NumberEditor
jaxx.runtime.swing.editor.bean.BeanComboBox
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/TripLonglineUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/TripLonglineUI.jaxx
index 5b71a2f..d7355eb 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/TripLonglineUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/TripLonglineUI.jaxx
@@ -35,7 +35,7 @@
fr.ird.observe.services.dto.referential.PersonDto
fr.ird.observe.services.dto.referential.OceanDto
fr.ird.observe.services.dto.referential.longline.TripTypeDto
- fr.ird.observe.application.swing.ui.actions.shared.DeleteDataUIAction
+ fr.ird.observe.application.swing.ui.actions.content.DeleteDataUIAction
fr.ird.observe.application.swing.ui.util.tripMap.TripMapUI
org.jdesktop.swingx.JXDatePicker
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/ActivitySeineUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/ActivitySeineUI.jaxx
index 290eeef..360e22f 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/ActivitySeineUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/ActivitySeineUI.jaxx
@@ -39,7 +39,7 @@
fr.ird.observe.services.dto.referential.seine.DetectionModeDto
fr.ird.observe.services.dto.referential.seine.WindDto
- fr.ird.observe.application.swing.ui.actions.shared.DeleteDataUIAction
+ fr.ird.observe.application.swing.ui.actions.content.DeleteDataUIAction
jaxx.runtime.swing.editor.NumberEditor
jaxx.runtime.swing.editor.bean.BeanComboBox
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUI.jaxx
index 7bf35bf..35732ba 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUI.jaxx
@@ -29,9 +29,9 @@
fr.ird.observe.services.dto.referential.ReferentialReference
fr.ird.observe.application.swing.decoration.ObserveI18nDecoratorHelper
fr.ird.observe.application.swing.ui.UIHelper
- fr.ird.observe.application.swing.ui.actions.shared.DeleteReferenceUIAction
- fr.ird.observe.application.swing.ui.actions.shared.ResetEditUIAction
- fr.ird.observe.application.swing.ui.actions.shared.SaveEditUIAction
+ fr.ird.observe.application.swing.ui.actions.content.DeleteReferenceUIAction
+ fr.ird.observe.application.swing.ui.actions.content.ResetEditUIAction
+ fr.ird.observe.application.swing.ui.actions.content.SaveEditUIAction
jaxx.runtime.swing.editor.bean.BeanListHeader
jaxx.runtime.validator.swing.SwingValidator
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUIHandler.java
index c04f2f5..c0b7fa5 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUIHandler.java
@@ -390,7 +390,7 @@ public class ContentReferenceUIHandler<E extends ReferentialDto, U extends Conte
ui.getViewLayout().addPropertyChangeListener(CardLayout2Ext.SELECTED_PROPERTY_NAME,
evt -> SwingUtilities.invokeLater(revalidate));
- ObserveSwingApplicationContext.get().getFocusManager().setFocusTraversalPolicy(ui);
+ ObserveSwingApplicationContext.get().getFocusManager().installFocusTraversalPolicy(ui);
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/CommonTable.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/CommonTable.jcss
index 8901b79..64bb674 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/CommonTable.jcss
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/CommonTable.jcss
@@ -26,6 +26,10 @@ JToolBar {
opaque:false;
}
+JButton {
+ _protectFocus:true;
+}
+
NumberEditor {
bean: {tableEditBean};
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUI.jaxx
index 4809b9e..52661bb 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUI.jaxx
@@ -26,12 +26,12 @@
genericType='E extends IdDto, D extends IdDto, U extends ContentTableUI<E, D, U>'>
<import>
- fr.ird.observe.application.swing.ui.actions.shared.ResetEditUIAction
- fr.ird.observe.application.swing.ui.actions.shared.SaveEditUIAction
- fr.ird.observe.application.swing.ui.actions.shared.NewTableEntryUIAction
- fr.ird.observe.application.swing.ui.actions.shared.ResetTableEntryUIAction
- fr.ird.observe.application.swing.ui.actions.shared.SaveTableEntryUIAction
- fr.ird.observe.application.swing.ui.actions.shared.DeleteTableEntryUIAction
+ fr.ird.observe.application.swing.ui.actions.content.ResetEditUIAction
+ fr.ird.observe.application.swing.ui.actions.content.SaveEditUIAction
+ fr.ird.observe.application.swing.ui.actions.content.NewTableEntryUIAction
+ fr.ird.observe.application.swing.ui.actions.content.ResetTableEntryUIAction
+ fr.ird.observe.application.swing.ui.actions.content.SaveTableEntryUIAction
+ fr.ird.observe.application.swing.ui.actions.content.DeleteTableEntryUIAction
jaxx.runtime.swing.BlockingLayerUI
jaxx.runtime.validator.swing.SwingValidator
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIHandler.java
index 45838e3..097684e 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIHandler.java
@@ -219,8 +219,10 @@ public abstract class ContentTableUIHandler<E extends IdDto, D extends IdDto, U
uiInitializer.initUI();
getModel().addPropertyChangeListener(ContentUIModel.PROPERTY_FORM, evt -> updateUiWithReferenceSetsFromModel());
+ getModel().addPropertyChangeListener(ContentUIModel.PROPERTY_MODE, evt -> updateFocusable((ContentMode) evt.getNewValue()));
+ updateFocusable(ContentMode.READ);
- ObserveSwingApplicationContext.get().getFocusManager().setFocusTraversalPolicy(ui);
+ ObserveSwingApplicationContext.get().getFocusManager().installFocusTraversalPolicy(ui);
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/SensorUsedUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/SensorUsedUIHandler.java
index a3cdf99..fcda169 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/SensorUsedUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/SensorUsedUIHandler.java
@@ -121,7 +121,7 @@ public class SensorUsedUIHandler extends ContentTableUIHandler<ActivityLonglineS
dataFile = getActivityLonglineSensorUsedService().getDataFile(getTableEditBean().getId());
}
- int response = UIHelper.askUser((Component) ui,
+ int response = UIHelper.askUser(ui,
t("observe.title.confirmReplace"),
t("observe.content.sensorUsed.replace.data.message", dataFile.getName()),
JOptionPane.WARNING_MESSAGE,
@@ -135,7 +135,7 @@ public class SensorUsedUIHandler extends ContentTableUIHandler<ActivityLonglineS
}
}
- File file = UIHelper.chooseFile((Component) ui,
+ File file = UIHelper.chooseFile(ui,
t("observe.content.choose.sensorUsed.title.importData"),
t("observe.action.choose.sensorUsed.importData"),
null);
@@ -156,7 +156,7 @@ public class SensorUsedUIHandler extends ContentTableUIHandler<ActivityLonglineS
public void deleteData() {
- int response = UIHelper.askUser((Component) ui,
+ int response = UIHelper.askUser(ui,
t("observe.title.delete"),
t("observe.content.sensorUsed.delete.data.message"),
JOptionPane.WARNING_MESSAGE,
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/TdrUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/TdrUIHandler.java
index b0fa06a..29f01c8 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/TdrUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/TdrUIHandler.java
@@ -278,7 +278,7 @@ public class TdrUIHandler extends ContentTableUIHandler<SetLonglineTdrDto, TdrDt
dataFile = getTdrService().getDataFile(getTableEditBean().getId());
}
- int response = UIHelper.askUser((Component) ui,
+ int response = UIHelper.askUser(ui,
t("observe.title.confirmReplace"),
t("observe.content.tdr.replace.data.message", dataFile.getName()),
JOptionPane.WARNING_MESSAGE,
@@ -292,7 +292,7 @@ public class TdrUIHandler extends ContentTableUIHandler<SetLonglineTdrDto, TdrDt
}
}
- File file = UIHelper.chooseFile((Component) ui,
+ File file = UIHelper.chooseFile(ui,
t("observe.content.choose.tdr.title.importData"),
t("observe.action.choose.tdr.importData"),
null);
@@ -313,7 +313,7 @@ public class TdrUIHandler extends ContentTableUIHandler<SetLonglineTdrDto, TdrDt
public void deleteData() {
- int response = UIHelper.askUser((Component) ui,
+ int response = UIHelper.askUser(ui,
t("observe.title.delete"),
t("observe.content.tdr.delete.data.message"),
JOptionPane.WARNING_MESSAGE,
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/tree/ObserveTreeHelper.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/tree/ObserveTreeHelper.java
index e2e103a..711f93a 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/tree/ObserveTreeHelper.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/tree/ObserveTreeHelper.java
@@ -71,6 +71,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.swing.JTree;
+import javax.swing.SwingUtilities;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreeModel;
@@ -378,7 +379,7 @@ public class ObserveTreeHelper extends NavTreeHelper<ObserveNode> {
}
// navigation tree should acquire focus
- tree.requestFocus();
+ SwingUtilities.invokeLater(tree::grabFocus);
}
@Override
--
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm(a)codelutin.com>.
1
0
25 Nov '16
This is an automated email from the git hooks/post-receive script.
New commit to branch develop in repository observe.
See https://gitlab.nuiton.org/codelutin/observe.git
commit 21627b9f7346371f9eb7a846cf8169f9c3ad9b84
Author: Tony CHEMIT <chemit(a)codelutin.com>
Date: Thu Nov 10 12:12:03 2016 +0100
clean code + ne plus étendre l'arbre automatiquement
---
.../observe/application/swing/ui/ObserveMainUIHandler.java | 13 ++-----------
.../swing/ui/tree/NavigationTreeSelectionModel.java | 3 +--
.../application/swing/ui/tree/ObserveTreeHelper.java | 13 ++-----------
3 files changed, 5 insertions(+), 24 deletions(-)
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUIHandler.java
index f57b911..78fa0bc 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUIHandler.java
@@ -409,15 +409,6 @@ public class ObserveMainUIHandler {
return false;
}
- public boolean rejectMode(ObserveUIMode mode, ObserveUIMode... modes) {
- for (ObserveUIMode m : modes) {
- if (m.equals(mode)) {
- return false;
- }
- }
- return true;
- }
-
public boolean acceptLocale(Locale l, String expected) {
return l != null && l.toString().equals(expected);
}
@@ -429,7 +420,7 @@ public class ObserveMainUIHandler {
return ObserveSwingApplicationContext.get().getMainUI();
}
- protected void $afterCompleteSetup(final ObserveMainUI ui) {
+ protected void $afterCompleteSetup(ObserveMainUI ui) {
// bad binding, force value
ui.getStopH2WebServer().setEnabled(false);
@@ -473,7 +464,7 @@ public class ObserveMainUIHandler {
}
};
- ui.getTreeHelper().setUI(ui.getNavigation(), true, true, listener, veteobableTreeWillExpand);
+ ui.getTreeHelper().setUI(ui.getNavigation(), false, false, listener, veteobableTreeWillExpand);
SwingValidatorUtil.installUI(ui.getErrorTable(), new ObserveValidatorMessageTableRenderer());
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/tree/NavigationTreeSelectionModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/tree/NavigationTreeSelectionModel.java
index a2322e6..92cca8e 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/tree/NavigationTreeSelectionModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/tree/NavigationTreeSelectionModel.java
@@ -38,8 +38,7 @@ import javax.swing.tree.TreePath;
public class NavigationTreeSelectionModel extends DefaultTreeSelectionModel {
/** Logger */
- static private final Log log =
- LogFactory.getLog(NavigationTreeSelectionModel.class);
+ static private final Log log = LogFactory.getLog(NavigationTreeSelectionModel.class);
private static final long serialVersionUID = 1L;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/tree/ObserveTreeHelper.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/tree/ObserveTreeHelper.java
index 2d4204a..e2e103a 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/tree/ObserveTreeHelper.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/tree/ObserveTreeHelper.java
@@ -117,16 +117,14 @@ public class ObserveTreeHelper extends NavTreeHelper<ObserveNode> {
return null;
}
TreeCellRenderer r = t.getCellRenderer();
- return (AbstractObserveTreeCellRenderer)
- (r instanceof AbstractObserveTreeCellRenderer ? r : null);
+ return (AbstractObserveTreeCellRenderer) (r instanceof AbstractObserveTreeCellRenderer ? r : null);
}
public TreeModel createEmptyModel() {
setDataSource(null);
- ObserveNode node =
- new ObserveNode(n("observe.message.db.none.loaded"), false);
+ ObserveNode node = new ObserveNode(n("observe.message.db.none.loaded"), false);
return createModel(node);
}
@@ -577,13 +575,6 @@ public class ObserveTreeHelper extends NavTreeHelper<ObserveNode> {
@Override
protected ObserveDataProvider getDataProvider() {
- // if (provider == null) {
-// ObserveSwingDataSource source = ObserveSwingApplicationContext.get().getDataSourcesManager().getMainDataSource();
-// if (source != null) {
-// provider = new ObserveDataProvider(source);
-// setDataProvider(provider);
-// }
-// }
return (ObserveDataProvider) super.getDataProvider();
}
--
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm(a)codelutin.com>.
1
0
25 Nov '16
This is an automated email from the git hooks/post-receive script.
New commit to branch develop in repository observe.
See https://gitlab.nuiton.org/codelutin/observe.git
commit 946b44c4142e6dbe164fdaf19893c1883596e643
Author: Tony CHEMIT <chemit(a)codelutin.com>
Date: Thu Nov 10 11:56:57 2016 +0100
Ajout de raccourci clavier sur les actions des formulaires
---
.../swing/ObserveSwingApplicationContext.java | 96 +++----------
.../application/swing/ui/ObserveMainUIHandler.java | 7 -
.../ui/actions/shared/AbstractContentUIAction.java | 31 ++++
.../swing/ui/actions/shared/AbstractUIAction.java | 97 ++++++++++---
.../ui/actions/shared/CancelCreateUIAction.java | 20 ++-
.../ui/actions/shared/CloseAndCreateUIAction.java | 114 +++++++--------
.../swing/ui/actions/shared/CloseOpenUIAction.java | 158 +++++----------------
.../ui/actions/shared/DeleteDataUIAction.java | 11 +-
.../ui/actions/shared/DeleteReferenceUIAction.java | 25 ++--
.../actions/shared/DeleteTableEntryUIAction.java | 28 ++++
.../swing/ui/actions/shared/GoDownUIAction.java | 5 +-
.../swing/ui/actions/shared/GoUpUIAction.java | 5 +-
.../shared/MoveActivityLonglinesUIAction.java | 62 ++++----
.../actions/shared/MoveActivitySeinesUIAction.java | 57 ++++----
.../ui/actions/shared/MoveRoutesUIAction.java | 5 +-
.../swing/ui/actions/shared/MoveTripsUIAction.java | 5 +-
.../ui/actions/shared/NewTableEntryUIAction.java | 29 ++++
.../swing/ui/actions/shared/ReOpenUIAction.java | 50 +++----
.../swing/ui/actions/shared/ResetEditUIAction.java | 16 +--
.../ui/actions/shared/ResetTableEntryUIAction.java | 39 +++++
.../swing/ui/actions/shared/SaveEditUIAction.java | 13 +-
.../ui/actions/shared/SaveTableEntryUIAction.java | 39 +++++
.../ui/actions/shared/SelectNodeUIAction.java | 3 +-
.../ui/actions/shared/SelectOpenNodeUIAction.java | 11 +-
.../application/swing/ui/content/ContentUI.jaxx | 2 +-
.../swing/ui/content/ContentUIBlockingLayerUI.java | 113 +++++++++++++++
.../swing/ui/content/ContentUIInitializer.java | 28 +---
.../swing/ui/content/ObserveActionMap.java | 74 ++++++++++
.../swing/ui/content/open/ContentOpenableUI.jcss | 4 +
.../swing/ui/content/table/ContentTableUI.jaxx | 23 ++-
.../swing/ui/content/table/ContentTableUI.jcss | 31 ++--
.../ui/content/table/ContentTableUIHandler.java | 3 +
.../content/table/ContentTableUIInitializer.java | 9 +-
33 files changed, 726 insertions(+), 487 deletions(-)
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ObserveSwingApplicationContext.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ObserveSwingApplicationContext.java
index 1ed8e6b..9162cbc 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ObserveSwingApplicationContext.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ObserveSwingApplicationContext.java
@@ -28,24 +28,7 @@ import fr.ird.observe.application.swing.configuration.ObserveSwingApplicationCon
import fr.ird.observe.application.swing.db.DataContext;
import fr.ird.observe.application.swing.decoration.DecoratorService;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
-import fr.ird.observe.application.swing.ui.actions.shared.AbstractUIAction;
-import fr.ird.observe.application.swing.ui.actions.shared.CancelCreateUIAction;
-import fr.ird.observe.application.swing.ui.actions.shared.CloseAndCreateUIAction;
-import fr.ird.observe.application.swing.ui.actions.shared.CloseOpenUIAction;
-import fr.ird.observe.application.swing.ui.actions.shared.DeleteDataUIAction;
-import fr.ird.observe.application.swing.ui.actions.shared.DeleteReferenceUIAction;
-import fr.ird.observe.application.swing.ui.actions.shared.GoDownUIAction;
-import fr.ird.observe.application.swing.ui.actions.shared.GoUpUIAction;
-import fr.ird.observe.application.swing.ui.actions.shared.MoveActivityLonglinesUIAction;
-import fr.ird.observe.application.swing.ui.actions.shared.MoveActivitySeinesUIAction;
-import fr.ird.observe.application.swing.ui.actions.shared.MoveRoutesUIAction;
-import fr.ird.observe.application.swing.ui.actions.shared.MoveTripLonglinesUIAction;
-import fr.ird.observe.application.swing.ui.actions.shared.MoveTripSeinesUIAction;
-import fr.ird.observe.application.swing.ui.actions.shared.ReOpenUIAction;
-import fr.ird.observe.application.swing.ui.actions.shared.ResetEditUIAction;
-import fr.ird.observe.application.swing.ui.actions.shared.SaveEditUIAction;
-import fr.ird.observe.application.swing.ui.actions.shared.SelectNodeUIAction;
-import fr.ird.observe.application.swing.ui.actions.shared.SelectOpenNodeUIAction;
+import fr.ird.observe.application.swing.ui.content.ObserveActionMap;
import fr.ird.observe.application.swing.ui.content.ContentUIManager;
import fr.ird.observe.application.swing.ui.content.ObserveFocusManager;
import fr.ird.observe.application.swing.validation.ValidationContext;
@@ -63,7 +46,6 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.h2.tools.Server;
-import javax.swing.ActionMap;
import java.io.Closeable;
import java.io.IOException;
import java.util.Arrays;
@@ -131,7 +113,7 @@ public class ObserveSwingApplicationContext extends DefaultApplicationContext im
VALIDATION_CONTEXT("Validation context", ValidationContext.class),
MAIN_UI("Main UI", ObserveMainUI.class),
ACTIONS("Command line Actions", ObserveCLAction.class),
- ACTION_MAP("UI Actions", ActionMap.class),
+ ACTION_MAP("UI Actions", ObserveActionMap.class),
H2_SERVER_MODE("H2 Server mode", Boolean.class),
H2_SERVER("H2 Server", Server.class),
H2_WEBSERVER("H2 Web server", Server.class),
@@ -184,13 +166,6 @@ public class ObserveSwingApplicationContext extends DefaultApplicationContext im
private boolean closed;
/**
- * Un drapeau pour activer sur les connections le support JMX.
- *
- * @since 2.2
- */
- private boolean useJMX;
-
- /**
* Récupération du contexte applicatif.
*
* @return l'instance partagé du contexte.
@@ -238,10 +213,6 @@ public class ObserveSwingApplicationContext extends DefaultApplicationContext im
// - Read
//-------------------------------------------
- public boolean isUseJMX() {
- return useJMX;
- }
-
/**
* @return {@code true} si le context applicatif a été fermé (et est donc
* passé dans la méthode {@link #close()}, {@code false} autrement.
@@ -306,7 +277,7 @@ public class ObserveSwingApplicationContext extends DefaultApplicationContext im
return NODE_TO_RESELECT.get();
}
- public ActionMap getActionMap() {
+ public ObserveActionMap getActionMap() {
return ACTION_MAP.get();
}
@@ -338,10 +309,6 @@ public class ObserveSwingApplicationContext extends DefaultApplicationContext im
// - Write
//-------------------------------------------
- public void setUseJMX(boolean useJMX) {
- this.useJMX = useJMX;
- }
-
public void setNodesToReselect(String[] paths) {
if (paths == null) {
NODE_TO_RESELECT.remove();
@@ -361,6 +328,12 @@ public class ObserveSwingApplicationContext extends DefaultApplicationContext im
public void setMainUI(ObserveMainUI ui) {
MAIN_UI.set(ui);
+
+ ObserveActionMap actionMap = new ObserveActionMap(ui);
+ ui.getRootPane().setActionMap(actionMap);
+
+ ACTION_MAP.set(actionMap);
+
}
public void removeMainUI() {
@@ -371,34 +344,6 @@ public class ObserveSwingApplicationContext extends DefaultApplicationContext im
H2_SERVER_MODE.remove();
}
-
- public void registerShareActions() {
-
- ObserveMainUI ui = getMainUI();
- ActionMap actionMap = ui.getRootPane().getActionMap();
-
- ACTION_MAP.set(actionMap);
-
- registerMainAction(actionMap, new SelectOpenNodeUIAction(ui));
- registerMainAction(actionMap, new SelectNodeUIAction(ui));
- registerMainAction(actionMap, new GoUpUIAction(ui));
- registerMainAction(actionMap, new GoDownUIAction(ui));
- registerMainAction(actionMap, new ReOpenUIAction(ui));
- registerMainAction(actionMap, new CloseOpenUIAction(ui));
- registerMainAction(actionMap, new CloseAndCreateUIAction(ui));
- registerMainAction(actionMap, new CancelCreateUIAction(ui));
- registerMainAction(actionMap, new ResetEditUIAction(ui));
- registerMainAction(actionMap, new SaveEditUIAction(ui));
- registerMainAction(actionMap, new DeleteDataUIAction(ui));
- registerMainAction(actionMap, new DeleteReferenceUIAction(ui));
- registerMainAction(actionMap, new MoveTripLonglinesUIAction(ui));
- registerMainAction(actionMap, new MoveTripSeinesUIAction(ui));
- registerMainAction(actionMap, new MoveRoutesUIAction(ui));
- registerMainAction(actionMap, new MoveActivitySeinesUIAction(ui));
- registerMainAction(actionMap, new MoveActivityLonglinesUIAction(ui));
-
- }
-
//-------------------------------------------
// - Locks
//-------------------------------------------
@@ -469,21 +414,12 @@ public class ObserveSwingApplicationContext extends DefaultApplicationContext im
super.finalize();
}
- private void registerMainAction(ActionMap actionMap, AbstractUIAction action) {
- String actionId = action.getActionId();
- if (log.isInfoEnabled()) {
- log.info("Register UI action " + actionId);
- }
- actionMap.put(actionId, action);
- }
-
-// private ObjectName createMBean(DataSource source) throws MalformedObjectNameException {
-// Hashtable<String, String> tb = new Hashtable<String, String>();
-// tb.put("type", "statistics");
-// String name = source.getLabel();
-// tb.put("sessionFactory", name.replaceAll(":", "_"));
-// // MBean object name
-// ObjectName on = new ObjectName("hibernate", tb);
-// return on;
+// private void registerMainAction(ActionMap actionMap, AbstractUIAction action) {
+// String actionId = action.getActionId();
+// if (log.isInfoEnabled()) {
+// log.info("Register UI action " + actionId);
+// }
+// actionMap.put(actionId, action);
// }
+
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUIHandler.java
index b5e3d9c..f57b911 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUIHandler.java
@@ -242,13 +242,6 @@ public class ObserveMainUIHandler {
// set fullscreen propery on main ui
ui.getGraphicsConfiguration().getDevice().setFullScreenWindow(config.isFullScreen() ? ui : null);
- // on enregistre les actions communes à toutes les écrans d'édition
- // les bouttons utilisant ces actions seront automatiquement
- // chargés (à partir des actions) lors de l'ouverture des ui
- // et mis à jour
-
- context.registerShareActions();
-
new ObserveNavigationTreeShowPopupAction(treeHelper, ui.getNavigationScrollPane(), ui.getNavigationPopup());
return ui;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/AbstractContentUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/AbstractContentUIAction.java
new file mode 100644
index 0000000..309f5eb
--- /dev/null
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/AbstractContentUIAction.java
@@ -0,0 +1,31 @@
+package fr.ird.observe.application.swing.ui.actions.shared;
+
+import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.content.ContentUI;
+
+import java.awt.event.ActionEvent;
+
+/**
+ * Created on 10/11/16.
+ *
+ * @author Tony Chemit - chemit(a)codelutin.com
+ * @since 5.1
+ */
+public abstract class AbstractContentUIAction extends AbstractUIAction {
+
+
+ public AbstractContentUIAction(ObserveMainUI mainUI, String actionCommandKey, String label, String shortDescription, String actionIcon, String acceleratorKey) {
+ super(mainUI, actionCommandKey, label, shortDescription, actionIcon, acceleratorKey);
+ }
+
+ protected abstract void actionPerformed(ContentUI<?, ?> contentUI);
+
+ @Override
+ public final void actionPerformed(ActionEvent e) {
+ if (!canExecuteAction(e)) {
+ return;
+ }
+ ContentUI<?, ?> contentUI = getContentUI(e);
+ actionPerformed(contentUI);
+ }
+}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/AbstractUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/AbstractUIAction.java
index ea9f4cd..99fa5f1 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/AbstractUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/AbstractUIAction.java
@@ -27,6 +27,8 @@ import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper;
import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import jaxx.runtime.SwingUtil;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import javax.swing.AbstractAction;
import javax.swing.AbstractButton;
@@ -34,6 +36,7 @@ import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JPopupMenu;
import javax.swing.JTree;
+import javax.swing.KeyStroke;
import javax.swing.tree.TreePath;
import java.awt.event.ActionEvent;
import java.util.Objects;
@@ -50,42 +53,80 @@ public abstract class AbstractUIAction extends AbstractAction {
private static final long serialVersionUID = 1L;
- private final ObserveMainUI mainUI;
+ /** Logger */
+ private static final Log log = LogFactory.getLog(AbstractUIAction.class);
+
+ public static final String EDITOR = "editor";
- private final String actionId;
+ private final ObserveMainUI mainUI;
public AbstractUIAction(ObserveMainUI mainUI,
- String actionId,
+ String actionCommandKey,
String label,
String shortDescription,
- String actionIcon) {
+ String actionIcon,
+ String acceleratorKey) {
super(t(label), SwingUtil.getUIManagerActionIcon(actionIcon));
- this.actionId = actionId;
+ putValue(ACTION_COMMAND_KEY, actionCommandKey);
this.mainUI = mainUI;
- putValue(SHORT_DESCRIPTION, t(shortDescription));
+ if (acceleratorKey != null) {
+
+ KeyStroke keyStroke = KeyStroke.getKeyStroke(acceleratorKey);
+ Objects.requireNonNull(keyStroke, "KeyStroke invalide: " + acceleratorKey);
+ putValue(ACCELERATOR_KEY, keyStroke);
+
+ String acceleratorStr = " (" + keyStroke.toString().replace(" pressed ", " + ") + ")";
+
+ putValue(NAME, t(label) + acceleratorStr);
+ putValue(SHORT_DESCRIPTION, t(shortDescription) + acceleratorStr);
+ } else {
+
+ putValue(SHORT_DESCRIPTION, t(shortDescription));
+ }
}
- public ObserveMainUI getMainUI() {
- return mainUI;
+ public KeyStroke getAcceleratorKey() {
+ return (KeyStroke) getValue(ACCELERATOR_KEY);
}
- public String getActionId() {
- return actionId;
+ public String getActionCommandKey() {
+ return (String) getValue(ACTION_COMMAND_KEY);
+ }
+
+ public ObserveMainUI getMainUI() {
+ return mainUI;
}
public void initAction(ContentUI<?, ?> ui, AbstractButton editor) {
editor.setAction(this);
- editor.putClientProperty("mainUI", mainUI);
+ editor.putClientProperty("ui", ui);
+ putValue(EDITOR, editor);
+ KeyStroke keyStroke = getAcceleratorKey();
+ if (keyStroke != null) {
+ String actionCommandKey = getActionCommandKey();
+// ui.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(keyStroke, actionCommandKey);
+ ui.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(keyStroke, actionCommandKey);
+ ui.getActionMap().put(actionCommandKey, this);
+ }
}
public void updateAction(ContentUI<?, ?> ui, AbstractButton editor) {
- editor.putClientProperty("ui", ui);
String tip = (String) editor.getClientProperty("toolTipText");
if (tip != null) {
+ KeyStroke keyStroke = getAcceleratorKey();
+ if (keyStroke != null) {
+ String acceleratorStr = " (" + keyStroke.toString().replace(" pressed ", " + ") + ")";
+ tip += acceleratorStr;
+ }
editor.setToolTipText(tip);
}
String text = (String) editor.getClientProperty("text");
if (text != null) {
+ KeyStroke keyStroke = getAcceleratorKey();
+ if (keyStroke != null) {
+ String acceleratorStr = " (" + keyStroke.toString().replace(" pressed ", " + ") + ")";
+ text += acceleratorStr;
+ }
editor.setText(text);
}
String actionIcon = (String) editor.getClientProperty("actionIcon");
@@ -95,9 +136,23 @@ public abstract class AbstractUIAction extends AbstractAction {
}
}
- public static boolean isOpenActivityNodeCollapsed(JTree tree,
- ObserveTreeHelper treeHelper,
- DataContext dataContext) {
+
+ protected boolean canExecuteAction(ActionEvent e) {
+ JComponent editor = getEditor();
+ if (!(editor.isVisible() && editor.isEnabled())) {
+ if (log.isInfoEnabled()) {
+ log.info("Disabled action: " + getActionCommandKey() + " :: " + this);
+ }
+ return false;
+ }
+ return true;
+ }
+
+ private JComponent getEditor() {
+ return (JComponent) getValue(EDITOR);
+ }
+
+ public static boolean isOpenActivityNodeCollapsed(JTree tree, ObserveTreeHelper treeHelper, DataContext dataContext) {
// on regarde si le noeud de l'activity ouverte est collapsé
@@ -114,10 +169,17 @@ public abstract class AbstractUIAction extends AbstractAction {
return tree.isCollapsed(activityPath);
}
-
protected ContentUI<?, ?> getContentUI(ActionEvent e) {
JComponent c = (JComponent) e.getSource();
- ContentUI<?, ?> ui = (ContentUI<?, ?>) c.getClientProperty("ui");
+ ContentUI<?, ?> ui;
+
+ if (c instanceof ContentUI) {
+ ui = (ContentUI<?, ?>) c;
+ } else if (c.getParent() instanceof ContentUI) {
+ ui = (ContentUI<?, ?>) c.getParent();
+ } else {
+ ui = (ContentUI<?, ?>) c.getClientProperty("ui");
+ }
Objects.requireNonNull(ui, "could not find client property ui on component" + c);
return ui;
}
@@ -128,5 +190,4 @@ public abstract class AbstractUIAction extends AbstractAction {
Objects.requireNonNull(ui, "could not find client property popup on component" + c);
return ui;
}
-
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CancelCreateUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CancelCreateUIAction.java
index 3bf739c..5fa99df 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CancelCreateUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CancelCreateUIAction.java
@@ -25,9 +25,6 @@ import fr.ird.observe.application.swing.ui.ObserveMainUI;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
-import javax.swing.SwingUtilities;
-import java.awt.event.ActionEvent;
-
import static org.nuiton.i18n.I18n.n;
/**
@@ -37,7 +34,7 @@ import static org.nuiton.i18n.I18n.n;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.4
*/
-public class CancelCreateUIAction extends AbstractUIAction {
+public class CancelCreateUIAction extends AbstractContentUIAction {
private static final long serialVersionUID = 1L;
@@ -48,17 +45,16 @@ public class CancelCreateUIAction extends AbstractUIAction {
ACTION_NAME,
n("observe.action.cancel"),
n("observe.action.cancel.create.tip"),
- "cancel"
+ "cancel",
+ "ctrl pressed R"
);
}
@Override
- public void actionPerformed(final ActionEvent e) {
- SwingUtilities.invokeLater(() -> {
- ContentUI<?, ?> ui = getContentUI(e);
- ui.stopEdit();
- ObserveNode parentNode = ui.getTreeHelper().removeNode(ui.getTreeHelper().getSelectedNode());
- ui.getTreeHelper().selectNode(parentNode);
- });
+ protected void actionPerformed(ContentUI<?, ?> ui) {
+ ui.stopEdit();
+ ObserveNode parentNode = ui.getTreeHelper().removeNode(ui.getTreeHelper().getSelectedNode());
+ ui.getTreeHelper().selectNode(parentNode);
}
+
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseAndCreateUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseAndCreateUIAction.java
index f26a4af..90b9118 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseAndCreateUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseAndCreateUIAction.java
@@ -34,9 +34,7 @@ import fr.ird.observe.services.dto.longline.ActivityLonglineDto;
import fr.ird.observe.services.dto.seine.ActivitySeineDto;
import javax.swing.JTree;
-import javax.swing.SwingUtilities;
import javax.swing.tree.TreePath;
-import java.awt.event.ActionEvent;
import static org.nuiton.i18n.I18n.n;
@@ -46,7 +44,7 @@ import static org.nuiton.i18n.I18n.n;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.5
*/
-public class CloseAndCreateUIAction extends AbstractUIAction {
+public class CloseAndCreateUIAction extends AbstractContentUIAction {
private static final long serialVersionUID = 1L;
@@ -57,90 +55,88 @@ public class CloseAndCreateUIAction extends AbstractUIAction {
ACTION_NAME,
n("observe.content.action.closeAndCreate"),
n("observe.content.action.closeAndCreate.tip"),
- "add"
+ "add",
+ "ctrl pressed N"
);
}
@Override
- public void actionPerformed(final ActionEvent e) {
+ protected void actionPerformed(ContentUI<?, ?> ui) {
- SwingUtilities.invokeLater(() -> {
- ContentUI<?, ?> ui = getContentUI(e);
+ if (ui instanceof ContentOpenableUI) {
+ ((ContentOpenableUI<?, ?>) ui).closeAndCreateData();
+ return;
+ }
- if (ui instanceof ContentOpenableUI) {
- ((ContentOpenableUI<?, ?>) ui).closeAndCreateData();
- return;
- }
-
- if (ui instanceof ActivitySeinesUI) {
-
- // cas particulier pour l'écran des activitys
+ if (ui instanceof ActivitySeinesUI) {
- JTree tree = getMainUI().getNavigation();
- ObserveTreeHelper treeHelper = getMainUI().getTreeHelper();
+ // cas particulier pour l'écran des activitys
- boolean wasCollapsed = isOpenActivityNodeCollapsed(tree, treeHelper, getMainUI().getDataContext());
+ JTree tree = getMainUI().getNavigation();
+ ObserveTreeHelper treeHelper = getMainUI().getTreeHelper();
- // selection du noeud de l'activity ouverte
- treeHelper.selectOpenNode(ActivitySeineDto.class);
+ boolean wasCollapsed = isOpenActivityNodeCollapsed(tree, treeHelper, getMainUI().getDataContext());
- // on conserve le path de l'activity
- TreePath path = tree.getSelectionPath();
+ // selection du noeud de l'activity ouverte
+ treeHelper.selectOpenNode(ActivitySeineDto.class);
- // recuperation de l'écran associé
- ActivitySeineUI selectedUI = (ActivitySeineUI)
- ObserveSwingApplicationContext.get().getContentUIManager().getSelectedContentUI();
+ // on conserve le path de l'activity
+ TreePath path = tree.getSelectionPath();
- // fermeture de l'activity et création d'une nouvelle
- selectedUI.closeAndCreateData();
+ // recuperation de l'écran associé
+ ActivitySeineUI selectedUI = (ActivitySeineUI)
+ ObserveSwingApplicationContext.get().getContentUIManager().getSelectedContentUI();
- if (wasCollapsed) {
+ // fermeture de l'activity et création d'une nouvelle
+ selectedUI.closeAndCreateData();
- // on ferme le noeud de l'activity (qui a ete ouvert
- // lors de la selection de celle-ci)
- tree.collapsePath(path);
- }
+ if (wasCollapsed) {
- return;
+ // on ferme le noeud de l'activity (qui a ete ouvert
+ // lors de la selection de celle-ci)
+ tree.collapsePath(path);
}
- if (ui instanceof ActivityLonglinesUI) {
+ return;
+ }
- // cas particulier pour l'écran des activitys
+ if (ui instanceof ActivityLonglinesUI) {
- JTree tree = getMainUI().getNavigation();
- ObserveTreeHelper treeHelper = getMainUI().getTreeHelper();
+ // cas particulier pour l'écran des activitys
- boolean wasCollapsed = isOpenActivityNodeCollapsed(
- tree,
- treeHelper,
- getMainUI().getDataContext()
- );
+ JTree tree = getMainUI().getNavigation();
+ ObserveTreeHelper treeHelper = getMainUI().getTreeHelper();
- // selection du noeud de l'activity ouverte
- treeHelper.selectOpenNode(ActivityLonglineDto.class);
+ boolean wasCollapsed = isOpenActivityNodeCollapsed(
+ tree,
+ treeHelper,
+ getMainUI().getDataContext()
+ );
- // on conserve le path de l'activity
- TreePath path = tree.getSelectionPath();
+ // selection du noeud de l'activity ouverte
+ treeHelper.selectOpenNode(ActivityLonglineDto.class);
- // recuperation de l'écran associé
- ActivityLonglineUI selectedUI = (ActivityLonglineUI)
- ObserveSwingApplicationContext.get().getContentUIManager().getSelectedContentUI();
+ // on conserve le path de l'activity
+ TreePath path = tree.getSelectionPath();
- // fermeture de l'activity et création d'une nouvelle
- selectedUI.closeAndCreateData();
+ // recuperation de l'écran associé
+ ActivityLonglineUI selectedUI = (ActivityLonglineUI)
+ ObserveSwingApplicationContext.get().getContentUIManager().getSelectedContentUI();
- if (wasCollapsed) {
+ // fermeture de l'activity et création d'une nouvelle
+ selectedUI.closeAndCreateData();
- // on ferme le noeud de l'activity (qui a ete ouvert
- // lors de la selection de celle-ci)
- tree.collapsePath(path);
- }
+ if (wasCollapsed) {
- return;
+ // on ferme le noeud de l'activity (qui a ete ouvert
+ // lors de la selection de celle-ci)
+ tree.collapsePath(path);
}
- throw new IllegalStateException("Can not come here!");
- });
+ return;
+ }
+
+ throw new IllegalStateException("Can not come here!");
}
+
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseOpenUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseOpenUIAction.java
index fbdab1d..dd838ac 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseOpenUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseOpenUIAction.java
@@ -34,7 +34,6 @@ import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper;
import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import javax.swing.SwingUtilities;
-import java.awt.event.ActionEvent;
import static org.nuiton.i18n.I18n.n;
@@ -44,7 +43,7 @@ import static org.nuiton.i18n.I18n.n;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.4
*/
-public class CloseOpenUIAction extends AbstractUIAction {
+public class CloseOpenUIAction extends AbstractContentUIAction {
private static final long serialVersionUID = 1L;
@@ -55,127 +54,48 @@ public class CloseOpenUIAction extends AbstractUIAction {
ACTION_NAME,
n("observe.action.close.open"),
n("observe.action.close.open.tip"),
- "close"
+ "close",
+ "ctrl pressed C"
);
}
@Override
- public void actionPerformed(final ActionEvent e) {
-
- SwingUtilities.invokeLater(() -> {
- ContentUI<?, ?> ui = getContentUI(e);
-
- if (ui instanceof ContentOpenableUI) {
- ((ContentOpenableUI<?, ?>) ui).closeData();
- return;
- }
-
- ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get();
-
- if (ui instanceof TripSeinesUI) {
- String higherOpenId = applicationContext.getDataContext().getOpenTripSeineId();
- closeData(applicationContext, ui, higherOpenId);
- return;
- }
- if (ui instanceof RoutesUI) {
- String higherOpenId = applicationContext.getDataContext().getOpenRouteId();
- closeData(applicationContext, ui, higherOpenId);
- return;
- }
- if (ui instanceof ActivitySeinesUI) {
- String higherOpenId = applicationContext.getDataContext().getOpenActivitySeineId();
- closeData(applicationContext, ui, higherOpenId);
- return;
- }
-
- if (ui instanceof TripLonglinesUI) {
- String higherOpenId = applicationContext.getDataContext().getOpenTripLonglineId();
- closeData(applicationContext, ui, higherOpenId);
- return;
- }
- if (ui instanceof ActivityLonglinesUI) {
- String higherOpenId = applicationContext.getDataContext().getOpenActivityLonglineId();
- closeData(applicationContext, ui, higherOpenId);
- return;
- }
-
-// if (ui instanceof ActivitySeinesUI) {
-//
-// // cas particulier pour l'écran des activités
-//
-// JTree tree = getMainUI().getNavigation();
-// ObserveTreeHelper treeHelper = getMainUI().getTreeHelper();
-//
-// // recuperation du noeud courant (activitys)
-// ObserveNode node = treeHelper.getSelectedNode();
-//
-// boolean wasCollapsed = isOpenActivityNodeCollapsed(tree, treeHelper, getMainUI().getDataContext());
-//
-// // selection du noeud de l'activity ouverte
-// treeHelper.selectOpenNode(ActivitySeineDto.class);
-//
-// // on conserve le path de l'activity
-// TreePath path = tree.getSelectionPath();
-//
-// // recuperation de l'écran associé
-// ActivitySeineUI selectedUI = (ActivitySeineUI)
-// applicationContext.getContentUIManager().getSelectedContentUI();
-//
-// // fermeture de l'activity
-// selectedUI.closeData();
-//
-// if (wasCollapsed) {
-//
-// // on ferme le noeud de l'activity (qui a ete ouvert
-// // lors de la selection de celle-ci)
-// tree.collapsePath(path);
-// }
-//
-// // retour sur le noeud des activitys
-// treeHelper.selectNode(node);
-//
-// return;
-// }
-//
-// if (ui instanceof ActivityLonglinesUI) {
-//
-// // cas particulier pour l'écran des activités
-//
-// JTree tree = getMainUI().getNavigation();
-// ObserveTreeHelper treeHelper = getMainUI().getTreeHelper();
-//
-// // recuperation du noeud courant (activitys)
-// ObserveNode node = treeHelper.getSelectedNode();
-//
-// boolean wasCollapsed = isOpenActivityNodeCollapsed(tree, treeHelper, getMainUI().getDataContext());
-//
-// // selection du noeud de l'activity ouverte
-// treeHelper.selectOpenNode(ActivityLonglineDto.class);
-//
-// // on conserve le path de l'activité
-// TreePath path = tree.getSelectionPath();
-//
-// // recuperation de l'écran associé
-// ActivityLonglineUI selectedUI = (ActivityLonglineUI)
-// applicationContext.getContentUIManager().getSelectedContentUI();
-//
-// // fermeture de l'activité
-// selectedUI.closeData();
-//
-// if (wasCollapsed) {
-//
-// // on ferme le noeud de l'activité (qui a ete ouvert lors de la selection de celle-ci)
-// tree.collapsePath(path);
-// }
-//
-// // retour sur le noeud des activités
-// treeHelper.selectNode(node);
-//
-// return;
-// }
-
- throw new IllegalStateException("Can not come here!");
- });
+ protected void actionPerformed(ContentUI<?, ?> ui) {
+ if (ui instanceof ContentOpenableUI) {
+ ((ContentOpenableUI<?, ?>) ui).closeData();
+ return;
+ }
+
+ ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get();
+
+ if (ui instanceof TripSeinesUI) {
+ String higherOpenId = applicationContext.getDataContext().getOpenTripSeineId();
+ closeData(applicationContext, ui, higherOpenId);
+ return;
+ }
+ if (ui instanceof RoutesUI) {
+ String higherOpenId = applicationContext.getDataContext().getOpenRouteId();
+ closeData(applicationContext, ui, higherOpenId);
+ return;
+ }
+ if (ui instanceof ActivitySeinesUI) {
+ String higherOpenId = applicationContext.getDataContext().getOpenActivitySeineId();
+ closeData(applicationContext, ui, higherOpenId);
+ return;
+ }
+
+ if (ui instanceof TripLonglinesUI) {
+ String higherOpenId = applicationContext.getDataContext().getOpenTripLonglineId();
+ closeData(applicationContext, ui, higherOpenId);
+ return;
+ }
+ if (ui instanceof ActivityLonglinesUI) {
+ String higherOpenId = applicationContext.getDataContext().getOpenActivityLonglineId();
+ closeData(applicationContext, ui, higherOpenId);
+ return;
+ }
+
+ throw new IllegalStateException("Can not come here!");
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteDataUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteDataUIAction.java
index 9f49e16..29f16b0 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteDataUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteDataUIAction.java
@@ -25,7 +25,6 @@ import fr.ird.observe.application.swing.ui.ObserveMainUI;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import javax.swing.SwingUtilities;
-import java.awt.event.ActionEvent;
import static org.nuiton.i18n.I18n.n;
@@ -36,7 +35,7 @@ import static org.nuiton.i18n.I18n.n;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.4
*/
-public class DeleteDataUIAction extends AbstractUIAction {
+public class DeleteDataUIAction extends AbstractContentUIAction {
private static final long serialVersionUID = 1L;
@@ -47,23 +46,23 @@ public class DeleteDataUIAction extends AbstractUIAction {
ACTION_NAME,
n("observe.action.delete"),
n("observe.action.delete.tip"),
- "delete"
+ "delete",
+ "ctrl pressed X"
);
}
@Override
- public void actionPerformed(final ActionEvent e) {
-
+ protected void actionPerformed(ContentUI<?, ?> contentUI) {
getMainUI().setBusy(true);
SwingUtilities.invokeLater(() -> {
try {
- ContentUI<?, ?> contentUI = getContentUI(e);
contentUI.delete();
} finally {
getMainUI().setBusy(false);
}
});
+
}
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteReferenceUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteReferenceUIAction.java
index 4733b95..6d1eac7 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteReferenceUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteReferenceUIAction.java
@@ -24,9 +24,6 @@ package fr.ird.observe.application.swing.ui.actions.shared;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
import fr.ird.observe.application.swing.ui.content.ContentUI;
-import javax.swing.SwingUtilities;
-import java.awt.event.ActionEvent;
-
import static org.nuiton.i18n.I18n.n;
/**
@@ -36,7 +33,7 @@ import static org.nuiton.i18n.I18n.n;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.4
*/
-public class DeleteReferenceUIAction extends AbstractUIAction {
+public class DeleteReferenceUIAction extends AbstractContentUIAction {
private static final long serialVersionUID = 1L;
@@ -47,19 +44,19 @@ public class DeleteReferenceUIAction extends AbstractUIAction {
ACTION_NAME,
n("observe.action.delete"),
n("observe.action.delete.tip"),
- "delete"
+ "delete",
+ "ctrl pressed X"
);
}
@Override
- public void actionPerformed(final ActionEvent e) {
- SwingUtilities.invokeLater(() -> {
- try {
- ContentUI<?, ?> ui = getContentUI(e);
- ui.delete();
- } finally {
- getMainUI().setBusy(false);
- }
- });
+ protected void actionPerformed(ContentUI<?, ?> ui) {
+ getMainUI().setBusy(true);
+ try {
+ ui.delete();
+ } finally {
+ getMainUI().setBusy(false);
+ }
}
+
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteTableEntryUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteTableEntryUIAction.java
new file mode 100644
index 0000000..ab78e22
--- /dev/null
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteTableEntryUIAction.java
@@ -0,0 +1,28 @@
+package fr.ird.observe.application.swing.ui.actions.shared;
+
+import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.content.ContentUI;
+import fr.ird.observe.application.swing.ui.content.table.ContentTableUI;
+
+/**
+ * Created on 10/11/16.
+ *
+ * @author Tony Chemit - chemit(a)codelutin.com
+ * @since 5.1
+ */
+public class DeleteTableEntryUIAction extends AbstractContentUIAction {
+
+ public static final String ACTION_NAME = "deleteTableEntry";
+
+ public DeleteTableEntryUIAction(ObserveMainUI mainUI) {
+ super(mainUI, ACTION_NAME, "", "", "delete", "ctrl pressed X");
+ }
+
+ @Override
+ protected void actionPerformed(ContentUI<?, ?> ui) {
+
+ ContentTableUI<?, ?, ?> contentUI = (ContentTableUI<?, ?, ?>) ui;
+ contentUI.getHandler().removeSelectedRow(contentUI.getTableModel().getSelectedRow());
+
+ }
+}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/GoDownUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/GoDownUIAction.java
index 7fa5a03..4220ac5 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/GoDownUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/GoDownUIAction.java
@@ -58,12 +58,13 @@ public class GoDownUIAction extends AbstractUIAction {
ACTION_NAME,
n("observe.action.goDown"),
n("observe.action.goDown.tip"),
- "go-down"
+ "go-down",
+ null
);
}
@Override
- public void actionPerformed(final ActionEvent e) {
+ public void actionPerformed(ActionEvent e) {
SwingUtilities.invokeLater(() -> {
JComponent c = (JComponent) e.getSource();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/GoUpUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/GoUpUIAction.java
index 13624d4..db7b648 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/GoUpUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/GoUpUIAction.java
@@ -59,12 +59,13 @@ public class GoUpUIAction extends AbstractUIAction {
ACTION_NAME,
n("observe.action.goUp"),
n("observe.action.goUp.tip"),
- "go-up"
+ "go-up",
+ null
);
}
@Override
- public void actionPerformed(final ActionEvent e) {
+ public void actionPerformed(ActionEvent e) {
SwingUtilities.invokeLater(() -> {
JComponent c = (JComponent) e.getSource();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveActivityLonglinesUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveActivityLonglinesUIAction.java
index 7976691..796ec5f 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveActivityLonglinesUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveActivityLonglinesUIAction.java
@@ -40,8 +40,6 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.swing.JOptionPane;
-import javax.swing.SwingUtilities;
-import java.awt.event.ActionEvent;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
@@ -55,7 +53,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Kevin Morin (Code Lutin)
* @since 5.0
*/
-public class MoveActivityLonglinesUIAction extends AbstractUIAction {
+public class MoveActivityLonglinesUIAction extends AbstractContentUIAction {
private static final long serialVersionUID = 1L;
@@ -71,48 +69,44 @@ public class MoveActivityLonglinesUIAction extends AbstractUIAction {
ACTION_NAME,
n("observe.content.action.move.activities.longline"),
n("observe.content.action.move.activities.longline.tip"),
- "move-activities"
+ "move-activities",
+ null
);
}
@Override
- public void actionPerformed(final ActionEvent e) {
-
- SwingUtilities.invokeLater(() -> {
- ContentUI<?, ?> ui = getContentUI(e);
- if (!(ui instanceof ActivityLonglinesUI)) {
- throw new IllegalStateException("Can not come here!");
- }
- ActivityLonglinesUI activityLonglinesUI = (ActivityLonglinesUI) ui;
-
+ protected void actionPerformed(ContentUI<?, ?> ui) {
+ if (!(ui instanceof ActivityLonglinesUI)) {
+ throw new IllegalStateException("Can not come here!");
+ }
+ ActivityLonglinesUI activityLonglinesUI = (ActivityLonglinesUI) ui;
- // get current triplongline id
- ObserveTreeHelper treeHelper = getMainUI().getTreeHelper();
- ObserveNode oldActivitiesNode = treeHelper.getSelectedNode();
- ObserveNode oldTripLonglineNode = oldActivitiesNode.getParent();
- // choose the new tripLongline
- String tripLonglineId = chooseNewTripLongline(ui, oldTripLonglineNode);
+ // get current triplongline id
+ ObserveTreeHelper treeHelper = getMainUI().getTreeHelper();
+ ObserveNode oldActivitiesNode = treeHelper.getSelectedNode();
+ ObserveNode oldTripLonglineNode = oldActivitiesNode.getParent();
- if (tripLonglineId != null) {
+ // choose the new tripLongline
+ String tripLonglineId = chooseNewTripLongline(ui, oldTripLonglineNode);
- if (log.isInfoEnabled()) {
- log.info("Will move activities to trip: " + tripLonglineId);
- }
- // change the tripLongline of the selected activities
- List<DataReference<ActivityLonglineDto>> selectedDatas = activityLonglinesUI.getModel().getSelectedDatas();
- List<String> activityIds = selectedDatas.stream()
- .map(DataReference.ID_FUNCTION)
- .collect(Collectors.toList());
- ActivityLonglineService service = ObserveSwingApplicationContext.get().getMainDataSourceServicesProvider().newActivityLonglineService();
-// List<Integer> positions =
- service.moveActivityLonglinesToTripLongline(activityIds, tripLonglineId);
+ if (tripLonglineId != null) {
- // update the tree
- updateTree(oldActivitiesNode, tripLonglineId, activityIds);
+ if (log.isInfoEnabled()) {
+ log.info("Will move activities to trip: " + tripLonglineId);
}
+ // change the tripLongline of the selected activities
+ List<DataReference<ActivityLonglineDto>> selectedDatas = activityLonglinesUI.getModel().getSelectedDatas();
+ List<String> activityIds = selectedDatas.stream()
+ .map(DataReference.ID_FUNCTION)
+ .collect(Collectors.toList());
+ ActivityLonglineService service = ObserveSwingApplicationContext.get().getMainDataSourceServicesProvider().newActivityLonglineService();
+// List<Integer> positions =
+ service.moveActivityLonglinesToTripLongline(activityIds, tripLonglineId);
- });
+ // update the tree
+ updateTree(oldActivitiesNode, tripLonglineId, activityIds);
+ }
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveActivitySeinesUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveActivitySeinesUIAction.java
index 622cff2..dca5e7d 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveActivitySeinesUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveActivitySeinesUIAction.java
@@ -39,8 +39,6 @@ import fr.ird.observe.services.dto.seine.RouteDto;
import fr.ird.observe.services.service.data.seine.ActivitySeineService;
import javax.swing.JOptionPane;
-import javax.swing.SwingUtilities;
-import java.awt.event.ActionEvent;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
@@ -54,7 +52,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Kevin Morin (Code Lutin)
* @since 5.0
*/
-public class MoveActivitySeinesUIAction extends AbstractUIAction {
+public class MoveActivitySeinesUIAction extends AbstractContentUIAction {
private static final long serialVersionUID = 1L;
@@ -65,42 +63,39 @@ public class MoveActivitySeinesUIAction extends AbstractUIAction {
ACTION_NAME,
n("observe.content.action.move.activities.seine"),
n("observe.content.action.move.activities.seine.tip"),
- "move-activities"
+ "move-activities",
+ null
);
}
@Override
- public void actionPerformed(final ActionEvent e) {
+ protected void actionPerformed(ContentUI<?, ?> ui) {
- SwingUtilities.invokeLater(() -> {
- ContentUI<?, ?> ui = getContentUI(e);
- if (!(ui instanceof ActivitySeinesUI)) {
- throw new IllegalStateException("Can not come here!");
- }
+ if (!(ui instanceof ActivitySeinesUI)) {
+ throw new IllegalStateException("Can not come here!");
+ }
- // get current route id
- ObserveTreeHelper treeHelper = getMainUI().getTreeHelper();
- ObserveNode oldActivitiesNode = treeHelper.getSelectedNode();
- ObserveNode oldRouteNode = oldActivitiesNode.getParent();
-
- // choose the new route
- String routeId = chooseNewRoute(ui, oldRouteNode);
-
- if (routeId != null) {
- // change the route of the selected activities
- List<DataReference<ActivitySeineDto>> selectedDatas = ((ActivitySeinesUIModel) ui.getModel()).getSelectedDatas();
- List<String> activityIds = selectedDatas.stream()
- .map(DataReference.ID_FUNCTION)
- .collect(Collectors.toList());
- ActivitySeineService service = ObserveSwingApplicationContext.get().getMainDataSourceServicesProvider().newActivitySeineService();
- List<Integer> positions = service.moveActivitySeinesToRoute(activityIds, routeId);
-
- // update the tree
- updateTree(oldActivitiesNode, routeId, activityIds);
- }
+ // get current route id
+ ObserveTreeHelper treeHelper = getMainUI().getTreeHelper();
+ ObserveNode oldActivitiesNode = treeHelper.getSelectedNode();
+ ObserveNode oldRouteNode = oldActivitiesNode.getParent();
+
+ // choose the new route
+ String routeId = chooseNewRoute(ui, oldRouteNode);
- });
+ if (routeId != null) {
+ // change the route of the selected activities
+ List<DataReference<ActivitySeineDto>> selectedDatas = ((ActivitySeinesUIModel) ui.getModel()).getSelectedDatas();
+ List<String> activityIds = selectedDatas.stream()
+ .map(DataReference.ID_FUNCTION)
+ .collect(Collectors.toList());
+ ActivitySeineService service = ObserveSwingApplicationContext.get().getMainDataSourceServicesProvider().newActivitySeineService();
+ List<Integer> positions = service.moveActivitySeinesToRoute(activityIds, routeId);
+
+ // update the tree
+ updateTree(oldActivitiesNode, routeId, activityIds);
+ }
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveRoutesUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveRoutesUIAction.java
index 8fd275b..e2bdf49 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveRoutesUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveRoutesUIAction.java
@@ -65,12 +65,13 @@ public class MoveRoutesUIAction extends AbstractUIAction {
ACTION_NAME,
n("observe.content.action.move.routes"),
n("observe.content.action.move.routes.tip"),
- "move-routes"
+ "move-routes",
+ null
);
}
@Override
- public void actionPerformed(final ActionEvent e) {
+ public void actionPerformed(ActionEvent e) {
SwingUtilities.invokeLater(() -> {
JComponent c = (JComponent) e.getSource();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripsUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripsUIAction.java
index e118785..043fb8d 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripsUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripsUIAction.java
@@ -68,12 +68,13 @@ public abstract class MoveTripsUIAction<T extends DataDto> extends AbstractUIAct
actionName,
n("observe.content.action.move.trips"),
n("observe.content.action.move.trips.tip"),
- "move-trips"
+ "move-trips",
+ null
);
}
@Override
- public void actionPerformed(final ActionEvent e) {
+ public void actionPerformed(ActionEvent e) {
SwingUtilities.invokeLater(() -> {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/NewTableEntryUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/NewTableEntryUIAction.java
new file mode 100644
index 0000000..f0e129c
--- /dev/null
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/NewTableEntryUIAction.java
@@ -0,0 +1,29 @@
+package fr.ird.observe.application.swing.ui.actions.shared;
+
+import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.content.ContentUI;
+import fr.ird.observe.application.swing.ui.content.table.ContentTableUI;
+
+/**
+ * Created on 10/11/16.
+ *
+ * @author Tony Chemit - chemit(a)codelutin.com
+ * @since 5.1
+ */
+public class NewTableEntryUIAction extends AbstractContentUIAction {
+
+
+ public static final String ACTION_NAME = "newTableEntry";
+
+ public NewTableEntryUIAction(ObserveMainUI mainUI) {
+ super(mainUI, ACTION_NAME, "", "", "add", "ctrl pressed N");
+ }
+
+ @Override
+ protected void actionPerformed(ContentUI<?, ?> ui) {
+ ContentTableUI<?, ?, ?> contentUI = (ContentTableUI<?, ?, ?>) ui;
+ contentUI.getTableModel().addNewEntry();
+
+ }
+
+}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ReOpenUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ReOpenUIAction.java
index 0a8a161..b122bf9 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ReOpenUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ReOpenUIAction.java
@@ -30,9 +30,6 @@ import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper;
import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import fr.ird.observe.services.dto.DataReference;
-import javax.swing.SwingUtilities;
-import java.awt.event.ActionEvent;
-
import static org.nuiton.i18n.I18n.n;
/**
@@ -42,7 +39,7 @@ import static org.nuiton.i18n.I18n.n;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.4
*/
-public class ReOpenUIAction extends AbstractUIAction {
+public class ReOpenUIAction extends AbstractContentUIAction {
private static final long serialVersionUID = 1L;
@@ -53,42 +50,41 @@ public class ReOpenUIAction extends AbstractUIAction {
ACTION_NAME,
n("observe.content.action.reopen"),
n("observe.content.action.reopen.tip"),
- "reopen"
+ "reopen",
+ "ctrl pressed O"
);
}
@Override
- public void actionPerformed(final ActionEvent e) {
- SwingUtilities.invokeLater(() -> {
- ContentUI<?, ?> ui = getContentUI(e);
+ protected void actionPerformed(ContentUI<?, ?> ui) {
- ContentOpenableUI<?, ?> openUI;
+ ContentOpenableUI<?, ?> openUI;
- if (ui instanceof ContentOpenableUI<?, ?>) {
+ if (ui instanceof ContentOpenableUI<?, ?>) {
- openUI = (ContentOpenableUI<?, ?>) ui;
- } else if (ui instanceof ContentListUI<?, ?, ?>) {
+ openUI = (ContentOpenableUI<?, ?>) ui;
+ } else if (ui instanceof ContentListUI<?, ?, ?>) {
- DataReference<?> selectedData = ((ContentListUI<?, ?, ?>) ui).getSelectedData();
+ DataReference<?> selectedData = ((ContentListUI<?, ?, ?>) ui).getSelectedData();
- String id = selectedData.getId();
+ String id = selectedData.getId();
- ObserveTreeHelper treeHelper = ui.getTreeHelper();
- ObserveNode selectedNode = treeHelper.getSelectedNode();
- ObserveNode node = treeHelper.findNode(selectedNode, id);
+ ObserveTreeHelper treeHelper = ui.getTreeHelper();
+ ObserveNode selectedNode = treeHelper.getSelectedNode();
+ ObserveNode node = treeHelper.findNode(selectedNode, id);
- treeHelper.selectNode(node);
+ treeHelper.selectNode(node);
- openUI = (ContentOpenableUI<?, ?>)
- ObserveSwingApplicationContext.get().getContentUIManager().getSelectedContentUI();
+ openUI = (ContentOpenableUI<?, ?>)
+ ObserveSwingApplicationContext.get().getContentUIManager().getSelectedContentUI();
- } else {
- throw new IllegalStateException("The action " + ACTION_NAME + " can not be executed from ui " + ui);
- }
+ } else {
+ throw new IllegalStateException("The action " + ACTION_NAME + " can not be executed from ui " + ui);
+ }
- if (openUI != null) {
- openUI.openData();
- }
- });
+ if (openUI != null) {
+ openUI.openData();
+ }
}
+
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ResetEditUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ResetEditUIAction.java
index 274ee60..da7a884 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ResetEditUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ResetEditUIAction.java
@@ -24,9 +24,6 @@ package fr.ird.observe.application.swing.ui.actions.shared;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
import fr.ird.observe.application.swing.ui.content.ContentUI;
-import javax.swing.SwingUtilities;
-import java.awt.event.ActionEvent;
-
import static org.nuiton.i18n.I18n.n;
/**
@@ -36,7 +33,7 @@ import static org.nuiton.i18n.I18n.n;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.4
*/
-public class ResetEditUIAction extends AbstractUIAction {
+public class ResetEditUIAction extends AbstractContentUIAction {
private static final long serialVersionUID = 1L;
@@ -47,15 +44,14 @@ public class ResetEditUIAction extends AbstractUIAction {
ACTION_NAME,
n("observe.content.action.reset"),
n("observe.content.action.reset.tip"),
- "revert"
+ "revert",
+ "ctrl pressed R"
);
}
@Override
- public void actionPerformed(final ActionEvent e) {
- SwingUtilities.invokeLater(() -> {
- ContentUI<?, ?> contentUI = getContentUI(e);
- contentUI.resetEdit();
- });
+ protected void actionPerformed(ContentUI<?, ?> contentUI) {
+ contentUI.resetEdit();
}
+
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ResetTableEntryUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ResetTableEntryUIAction.java
new file mode 100644
index 0000000..a0c8bdd
--- /dev/null
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ResetTableEntryUIAction.java
@@ -0,0 +1,39 @@
+package fr.ird.observe.application.swing.ui.actions.shared;
+
+import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.content.ContentUI;
+import fr.ird.observe.application.swing.ui.content.table.ContentTableUI;
+
+/**
+ * Created on 10/11/16.
+ *
+ * @author Tony Chemit - chemit(a)codelutin.com
+ * @since 5.1
+ */
+public class ResetTableEntryUIAction extends AbstractContentUIAction {
+
+ public static final String ACTION_NAME = "resetTableEntry";
+
+ public ResetTableEntryUIAction(ObserveMainUI mainUI) {
+ super(mainUI, ACTION_NAME, "", "", "revert", "ctrl shift pressed R");
+ }
+
+ @Override
+ protected void actionPerformed(ContentUI<?, ?> ui) {
+
+ ContentTableUI<?, ?, ?> contentUI = (ContentTableUI<?, ?, ?>) ui;
+
+ if (contentUI.getTableModel().isCreate()) {
+
+ // reset new entry
+ contentUI.getTableModel().doRemoveRow(contentUI.getTableModel().getSelectedRow(), true);
+
+ } else {
+
+ // reset existing entry
+ contentUI.getTableModel().resetEditBean();
+
+ }
+ }
+
+}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SaveEditUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SaveEditUIAction.java
index 25b4a7a..04ad480 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SaveEditUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SaveEditUIAction.java
@@ -36,7 +36,7 @@ import static org.nuiton.i18n.I18n.n;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.4
*/
-public class SaveEditUIAction extends AbstractUIAction {
+public class SaveEditUIAction extends AbstractContentUIAction {
private static final long serialVersionUID = 1L;
@@ -47,15 +47,14 @@ public class SaveEditUIAction extends AbstractUIAction {
ACTION_NAME,
n("observe.action.save"),
n("observe.action.save.tip"),
- ACTION_NAME
+ ACTION_NAME,
+ "ctrl pressed S"
);
}
@Override
- public void actionPerformed(final ActionEvent e) {
- SwingUtilities.invokeLater(() -> {
- ContentUI<?, ?> contentUI = getContentUI(e);
- contentUI.save(true);
- });
+ protected void actionPerformed(ContentUI<?, ?> contentUI) {
+ contentUI.save(true);
}
+
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SaveTableEntryUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SaveTableEntryUIAction.java
new file mode 100644
index 0000000..469e349
--- /dev/null
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SaveTableEntryUIAction.java
@@ -0,0 +1,39 @@
+package fr.ird.observe.application.swing.ui.actions.shared;
+
+import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.content.ContentUI;
+import fr.ird.observe.application.swing.ui.content.table.ContentTableUI;
+
+/**
+ * Created on 10/11/16.
+ *
+ * @author Tony Chemit - chemit(a)codelutin.com
+ * @since 5.1
+ */
+public class SaveTableEntryUIAction extends AbstractContentUIAction {
+
+ public static final String ACTION_NAME = "saveTableEntry";
+
+ public SaveTableEntryUIAction(ObserveMainUI mainUI) {
+ super(mainUI, ACTION_NAME, "", "", "revert", "ctrl shift pressed S");
+ }
+
+ @Override
+ protected void actionPerformed(ContentUI<?, ?> content) {
+ ContentTableUI<?, ?, ?> contentUI = (ContentTableUI<?, ?, ?>) content;
+
+ if (contentUI.getTableModel().isCreate()) {
+
+ // save new entry
+ contentUI.getTableModel().updateRowFromEditBean();
+
+ } else {
+
+ // save existing entry
+ contentUI.getTableModel().updateRowFromEditBean();
+
+ }
+
+ }
+
+}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SelectNodeUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SelectNodeUIAction.java
index 0a1e5a7..3fd936f 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SelectNodeUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SelectNodeUIAction.java
@@ -49,7 +49,8 @@ public class SelectNodeUIAction extends AbstractUIAction {
ACTION_NAME,
n("observe.action.selectNode"),
n("observe.action.selectNode.tip"),
- "go-jump"
+ "go-jump",
+ null
);
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SelectOpenNodeUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SelectOpenNodeUIAction.java
index bc36961..616273c 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SelectOpenNodeUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SelectOpenNodeUIAction.java
@@ -41,12 +41,19 @@ public class SelectOpenNodeUIAction extends AbstractUIAction {
private static final long serialVersionUID = 1L;
public SelectOpenNodeUIAction(ObserveMainUI mainUI) {
- super(mainUI, ACTION_NAME, "<NONE>", "<NONE>", "go-down");
+ super(mainUI,
+ ACTION_NAME,
+ "<NONE>",
+ "<NONE>",
+ "go-down",
+ null);
}
@Override
public void actionPerformed(ActionEvent e) {
-
+ if (!canExecuteAction(e)) {
+ return;
+ }
JComponent c = (JComponent) e.getSource();
Class<?> type = (Class<?>) c.getClientProperty("type");
Objects.requireNonNull(type, "could not find client property type on component" + c);
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUI.jaxx
index 9b002c3..de045dc 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUI.jaxx
@@ -76,7 +76,7 @@
<String id='contentTitle' javaBean='null'/>
- <BlockingLayerUI id='blockLayerUI'/>
+ <ContentUIBlockingLayerUI id='blockLayerUI' constructorParams="this"/>
<script><![CDATA[
public Object getSelectedBean(JComboBox combo) {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIBlockingLayerUI.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIBlockingLayerUI.java
new file mode 100644
index 0000000..e60fbfe
--- /dev/null
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIBlockingLayerUI.java
@@ -0,0 +1,113 @@
+package fr.ird.observe.application.swing.ui.content;
+
+import com.google.common.collect.ImmutableSet;
+import fr.ird.observe.application.swing.ui.actions.shared.AbstractUIAction;
+import jaxx.runtime.swing.BlockingLayerUI;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jdesktop.jxlayer.JXLayer;
+
+import javax.swing.Action;
+import javax.swing.ActionMap;
+import javax.swing.InputMap;
+import javax.swing.JComponent;
+import javax.swing.KeyStroke;
+import javax.swing.SwingUtilities;
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+import java.util.Objects;
+import java.util.Set;
+
+/**
+ * Created on 09/11/16.
+ *
+ * @author Tony Chemit - chemit(a)codelutin.com
+ * @since 5.1
+ */
+public class ContentUIBlockingLayerUI extends BlockingLayerUI {
+
+ /** Logger */
+ private static final Log log = LogFactory.getLog(ContentUIBlockingLayerUI.class);
+
+ private static final Set<Integer> GLOBAL_KEY_CODES = ImmutableSet.of(
+ KeyEvent.VK_F1,
+ KeyEvent.VK_F2,
+ KeyEvent.VK_F3,
+ KeyEvent.VK_F4,
+ KeyEvent.VK_F5,
+ KeyEvent.VK_F6,
+ KeyEvent.VK_F7,
+ KeyEvent.VK_F8
+ );
+
+ private final ContentUI ui;
+
+ public ContentUIBlockingLayerUI(ContentUI ui) {
+ this.ui = ui;
+ }
+
+ @Override
+ protected void processKeyEvent(KeyEvent e, JXLayer<? extends JComponent> l) {
+
+ InputMap inputMap = ui.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+ ActionMap actionMap = ui.getActionMap();
+
+ boolean consumed = false;
+
+ if (e.isControlDown() && e.getKeyChar() != '\uFFFF') {
+
+ KeyStroke keyStroke = KeyStroke.getKeyStroke("ctrl pressed " + (char) e.getKeyCode());
+
+ if (keyStroke == null) {
+ super.processKeyEvent(e, l);
+ return;
+ }
+ consumed = doAction(keyStroke, inputMap, actionMap);
+ }
+
+ if (!consumed && !e.isControlDown() && !e.isShiftDown() && !e.isAltDown() && !e.isAltGraphDown()
+ && !e.isMetaDown() && GLOBAL_KEY_CODES.contains(e.getKeyCode())) {
+
+ KeyStroke keyStroke = KeyStroke.getKeyStroke("pressed " + (char) e.getKeyCode());
+
+ if (keyStroke == null) {
+ super.processKeyEvent(e, l);
+ return;
+ }
+
+ consumed = doAction(keyStroke, inputMap, actionMap);
+ }
+
+ if (consumed) {
+ e.consume();
+ } else {
+ super.processKeyEvent(e, l);
+ }
+
+ }
+
+ protected boolean doAction(KeyStroke keyStroke, InputMap inputMap, ActionMap actionMap) {
+
+ String actionName = (String) inputMap.get(keyStroke);
+ if (actionName != null) {
+
+ Action action = actionMap.get(actionName);
+
+ JComponent editor = (JComponent) action.getValue(AbstractUIAction.EDITOR);
+ Objects.requireNonNull(editor, "No editor on action: " + action);
+ if (editor.isVisible() && editor.isEnabled()) {
+
+ if (log.isInfoEnabled()) {
+ log.info("Found action: " + action.getValue(Action.NAME) + " for keyStroke: " + keyStroke);
+ }
+ SwingUtilities.invokeLater(() -> action.actionPerformed(new ActionEvent(ui, 0, (String) action.getValue(Action.NAME))));
+ return true;
+ } else {
+ if (log.isInfoEnabled()) {
+ log.info("Found disabled action: " + action.getValue(Action.NAME) + " for keyStroke: " + keyStroke);
+ }
+ }
+ }
+ return false;
+ }
+}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java
index 97ac366..bf5e7c1 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java
@@ -37,7 +37,6 @@ import fr.ird.observe.application.swing.validation.ObserveSwingValidator;
import fr.ird.observe.services.dto.AbstractReference;
import fr.ird.observe.services.dto.DataDto;
import fr.ird.observe.services.dto.DataReference;
-import fr.ird.observe.services.dto.Form;
import fr.ird.observe.services.dto.IdDto;
import fr.ird.observe.services.dto.referential.ReferentialDto;
import fr.ird.observe.services.dto.referential.ReferentialReference;
@@ -72,7 +71,6 @@ import org.nuiton.util.DateUtil;
import javax.swing.AbstractAction;
import javax.swing.AbstractButton;
import javax.swing.Action;
-import javax.swing.ActionMap;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JComponent;
@@ -105,6 +103,7 @@ import java.util.Date;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
+import java.util.Objects;
import java.util.Set;
import static org.nuiton.i18n.I18n.t;
@@ -196,17 +195,13 @@ public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>>
}
- protected Form<E> getFormDto() {
- return ui.getModel().getForm();
- }
-
public void initUI() {
if (log.isDebugEnabled()) {
log.debug("ui " + getClass());
}
- ActionMap actionMap = ObserveSwingApplicationContext.get().getActionMap();
+ ObserveActionMap actionMap = ObserveSwingApplicationContext.get().getActionMap();
// initialisation des éditeurs
@@ -315,13 +310,10 @@ public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>>
}
protected void init(UI ui, ObserveSwingValidator<?> validator) {
- SwingValidatorUtil.listenValidatorContextNameAndRefreshFields(
- validator,
- (JAXXValidator) ui
- );
+ SwingValidatorUtil.listenValidatorContextNameAndRefreshFields(validator, (JAXXValidator) ui);
}
- protected void init(ActionMap actionMap, AbstractButton editor) {
+ protected void init(ObserveActionMap actionMap, AbstractButton editor) {
String actionId = (String) editor.getClientProperty(OBSERVE_ACTION);
if (actionId == null) {
// le boutton n'est pas commun
@@ -336,20 +328,14 @@ public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>>
// on a trouve une action commune
AbstractUIAction action = (AbstractUIAction) actionMap.get(actionId);
-
- if (action == null) {
-
- // l'action n'est pas enregistrée
- throw new IllegalStateException(
- "action [" + actionId + "] not found for ui " +
- ui.getClass().getName());
- }
+ Objects.requireNonNull(action, "action [" + actionId + "] not found for ui " + ui.getClass().getName());
if (log.isDebugEnabled()) {
log.debug("init common action " + actionId);
}
- action.initAction(null, editor);
+ action.initAction(ui, editor);
+
}
protected void init(NumberEditor editor) {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ObserveActionMap.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ObserveActionMap.java
new file mode 100644
index 0000000..c59c0e2
--- /dev/null
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ObserveActionMap.java
@@ -0,0 +1,74 @@
+package fr.ird.observe.application.swing.ui.content;
+
+import com.google.common.collect.ImmutableMap;
+import fr.ird.observe.application.swing.ObserveSwingTechnicalException;
+import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.actions.shared.AbstractUIAction;
+import org.apache.commons.beanutils.ConstructorUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.reflections.Reflections;
+
+import javax.swing.Action;
+import javax.swing.ActionMap;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Modifier;
+import java.util.Set;
+
+/**
+ * Created on 10/11/16.
+ *
+ * @author Tony Chemit - chemit(a)codelutin.com
+ * @since 5.1
+ */
+public class ObserveActionMap extends ActionMap {
+
+ /** Logger */
+ private static final Log log = LogFactory.getLog(ObserveActionMap.class);
+
+ private final ObserveMainUI ui;
+
+ private final ImmutableMap<String, Class<? extends AbstractUIAction>> mapping;
+
+ public ObserveActionMap(ObserveMainUI ui) {
+ this.ui = ui;
+ Set<Class<? extends AbstractUIAction>> actionTypes = new Reflections("fr.ird.observe.application.swing.ui.actions.shared").getSubTypesOf(AbstractUIAction.class);
+
+ ImmutableMap.Builder<String, Class<? extends AbstractUIAction>> mappingBuilder = ImmutableMap.builder();
+ for (Class<? extends AbstractUIAction> actionType : actionTypes) {
+
+ if (Modifier.isAbstract(actionType.getModifiers())) {
+ continue;
+ }
+
+ try {
+ String actionId = (String) actionType.getDeclaredField("ACTION_NAME").get(null);
+ mappingBuilder.put(actionId, actionType);
+ } catch (IllegalAccessException | NoSuchFieldException e) {
+ throw new ObserveSwingTechnicalException("Can't find ACTION_NAME field on action: " + actionType.getName());
+ }
+
+ }
+
+ mapping = mappingBuilder.build();
+ }
+
+ @Override
+ public Action get(Object key) {
+ Class<? extends AbstractUIAction> actionType = mapping.get(key);
+ if (actionType == null) {
+
+ return super.get(key);
+ }
+
+ try {
+ if (log.isInfoEnabled()) {
+ log.info("Create action: " + key + ", type: " + actionType.getName());
+ }
+ return ConstructorUtils.invokeConstructor(actionType, ui);
+ } catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) {
+ throw new ObserveSwingTechnicalException("Hum, can't creation action for type: " + actionType.getName(), e);
+ }
+
+ }
+}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUI.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUI.jcss
index e75656d..2626b6e 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUI.jcss
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUI.jcss
@@ -53,14 +53,18 @@
#reopen {
_observeAction:{ReOpenUIAction.ACTION_NAME};
visible:{model.isReadingMode() && model.isCanReopen()};
+ enabled:{model.isReadingMode() && model.isCanReopen()};
+
}
#close {
_observeAction:{CloseOpenUIAction.ACTION_NAME};
visible:{model.isUpdatingMode()};
+ enabled:{model.isUpdatingMode()};
}
#closeAndCreate {
_observeAction:{CloseAndCreateUIAction.ACTION_NAME};
visible:{model.isUpdatingMode()};
+ enabled:{model.isUpdatingMode()};
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUI.jaxx
index 1a201e0..4809b9e 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUI.jaxx
@@ -28,6 +28,10 @@
<import>
fr.ird.observe.application.swing.ui.actions.shared.ResetEditUIAction
fr.ird.observe.application.swing.ui.actions.shared.SaveEditUIAction
+ fr.ird.observe.application.swing.ui.actions.shared.NewTableEntryUIAction
+ fr.ird.observe.application.swing.ui.actions.shared.ResetTableEntryUIAction
+ fr.ird.observe.application.swing.ui.actions.shared.SaveTableEntryUIAction
+ fr.ird.observe.application.swing.ui.actions.shared.DeleteTableEntryUIAction
jaxx.runtime.swing.BlockingLayerUI
jaxx.runtime.validator.swing.SwingValidator
@@ -40,6 +44,7 @@
javax.swing.UIManager
static org.nuiton.i18n.I18n.n
+ static org.nuiton.i18n.I18n.t
</import>
@@ -133,33 +138,27 @@ public abstract SwingValidator<D> getValidatorTable();
<row>
<cell weightx='1'>
<!-- ajouter une nouvelle entrée -->
- <JButton id='newEntry'
- onActionPerformed='getTableModel().addNewEntry()'/>
+ <JButton id='newEntry'/>
</cell>
<cell weightx='1'>
<!-- annuler la création d'une nouvelle entrée (en mode creation) -->
- <JButton id='resetNewEntry'
- onActionPerformed='getTableModel().doRemoveRow(getTableModel().getSelectedRow(), true)'/>
+ <JButton id='resetNewEntry'/>
</cell>
<cell weightx='1'>
<!-- réinitialiser l'entrée en cours d'édition (en mode mise a jour) -->
- <JButton id='resetEntry'
- onActionPerformed='getHandler().resetEditBean()'/>
+ <JButton id='resetEntry'/>
</cell>
<cell weightx='1'>
<!-- sauver dans le tableau l'entrée en cours d'édition (en mode mise a jour)-->
- <JButton id='saveEntry'
- onActionPerformed='getTableModel().updateRowFromEditBean()'/>
+ <JButton id='saveEntry'/>
</cell>
<cell weightx='1'>
<!-- sauver dans le tableau la nouvelle entrée (en mode creation) -->
- <JButton id='saveNewEntry'
- onActionPerformed='getTableModel().updateRowFromEditBean()'/>
+ <JButton id='saveNewEntry'/>
</cell>
<cell weightx='1'>
<!-- supprimer l'entrée courante dans le tableau (en mode mise a jour)-->
- <JButton id='deleteEntry'
- onActionPerformed='getHandler().removeSelectedRow(getTableModel().getSelectedRow())'/>
+ <JButton id='deleteEntry'/>
</cell>
</row>
</Table>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUI.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUI.jcss
index 904fa75..05ca7ee 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUI.jcss
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUI.jcss
@@ -73,47 +73,52 @@
}
#newEntry {
- text:{getNewEntryText()};
- toolTipText:{getNewEntryTip()};
- actionIcon:"add";
+ _observeAction:{NewTableEntryUIAction.ACTION_NAME};
+ _text:{t(getNewEntryText())};
+ _toolTipText:{t(getNewEntryTip())};
visible:{tableModel.isEditable() && !tableModel.isCreate()};
}
#resetNewEntry{
- text:{getResetNewEntryText()};
- toolTipText:{getResetNewEntryTip()};
+ _observeAction:{ResetTableEntryUIAction.ACTION_NAME};
+ _text:{t(getResetNewEntryText())};
+ _toolTipText:{t(getResetNewEntryTip())};
actionIcon:"revert";
enabled:true;
visible:{tableModel.isEditable() && tableModel.isCreate()};
}
#resetEntry {
- text:{getResetEntryText()};
- toolTipText:{getResetEntryTip()};
+ _observeAction:{ResetTableEntryUIAction.ACTION_NAME};
+ _text:{t(getResetEntryText())};
+ _toolTipText:{t(getResetEntryTip())};
actionIcon:"revert";
enabled:{model.isCanResetRow()};
visible:{tableModel.isEditable() && !tableModel.isEmpty() && !tableModel.isCreate()};
}
#saveEntry{
- text:{getSaveEntryText()};
- toolTipText:{getSaveEntryTip()};
+ _observeAction:{SaveTableEntryUIAction.ACTION_NAME};
+ _text:{t(getSaveEntryText())};
+ _toolTipText:{t(getSaveEntryTip())};
actionIcon:"save";
visible:{tableModel.isEditable() && !tableModel.isEmpty() && !tableModel.isCreate()};
enabled:{model.isCanSaveRow()};
}
#saveNewEntry {
- text:{getSaveNewEntryText()};
- toolTipText:{getSaveNewEntryTip()};
+ _observeAction:{SaveTableEntryUIAction.ACTION_NAME};
+ _text:{t(getSaveNewEntryText())};
+ _toolTipText:{t(getSaveNewEntryTip())};
actionIcon:"add";
visible:{tableModel.isEditable() && !tableModel.isEmpty() && tableModel.isCreate()};
enabled:{model.isCanSaveRow()};
}
#deleteEntry {
- text:{getDeleteEntryText()};
- toolTipText:{getDeleteEntryTip()};
+ _observeAction:{DeleteTableEntryUIAction.ACTION_NAME};
+ _text:{t(getDeleteEntryText())};
+ _toolTipText:{t(getDeleteEntryTip())};
actionIcon:"delete";
visible:{tableModel.isEditable() && !tableModel.isEmpty() && !tableModel.isCreate()};
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIHandler.java
index 84eb829..45838e3 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIHandler.java
@@ -219,6 +219,9 @@ public abstract class ContentTableUIHandler<E extends IdDto, D extends IdDto, U
uiInitializer.initUI();
getModel().addPropertyChangeListener(ContentUIModel.PROPERTY_FORM, evt -> updateUiWithReferenceSetsFromModel());
+
+ ObserveSwingApplicationContext.get().getFocusManager().setFocusTraversalPolicy(ui);
+
}
@Override
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIInitializer.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIInitializer.java
index 93105a3..55c22b6 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIInitializer.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIInitializer.java
@@ -22,16 +22,16 @@ package fr.ird.observe.application.swing.ui.content.table;
* #L%
*/
-import fr.ird.observe.services.dto.IdDto;
+import fr.ird.observe.application.swing.ui.content.ObserveActionMap;
import fr.ird.observe.application.swing.ui.content.ContentUIInitializer;
import fr.ird.observe.application.swing.ui.util.BooleanEditor;
+import fr.ird.observe.services.dto.IdDto;
import jaxx.runtime.SwingUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.jaxx.application.bean.JavaBeanObjectUtil;
import javax.swing.AbstractButton;
-import javax.swing.ActionMap;
import javax.swing.JCheckBox;
import javax.swing.JComponent;
import javax.swing.JTextArea;
@@ -71,7 +71,7 @@ public class ContentTableUIInitializer<E extends IdDto, D extends IdDto, UI exte
return ui.getModel();
}
- protected ContentTableUIHandler<E, D, UI> getHandler() {
+ protected ContentTableUIHandler<E, D, UI> getHandler() {
return ui.getHandler();
}
@@ -167,8 +167,7 @@ public class ContentTableUIInitializer<E extends IdDto, D extends IdDto, UI exte
}
@Override
- protected void init(ActionMap actionMap,
- AbstractButton editor) {
+ protected void init(ObserveActionMap actionMap, AbstractButton editor) {
super.init(actionMap, editor);
--
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm(a)codelutin.com>.
1
0
07/32: Introduction de ObserveFocusManager et réusinage des ui (amélioration de la généricité + nouvel héritage pour les référentiels i18n)
by codelutin.com scm 25 Nov '16
by codelutin.com scm 25 Nov '16
25 Nov '16
This is an automated email from the git hooks/post-receive script.
New commit to branch develop in repository observe.
See https://gitlab.nuiton.org/codelutin/observe.git
commit 678194870c37a286713de2ca7239c4ede2afe432
Author: Tony CHEMIT <chemit(a)codelutin.com>
Date: Wed Nov 9 16:13:31 2016 +0100
Introduction de ObserveFocusManager et réusinage des ui (amélioration de la généricité + nouvel héritage pour les référentiels i18n)
---
.../swing/ObserveSwingApplicationContext.java | 8 +
.../application/swing/ui/ObserveMainUIHandler.java | 18 +-
.../swing/ui/actions/shared/AbstractUIAction.java | 28 +-
.../ui/actions/shared/CancelCreateUIAction.java | 10 +-
.../ui/actions/shared/CloseAndCreateUIAction.java | 9 +-
.../swing/ui/actions/shared/CloseOpenUIAction.java | 9 +-
.../ui/actions/shared/DeleteDataUIAction.java | 15 +-
.../ui/actions/shared/DeleteReferenceUIAction.java | 11 +-
.../swing/ui/actions/shared/GoDownUIAction.java | 20 +-
.../swing/ui/actions/shared/GoUpUIAction.java | 17 +-
.../shared/MoveActivityLonglinesUIAction.java | 15 +-
.../actions/shared/MoveActivitySeinesUIAction.java | 25 +-
.../ui/actions/shared/MoveRoutesUIAction.java | 18 +-
.../actions/shared/MoveTripLonglinesUIAction.java | 21 +-
.../ui/actions/shared/MoveTripSeinesUIAction.java | 21 +-
.../swing/ui/actions/shared/MoveTripsUIAction.java | 30 +-
.../swing/ui/actions/shared/ReOpenUIAction.java | 8 +-
.../swing/ui/actions/shared/ResetEditUIAction.java | 8 +-
.../swing/ui/actions/shared/SaveEditUIAction.java | 12 +-
.../ui/actions/shared/SelectOpenNodeUIAction.java | 7 +-
.../application/swing/ui/content/ContentUI.jaxx | 6 +-
.../swing/ui/content/ContentUIHandler.java | 63 +-
.../swing/ui/content/ContentUIInitializer.java | 2 +-
.../swing/ui/content/ContentUIManager.java | 28 +-
.../swing/ui/content/ContentUIModel.java | 4 +-
.../swing/ui/content/ObserveContentUI.java | 2 +-
.../swing/ui/content/ObserveFocusManager.java | 1337 ++++++++++++++++++++
.../ui/content/impl/longline/BranchlineUI.jaxx | 34 +-
.../content/impl/longline/BranchlineUIHandler.java | 7 +-
.../impl/longline/LonglineDetailCompositionUI.jaxx | 12 +-
.../LonglineDetailCompositionUIHandler.java | 55 +-
.../impl/longline/LonglineGlobalCompositionUI.jaxx | 12 +-
.../LonglineGlobalCompositionUIHandler.java | 7 +-
.../ui/content/impl/longline/SetLonglineUI.jaxx | 22 +-
.../impl/longline/SetLonglineUIHandler.java | 46 +-
.../FloatingObjectTransmittingBuoyOperationUI.jaxx | 57 +-
...ngObjectTransmittingBuoyOperationUIHandler.java | 45 +-
.../ui/content/impl/seine/FloatingObjectUI.jaxx | 24 +-
.../impl/seine/FloatingObjectUIHandler.java | 45 +-
.../swing/ui/content/impl/seine/SetSeineUI.jaxx | 8 +-
.../ui/content/impl/seine/SetSeineUIHandler.java | 54 +-
.../swing/ui/content/list/ContentListUI.jaxx | 2 +-
.../ui/content/list/ContentListUIHandler.java | 54 +-
.../list/impl/seine/ActivitySeinesUIHandler.java | 5 +-
.../swing/ui/content/open/ContentOpenableUI.jaxx | 2 +-
.../ui/content/open/ContentOpenableUIHandler.java | 20 +-
.../impl/longline/ActivityLonglineUIHandler.java | 36 -
.../open/impl/longline/TripLonglineUIHandler.java | 42 -
.../open/impl/seine/ActivitySeineUIHandler.java | 61 -
.../ui/content/open/impl/seine/RouteUIHandler.java | 36 -
.../open/impl/seine/TripSeineUIHandler.java | 32 -
...itySeineUI.jaxx => ContentI18nReferenceUI.jaxx} | 70 +-
.../ui/content/ref/ContentI18nReferenceUI.jcss | 71 ++
.../swing/ui/content/ref/ContentReferenceUI.jaxx | 30 +-
.../swing/ui/content/ref/ContentReferenceUI.jcss | 1 +
.../ui/content/ref/ContentReferenceUIHandler.java | 32 +-
.../swing/ui/content/ref/ReferenceHomeUI.jaxx | 7 +-
.../ui/content/ref/ReferenceHomeUIHandler.java | 4 +-
.../swing/ui/content/ref/ReferenceHomeUIModel.java | 2 +-
.../ref/ReferentialContentUIInitializer.java | 13 +-
.../swing/ui/content/ref/UniqueKeyTableModel.java | 2 +-
.../swing/ui/content/ref/impl/CountryUI.jaxx | 97 +-
.../swing/ui/content/ref/impl/CountryUIModel.java | 2 +-
.../swing/ui/content/ref/impl/FpaZoneUI.jaxx | 95 +-
.../swing/ui/content/ref/impl/FpaZoneUIModel.java | 2 +-
.../content/ref/impl/GearCaracteristicTypeUI.jaxx | 95 +-
.../ref/impl/GearCaracteristicTypeUIModel.java | 2 +-
.../ui/content/ref/impl/GearCaracteristicUI.jaxx | 97 +-
.../content/ref/impl/GearCaracteristicUIModel.java | 4 +-
.../swing/ui/content/ref/impl/GearUI.jaxx | 25 +-
.../swing/ui/content/ref/impl/GearUI.jcss | 4 -
.../swing/ui/content/ref/impl/GearUIHandler.java | 9 +-
.../swing/ui/content/ref/impl/GearUIModel.java | 2 +-
.../swing/ui/content/ref/impl/HarbourUI.jaxx | 27 +-
.../swing/ui/content/ref/impl/HarbourUIModel.java | 22 +-
.../ui/content/ref/impl/I18nReferenceEntity.jcss | 92 --
.../content/ref/impl/LengthLengthParameterUI.jaxx | 7 +-
.../ref/impl/LengthLengthParameterUIHandler.java | 7 +-
.../content/ref/impl/LengthWeightParameterUI.jaxx | 7 +-
.../ref/impl/LengthWeightParameterUIHandler.java | 9 +-
.../ref/impl/LengthWeightParameterUIModel.java | 3 +-
.../ref/impl/NeedCommentReferenceEntity.jcss | 25 -
.../swing/ui/content/ref/impl/OceanUI.jaxx | 96 +-
.../swing/ui/content/ref/impl/OceanUIModel.java | 2 +-
.../swing/ui/content/ref/impl/OrganismUI.jaxx | 98 +-
.../swing/ui/content/ref/impl/OrganismUIModel.java | 2 +-
.../swing/ui/content/ref/impl/PersonUI.jaxx | 23 +-
.../swing/ui/content/ref/impl/PersonUIModel.java | 14 +-
.../swing/ui/content/ref/impl/ProgramUI.jaxx | 41 +-
.../swing/ui/content/ref/impl/ProgramUI.jcss | 4 -
.../ui/content/ref/impl/ProgramUIHandler.java | 9 +-
.../swing/ui/content/ref/impl/ProgramUIModel.java | 2 +-
.../swing/ui/content/ref/impl/ReferenceEntity.jcss | 3 +
.../swing/ui/content/ref/impl/SexUI.jaxx | 95 +-
.../swing/ui/content/ref/impl/SexUIModel.java | 2 +-
.../swing/ui/content/ref/impl/ShipOwnerUI.jaxx | 24 +-
.../ui/content/ref/impl/SizeMeasureTypeUI.jaxx | 92 +-
.../content/ref/impl/SizeMeasureTypeUIModel.java | 2 +-
.../swing/ui/content/ref/impl/SpeciesGroupUI.jaxx | 97 +-
.../ui/content/ref/impl/SpeciesGroupUIModel.java | 2 +-
.../swing/ui/content/ref/impl/SpeciesListUI.jaxx | 29 +-
.../swing/ui/content/ref/impl/SpeciesListUI.jcss | 4 -
.../ui/content/ref/impl/SpeciesListUIHandler.java | 9 +-
.../ui/content/ref/impl/SpeciesListUIModel.java | 2 +-
.../swing/ui/content/ref/impl/SpeciesUI.jaxx | 19 +-
.../swing/ui/content/ref/impl/SpeciesUI.jcss | 4 -
.../ui/content/ref/impl/SpeciesUIHandler.java | 9 +-
.../swing/ui/content/ref/impl/SpeciesUIModel.java | 22 +-
.../ui/content/ref/impl/VesselSizeCategoryUI.jaxx | 30 +-
.../ref/impl/VesselSizeCategoryUIModel.java | 2 +-
.../swing/ui/content/ref/impl/VesselTypeUI.jaxx | 28 +-
.../ui/content/ref/impl/VesselTypeUIModel.java | 2 +-
.../swing/ui/content/ref/impl/VesselUI.jaxx | 38 +-
.../swing/ui/content/ref/impl/VesselUI.jcss | 4 -
.../swing/ui/content/ref/impl/VesselUIHandler.java | 9 +-
.../ui/content/ref/impl/WeightMeasureTypeUI.jaxx | 93 +-
.../content/ref/impl/WeightMeasureTypeUIModel.java | 2 +-
.../ref/impl/longline/BaitHaulingStatusUI.jaxx | 95 +-
.../impl/longline/BaitHaulingStatusUIModel.java | 2 +-
.../ref/impl/longline/BaitSettingStatusUI.jaxx | 97 +-
.../impl/longline/BaitSettingStatusUIModel.java | 2 +-
.../ui/content/ref/impl/longline/BaitTypeUI.jaxx | 94 +-
.../content/ref/impl/longline/BaitTypeUIModel.java | 2 +-
.../ref/impl/longline/CatchFateLonglineUI.jaxx | 95 +-
.../impl/longline/CatchFateLonglineUIModel.java | 2 +-
.../content/ref/impl/longline/EncounterTypeUI.jaxx | 95 +-
.../ref/impl/longline/EncounterTypeUIModel.java | 2 +-
.../ui/content/ref/impl/longline/HealthnessUI.jaxx | 94 +-
.../ref/impl/longline/HealthnessUIModel.java | 2 +-
.../content/ref/impl/longline/HookPositionUI.jaxx | 95 +-
.../ref/impl/longline/HookPositionUIModel.java | 2 +-
.../ui/content/ref/impl/longline/HookSizeUI.jaxx | 94 +-
.../content/ref/impl/longline/HookSizeUIModel.java | 2 +-
.../ui/content/ref/impl/longline/HookTypeUI.jaxx | 96 +-
.../content/ref/impl/longline/HookTypeUIModel.java | 2 +-
.../impl/longline/ItemHorizontalPositionUI.jaxx | 95 +-
.../longline/ItemHorizontalPositionUIModel.java | 2 +-
.../ref/impl/longline/ItemVerticalPositionUI.jaxx | 95 +-
.../impl/longline/ItemVerticalPositionUIModel.java | 2 +-
.../ref/impl/longline/LightsticksColorUI.jaxx | 95 +-
.../ref/impl/longline/LightsticksColorUIModel.java | 2 +-
.../ref/impl/longline/LightsticksTypeUI.jaxx | 95 +-
.../ref/impl/longline/LightsticksTypeUIModel.java | 2 +-
.../ui/content/ref/impl/longline/LineTypeUI.jaxx | 94 +-
.../content/ref/impl/longline/LineTypeUIModel.java | 2 +-
.../ref/impl/longline/MaturityStatusUI.jaxx | 98 +-
.../ref/impl/longline/MaturityStatusUIModel.java | 2 +-
.../ref/impl/longline/MitigationTypeUI.jaxx | 95 +-
.../ref/impl/longline/MitigationTypeUIModel.java | 2 +-
.../content/ref/impl/longline/SensorBrandUI.jaxx | 24 +-
.../ref/impl/longline/SensorBrandUIModel.java | 2 +-
.../ref/impl/longline/SensorDataFormatUI.jaxx | 95 +-
.../ref/impl/longline/SensorDataFormatUIModel.java | 2 +-
.../ui/content/ref/impl/longline/SensorTypeUI.jaxx | 94 +-
.../ref/impl/longline/SensorTypeUIModel.java | 2 +-
.../content/ref/impl/longline/SettingShapeUI.jaxx | 95 +-
.../ref/impl/longline/SettingShapeUIModel.java | 2 +-
.../ref/impl/longline/StomacFullnessUI.jaxx | 95 +-
.../ref/impl/longline/StomacFullnessUIModel.java | 2 +-
.../ui/content/ref/impl/longline/TripTypeUI.jaxx | 94 +-
.../content/ref/impl/longline/TripTypeUIModel.java | 2 +-
.../impl/longline/VesselActivityLonglineUI.jaxx | 95 +-
.../longline/VesselActivityLonglineUIModel.java | 2 +-
.../ui/content/ref/impl/seine/DetectionModeUI.jaxx | 95 +-
.../ref/impl/seine/DetectionModeUIModel.java | 2 +-
.../ui/content/ref/impl/seine/ObjectFateUI.jaxx | 93 +-
.../content/ref/impl/seine/ObjectFateUIModel.java | 2 +-
.../content/ref/impl/seine/ObjectOperationUI.jaxx | 96 +-
.../ref/impl/seine/ObjectOperationUIModel.java | 2 +-
.../ui/content/ref/impl/seine/ObjectTypeUI.jaxx | 93 +-
.../content/ref/impl/seine/ObjectTypeUIModel.java | 2 +-
.../content/ref/impl/seine/ObservedSystemUI.jaxx | 97 +-
.../ref/impl/seine/ObservedSystemUIModel.java | 2 +-
.../content/ref/impl/seine/ReasonForDiscardUI.jaxx | 96 +-
.../ref/impl/seine/ReasonForDiscardUIModel.java | 2 +-
.../ref/impl/seine/ReasonForNoFishingUI.jaxx | 99 +-
.../ref/impl/seine/ReasonForNoFishingUIModel.java | 2 +-
.../content/ref/impl/seine/ReasonForNullSetUI.jaxx | 94 +-
.../ref/impl/seine/ReasonForNullSetUIModel.java | 2 +-
.../ui/content/ref/impl/seine/SpeciesFateUI.jaxx | 78 +-
.../ui/content/ref/impl/seine/SpeciesStatusUI.jaxx | 94 +-
.../ref/impl/seine/SpeciesStatusUIModel.java | 2 +-
.../ref/impl/seine/SurroundingActivityUI.jaxx | 94 +-
.../ref/impl/seine/SurroundingActivityUIModel.java | 2 +-
.../impl/seine/TransmittingBuoyOperationUI.jaxx | 96 +-
.../seine/TransmittingBuoyOperationUIModel.java | 2 +-
.../ref/impl/seine/TransmittingBuoyTypeUI.jaxx | 93 +-
.../impl/seine/TransmittingBuoyTypeUIModel.java | 2 +-
.../ref/impl/seine/VesselActivitySeineUI.jaxx | 80 +-
.../ref/impl/seine/VesselActivitySeineUIModel.java | 3 +-
.../content/ref/impl/seine/WeightCategoryUI.jaxx | 94 +-
.../ref/impl/seine/WeightCategoryUIModel.java | 2 +-
.../swing/ui/content/ref/impl/seine/WindUI.jaxx | 98 +-
.../ui/content/ref/impl/seine/WindUIModel.java | 2 +-
.../swing/ui/content/table/ContentTableUI.jaxx | 2 +-
.../ui/content/table/ContentTableUIHandler.java | 37 +-
.../ui/content/table/ObserveContentTableUI.java | 8 +-
.../impl/longline/BaitsCompositionUIHandler.java | 11 +-
.../longline/BranchlinesCompositionUIHandler.java | 11 +-
.../impl/longline/CatchLonglineUIHandler.java | 82 --
.../table/impl/longline/EncounterUIHandler.java | 34 -
.../longline/FloatlinesCompositionUIHandler.java | 11 +-
.../longline/GearUseFeaturesLonglineUIHandler.java | 38 -
.../impl/longline/HooksCompositionUIHandler.java | 5 -
.../table/impl/longline/SensorUsedUIHandler.java | 30 -
.../content/table/impl/longline/TdrUIHandler.java | 76 --
.../impl/seine/GearUseFeaturesSeineUIHandler.java | 56 +-
.../table/impl/seine/NonTargetCatchUIHandler.java | 27 -
.../table/impl/seine/NonTargetSampleUIHandler.java | 34 -
.../impl/seine/ObjectObservedSpeciesUIHandler.java | 33 +-
.../impl/seine/ObjectSchoolEstimateUIHandler.java | 33 +-
.../table/impl/seine/SchoolEstimateUIHandler.java | 33 -
.../table/impl/seine/TargetCatchUIHandler.java | 33 -
.../impl/seine/TargetDiscardCatchUIHandler.java | 33 -
.../table/impl/seine/TargetSampleUIHandler.java | 33 -
.../tree/ObserveNavigationTreeShowPopupAction.java | 2 +-
216 files changed, 2538 insertions(+), 6054 deletions(-)
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ObserveSwingApplicationContext.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ObserveSwingApplicationContext.java
index e52c4a2..1ed8e6b 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ObserveSwingApplicationContext.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ObserveSwingApplicationContext.java
@@ -47,6 +47,7 @@ import fr.ird.observe.application.swing.ui.actions.shared.SaveEditUIAction;
import fr.ird.observe.application.swing.ui.actions.shared.SelectNodeUIAction;
import fr.ird.observe.application.swing.ui.actions.shared.SelectOpenNodeUIAction;
import fr.ird.observe.application.swing.ui.content.ContentUIManager;
+import fr.ird.observe.application.swing.ui.content.ObserveFocusManager;
import fr.ird.observe.application.swing.validation.ValidationContext;
import fr.ird.observe.services.ObserveServicesProvider;
import fr.ird.observe.services.dto.constants.ReferentialLocale;
@@ -82,6 +83,7 @@ import static fr.ird.observe.application.swing.ObserveSwingApplicationContext.En
import static fr.ird.observe.application.swing.ObserveSwingApplicationContext.Entries.DATA_SOURCES_MANAGER;
import static fr.ird.observe.application.swing.ObserveSwingApplicationContext.Entries.DATA_SOURCE_CONFIGURATION_FACTORY;
import static fr.ird.observe.application.swing.ObserveSwingApplicationContext.Entries.DECORATOR_SERVICE;
+import static fr.ird.observe.application.swing.ObserveSwingApplicationContext.Entries.FOCUS_MANAGER;
import static fr.ird.observe.application.swing.ObserveSwingApplicationContext.Entries.H2_SERVER;
import static fr.ird.observe.application.swing.ObserveSwingApplicationContext.Entries.H2_SERVER_MODE;
import static fr.ird.observe.application.swing.ObserveSwingApplicationContext.Entries.H2_WEBSERVER;
@@ -133,6 +135,7 @@ public class ObserveSwingApplicationContext extends DefaultApplicationContext im
H2_SERVER_MODE("H2 Server mode", Boolean.class),
H2_SERVER("H2 Server", Server.class),
H2_WEBSERVER("H2 Web server", Server.class),
+ FOCUS_MANAGER("Focus manager", ObserveFocusManager.class),
VALIDATORS("Validators"),
LOCAL_DATABASE_BACKUP_TIMER("Local database backup task", ScheduledThreadPoolExecutor.class),
NODE_TO_RESELECT("Node to reselect");
@@ -223,6 +226,7 @@ public class ObserveSwingApplicationContext extends DefaultApplicationContext im
SERVICE_MAIN_FACTORY.set(ObserveServiceMainFactory.get());
LOCAL_DATABASE_BACKUP_TIMER.set(new ScheduledThreadPoolExecutor(1));
OBSERVE_SWING_SESSION_HELPER.set(new ObserveSwingSessionHelper(config.getSwingSessionFile()));
+ FOCUS_MANAGER.set(new ObserveFocusManager());
referenceBinderEngine = new ReferenceBinderEngineSupplier().get();
scheduledFuture = getLocalDatabaseBackupTimer().scheduleAtFixedRate(new LocalDatabaseBackupTask(), 0, config.getBackupDelay(), TimeUnit.MINUTES);
@@ -326,6 +330,10 @@ public class ObserveSwingApplicationContext extends DefaultApplicationContext im
return OBSERVE_SWING_SESSION_HELPER.get();
}
+ public ObserveFocusManager getFocusManager() {
+ return FOCUS_MANAGER.get();
+ }
+
//-------------------------------------------
// - Write
//-------------------------------------------
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUIHandler.java
index 4c5972d..b5e3d9c 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/ObserveMainUIHandler.java
@@ -22,23 +22,23 @@
package fr.ird.observe.application.swing.ui;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
-import fr.ird.observe.application.swing.decoration.DecoratorService;
import fr.ird.observe.application.swing.configuration.ObserveSwingApplicationConfig;
import fr.ird.observe.application.swing.db.DataContext;
import fr.ird.observe.application.swing.db.ObserveSwingDataSource;
+import fr.ird.observe.application.swing.decoration.DecoratorService;
import fr.ird.observe.application.swing.decoration.ObserveI18nDecoratorHelper;
-import fr.ird.observe.services.dto.AbstractObserveDto;
-import fr.ird.observe.services.dto.constants.ReferentialLocale;
import fr.ird.observe.application.swing.ui.content.ContentMode;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.content.ContentUIManager;
import fr.ird.observe.application.swing.ui.content.ContentUIModel;
import fr.ird.observe.application.swing.ui.content.ObserveContentUI;
import fr.ird.observe.application.swing.ui.tree.ObserveNavigationTreeShowPopupAction;
-import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper;
+import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import fr.ird.observe.application.swing.ui.util.ObserveSwingValidatorMessageTableModel;
import fr.ird.observe.application.swing.ui.util.ObserveValidatorMessageTableRenderer;
+import fr.ird.observe.services.dto.AbstractObserveDto;
+import fr.ird.observe.services.dto.constants.ReferentialLocale;
import jaxx.runtime.JAXXContext;
import jaxx.runtime.context.DefaultApplicationContext;
import jaxx.runtime.context.JAXXInitialContext;
@@ -101,7 +101,7 @@ public class ObserveMainUIHandler {
ContentUIManager manager = ui.getContentUIManager();
// obtain the ui type to show
- Class<? extends ObserveContentUI<?>> uiClass = manager.convertNodeToContentUI(node);
+ Class<? extends ObserveContentUI<?, ?>> uiClass = manager.convertNodeToContentUI(node);
if (log.isDebugEnabled()) {
log.debug("new selected path = " + node + ", ui = " + uiClass);
}
@@ -132,9 +132,7 @@ public class ObserveMainUIHandler {
}
}
- public void doOpencontent(ObserveMainUI ui,
- TreePath path,
- Class<? extends ObserveContentUI<?>> uiClass) {
+ public void doOpencontent(ObserveMainUI ui, TreePath path, Class<? extends ObserveContentUI<?, ?>> uiClass) {
ContentUIManager manager = ui.getContentUIManager();
@@ -160,7 +158,7 @@ public class ObserveMainUIHandler {
context.populateSelectedIds(selectedIds);
// on recherche l'ui (voir si elle existe déjà)
- ObserveContentUI<?> content = manager.getContent(uiClass);
+ ObserveContentUI<?, ?> content = manager.getContent(uiClass);
if (content == null) {
@@ -259,7 +257,7 @@ public class ObserveMainUIHandler {
public static final String H2_SERVER_URL_PATTERN = "jdbc:h2:%s/%s/obstuna";
public static void restartEdit() {
- ContentUI<?> selectedUI = ObserveSwingApplicationContext.get().getContentUIManager().getSelectedContentUI();
+ ContentUI<?, ?> selectedUI = ObserveSwingApplicationContext.get().getContentUIManager().getSelectedContentUI();
if (selectedUI == null) {
// pas d'écran selectionne
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/AbstractUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/AbstractUIAction.java
index 0feb166..ea9f4cd 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/AbstractUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/AbstractUIAction.java
@@ -23,16 +23,20 @@ package fr.ird.observe.application.swing.ui.actions.shared;
import fr.ird.observe.application.swing.db.DataContext;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
-import fr.ird.observe.application.swing.ui.content.ObserveContentUI;
-import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
+import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper;
+import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import jaxx.runtime.SwingUtil;
import javax.swing.AbstractAction;
import javax.swing.AbstractButton;
import javax.swing.Icon;
+import javax.swing.JComponent;
+import javax.swing.JPopupMenu;
import javax.swing.JTree;
import javax.swing.tree.TreePath;
+import java.awt.event.ActionEvent;
+import java.util.Objects;
import static org.nuiton.i18n.I18n.t;
@@ -69,12 +73,12 @@ public abstract class AbstractUIAction extends AbstractAction {
return actionId;
}
- public void initAction(ObserveContentUI<?> ui, AbstractButton editor) {
+ public void initAction(ContentUI<?, ?> ui, AbstractButton editor) {
editor.setAction(this);
editor.putClientProperty("mainUI", mainUI);
}
- public void updateAction(ObserveContentUI<?> ui, AbstractButton editor) {
+ public void updateAction(ContentUI<?, ?> ui, AbstractButton editor) {
editor.putClientProperty("ui", ui);
String tip = (String) editor.getClientProperty("toolTipText");
if (tip != null) {
@@ -109,4 +113,20 @@ public abstract class AbstractUIAction extends AbstractAction {
return tree.isCollapsed(activityPath);
}
+
+
+ protected ContentUI<?, ?> getContentUI(ActionEvent e) {
+ JComponent c = (JComponent) e.getSource();
+ ContentUI<?, ?> ui = (ContentUI<?, ?>) c.getClientProperty("ui");
+ Objects.requireNonNull(ui, "could not find client property ui on component" + c);
+ return ui;
+ }
+
+ protected JPopupMenu getPopup(ActionEvent e) {
+ JComponent c = (JComponent) e.getSource();
+ JPopupMenu ui = (JPopupMenu) c.getClientProperty("popup");
+ Objects.requireNonNull(ui, "could not find client property popup on component" + c);
+ return ui;
+ }
+
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CancelCreateUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CancelCreateUIAction.java
index 26288f0..3bf739c 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CancelCreateUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CancelCreateUIAction.java
@@ -25,7 +25,6 @@ import fr.ird.observe.application.swing.ui.ObserveMainUI;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
-import javax.swing.JComponent;
import javax.swing.SwingUtilities;
import java.awt.event.ActionEvent;
@@ -56,14 +55,7 @@ public class CancelCreateUIAction extends AbstractUIAction {
@Override
public void actionPerformed(final ActionEvent e) {
SwingUtilities.invokeLater(() -> {
- JComponent c = (JComponent) e.getSource();
- ContentUI<?> ui = (ContentUI<?>)
- c.getClientProperty("ui");
- if (ui == null) {
- throw new IllegalStateException(
- "could not find client property " +
- "ui on component" + c);
- }
+ ContentUI<?, ?> ui = getContentUI(e);
ui.stopEdit();
ObserveNode parentNode = ui.getTreeHelper().removeNode(ui.getTreeHelper().getSelectedNode());
ui.getTreeHelper().selectNode(parentNode);
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseAndCreateUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseAndCreateUIAction.java
index d2e1807..f26a4af 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseAndCreateUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseAndCreateUIAction.java
@@ -33,7 +33,6 @@ import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper;
import fr.ird.observe.services.dto.longline.ActivityLonglineDto;
import fr.ird.observe.services.dto.seine.ActivitySeineDto;
-import javax.swing.JComponent;
import javax.swing.JTree;
import javax.swing.SwingUtilities;
import javax.swing.tree.TreePath;
@@ -66,12 +65,8 @@ public class CloseAndCreateUIAction extends AbstractUIAction {
public void actionPerformed(final ActionEvent e) {
SwingUtilities.invokeLater(() -> {
- JComponent c = (JComponent) e.getSource();
- ContentUI<?> ui = (ContentUI<?>)
- c.getClientProperty("ui");
- if (ui == null) {
- throw new IllegalStateException("could not find client property ui on component" + c);
- }
+ ContentUI<?, ?> ui = getContentUI(e);
+
if (ui instanceof ContentOpenableUI) {
((ContentOpenableUI<?, ?>) ui).closeAndCreateData();
return;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseOpenUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseOpenUIAction.java
index 79d443f..fbdab1d 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseOpenUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseOpenUIAction.java
@@ -33,7 +33,6 @@ import fr.ird.observe.application.swing.ui.content.open.ContentOpenableUI;
import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper;
import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
-import javax.swing.JComponent;
import javax.swing.SwingUtilities;
import java.awt.event.ActionEvent;
@@ -64,11 +63,7 @@ public class CloseOpenUIAction extends AbstractUIAction {
public void actionPerformed(final ActionEvent e) {
SwingUtilities.invokeLater(() -> {
- JComponent c = (JComponent) e.getSource();
- ContentUI<?> ui = (ContentUI<?>) c.getClientProperty("ui");
- if (ui == null) {
- throw new IllegalStateException("could not find client property ui on component" + c);
- }
+ ContentUI<?, ?> ui = getContentUI(e);
if (ui instanceof ContentOpenableUI) {
((ContentOpenableUI<?, ?>) ui).closeData();
@@ -184,7 +179,7 @@ public class CloseOpenUIAction extends AbstractUIAction {
}
- private void closeData(ObserveSwingApplicationContext applicationContext, ContentUI<?> ui, String id) {
+ private void closeData(ObserveSwingApplicationContext applicationContext, ContentUI<?, ?> ui, String id) {
ObserveTreeHelper treeHelper = ui.getTreeHelper();
ObserveNode selectedNode = treeHelper.getSelectedNode();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteDataUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteDataUIAction.java
index a38808b..9f49e16 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteDataUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteDataUIAction.java
@@ -24,7 +24,6 @@ package fr.ird.observe.application.swing.ui.actions.shared;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
import fr.ird.observe.application.swing.ui.content.ContentUI;
-import javax.swing.JComponent;
import javax.swing.SwingUtilities;
import java.awt.event.ActionEvent;
@@ -59,18 +58,8 @@ public class DeleteDataUIAction extends AbstractUIAction {
SwingUtilities.invokeLater(() -> {
try {
-
- JComponent c = (JComponent) e.getSource();
- ContentUI<?> ui = (ContentUI<?>)
- c.getClientProperty("ui");
- if (ui == null) {
- throw new IllegalStateException(
- "could not find client property " +
- "ui on component" + c);
- }
-
-
- ui.delete();
+ ContentUI<?, ?> contentUI = getContentUI(e);
+ contentUI.delete();
} finally {
getMainUI().setBusy(false);
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteReferenceUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteReferenceUIAction.java
index 9ee10e5..4733b95 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteReferenceUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/DeleteReferenceUIAction.java
@@ -24,7 +24,6 @@ package fr.ird.observe.application.swing.ui.actions.shared;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
import fr.ird.observe.application.swing.ui.content.ContentUI;
-import javax.swing.JComponent;
import javax.swing.SwingUtilities;
import java.awt.event.ActionEvent;
@@ -56,15 +55,7 @@ public class DeleteReferenceUIAction extends AbstractUIAction {
public void actionPerformed(final ActionEvent e) {
SwingUtilities.invokeLater(() -> {
try {
- JComponent c = (JComponent) e.getSource();
-
- ContentUI<?> ui = (ContentUI<?>)
- c.getClientProperty("ui");
- if (ui == null) {
- throw new IllegalStateException(
- "could not find client property " +
- "ui on component" + c);
- }
+ ContentUI<?, ?> ui = getContentUI(e);
ui.delete();
} finally {
getMainUI().setBusy(false);
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/GoDownUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/GoDownUIAction.java
index e099e46..7fa5a03 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/GoDownUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/GoDownUIAction.java
@@ -22,10 +22,10 @@
package fr.ird.observe.application.swing.ui.actions.shared;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
-import fr.ird.observe.application.swing.ui.content.ObserveContentUI;
-import fr.ird.observe.application.swing.ui.tree.renderer.AbstractObserveTreeCellRenderer;
-import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
+import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper;
+import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
+import fr.ird.observe.application.swing.ui.tree.renderer.AbstractObserveTreeCellRenderer;
import javax.swing.AbstractButton;
import javax.swing.Action;
@@ -67,25 +67,19 @@ public class GoDownUIAction extends AbstractUIAction {
SwingUtilities.invokeLater(() -> {
JComponent c = (JComponent) e.getSource();
- JPopupMenu p = (JPopupMenu)
- c.getClientProperty("popup");
- if (p == null) {
- throw new IllegalStateException(
- "could not find client property " +
- "popup on component" + c);
- }
+ JPopupMenu p = getPopup(e);
p.show(c, 2, c.getHeight());
});
}
@Override
- public void initAction(ObserveContentUI<?> ui, AbstractButton editor) {
+ public void initAction(ContentUI<?, ?> ui, AbstractButton editor) {
super.initAction(ui, editor);
editor.putClientProperty("popup", getMainUI().getScopeDownPopup());
}
@Override
- public void updateAction(ObserveContentUI<?> ui, AbstractButton editor) {
+ public void updateAction(ContentUI<?, ?> ui, AbstractButton editor) {
ObserveMainUI mainUI = getMainUI();
ObserveTreeHelper treeHelper = getMainUI().getTreeHelper();
@@ -124,7 +118,7 @@ public class GoDownUIAction extends AbstractUIAction {
}
if (nodeOriginal.getChildCount() == 1 &&
- !nodeOriginal.getChildAt(0).isLeaf()) {
+ !nodeOriginal.getChildAt(0).isLeaf()) {
e = nodeOriginal.getChildAt(0).children();
while (e.hasMoreElements()) {
node = (ObserveNode) e.nextElement();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/GoUpUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/GoUpUIAction.java
index 49a3025..13624d4 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/GoUpUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/GoUpUIAction.java
@@ -22,10 +22,10 @@
package fr.ird.observe.application.swing.ui.actions.shared;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
-import fr.ird.observe.application.swing.ui.content.ObserveContentUI;
-import fr.ird.observe.application.swing.ui.tree.renderer.AbstractObserveTreeCellRenderer;
-import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
+import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper;
+import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
+import fr.ird.observe.application.swing.ui.tree.renderer.AbstractObserveTreeCellRenderer;
import javax.swing.AbstractButton;
import javax.swing.Action;
@@ -68,24 +68,19 @@ public class GoUpUIAction extends AbstractUIAction {
SwingUtilities.invokeLater(() -> {
JComponent c = (JComponent) e.getSource();
- JPopupMenu p = (JPopupMenu) c.getClientProperty("popup");
- if (p == null) {
- throw new IllegalStateException(
- "could not find client property " +
- "popup on component" + c);
- }
+ JPopupMenu p = getPopup(e);
p.show(c, 2, c.getHeight());
});
}
@Override
- public void initAction(ObserveContentUI<?> ui, AbstractButton editor) {
+ public void initAction(ContentUI<?, ?> ui, AbstractButton editor) {
super.initAction(ui, editor);
editor.putClientProperty("popup", getMainUI().getScopeUpPopup());
}
@Override
- public void updateAction(ObserveContentUI<?> ui, AbstractButton editor) {
+ public void updateAction(ContentUI<?, ?> ui, AbstractButton editor) {
super.updateAction(ui, editor);
ObserveTreeHelper treeHelper = getMainUI().getTreeHelper();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveActivityLonglinesUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveActivityLonglinesUIAction.java
index 8b43a71..7976691 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveActivityLonglinesUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveActivityLonglinesUIAction.java
@@ -28,8 +28,8 @@ import fr.ird.observe.application.swing.decoration.decorators.DataReferenceDecor
import fr.ird.observe.application.swing.ui.ObserveMainUI;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.content.list.impl.longline.ActivityLonglinesUI;
-import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper;
+import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import fr.ird.observe.application.swing.ui.tree.node.TripLonglineNode;
import fr.ird.observe.application.swing.ui.util.DecoratedNodeEntity;
import fr.ird.observe.services.dto.DataReference;
@@ -39,7 +39,6 @@ import fr.ird.observe.services.service.data.longline.ActivityLonglineService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import java.awt.event.ActionEvent;
@@ -80,15 +79,7 @@ public class MoveActivityLonglinesUIAction extends AbstractUIAction {
public void actionPerformed(final ActionEvent e) {
SwingUtilities.invokeLater(() -> {
- JComponent c = (JComponent) e.getSource();
- ContentUI<?> ui = (ContentUI<?>)
- c.getClientProperty("ui");
- if (ui == null) {
- throw new IllegalStateException(
- "could not find client property " +
- "ui on component" + c);
- }
-
+ ContentUI<?, ?> ui = getContentUI(e);
if (!(ui instanceof ActivityLonglinesUI)) {
throw new IllegalStateException("Can not come here!");
}
@@ -125,7 +116,7 @@ public class MoveActivityLonglinesUIAction extends AbstractUIAction {
}
- protected String chooseNewTripLongline(ContentUI<?> ui, ObserveNode oldTripLonglineNode) {
+ protected String chooseNewTripLongline(ContentUI<?, ?> ui, ObserveNode oldTripLonglineNode) {
ObserveNode programNode = oldTripLonglineNode.getParent();
String oldTripLonglineId = oldTripLonglineNode.getId();
int tripLonglineNb = programNode.getChildCount();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveActivitySeinesUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveActivitySeinesUIAction.java
index 0e14b48..622cff2 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveActivitySeinesUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveActivitySeinesUIAction.java
@@ -29,18 +29,15 @@ import fr.ird.observe.application.swing.ui.ObserveMainUI;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.content.list.impl.seine.ActivitySeinesUI;
import fr.ird.observe.application.swing.ui.content.list.impl.seine.ActivitySeinesUIModel;
-import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper;
+import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import fr.ird.observe.application.swing.ui.tree.node.RouteSeineNode;
import fr.ird.observe.application.swing.ui.util.DecoratedNodeEntity;
import fr.ird.observe.services.dto.DataReference;
import fr.ird.observe.services.dto.seine.ActivitySeineDto;
import fr.ird.observe.services.dto.seine.RouteDto;
import fr.ird.observe.services.service.data.seine.ActivitySeineService;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import java.awt.event.ActionEvent;
@@ -61,11 +58,6 @@ public class MoveActivitySeinesUIAction extends AbstractUIAction {
private static final long serialVersionUID = 1L;
- /**
- * Logger.
- */
- private static final Log log = LogFactory.getLog(MoveActivitySeinesUIAction.class);
-
public static final String ACTION_NAME = "moveActivitySeines";
public MoveActivitySeinesUIAction(ObserveMainUI mainUI) {
@@ -81,14 +73,7 @@ public class MoveActivitySeinesUIAction extends AbstractUIAction {
public void actionPerformed(final ActionEvent e) {
SwingUtilities.invokeLater(() -> {
- JComponent c = (JComponent) e.getSource();
- ContentUI<?> ui = (ContentUI<?>)
- c.getClientProperty("ui");
- if (ui == null) {
- throw new IllegalStateException(
- "could not find client property " +
- "ui on component" + c);
- }
+ ContentUI<?, ?> ui = getContentUI(e);
if (!(ui instanceof ActivitySeinesUI)) {
throw new IllegalStateException("Can not come here!");
@@ -107,7 +92,7 @@ public class MoveActivitySeinesUIAction extends AbstractUIAction {
List<DataReference<ActivitySeineDto>> selectedDatas = ((ActivitySeinesUIModel) ui.getModel()).getSelectedDatas();
List<String> activityIds = selectedDatas.stream()
.map(DataReference.ID_FUNCTION)
- .collect(Collectors.toList()) ;
+ .collect(Collectors.toList());
ActivitySeineService service = ObserveSwingApplicationContext.get().getMainDataSourceServicesProvider().newActivitySeineService();
List<Integer> positions = service.moveActivitySeinesToRoute(activityIds, routeId);
@@ -119,7 +104,7 @@ public class MoveActivitySeinesUIAction extends AbstractUIAction {
}
- protected String chooseNewRoute(ContentUI<?> ui, ObserveNode oldRouteNode) {
+ protected String chooseNewRoute(ContentUI<?, ?> ui, ObserveNode oldRouteNode) {
ObserveNode routesNode = oldRouteNode.getParent();
String oldRouteId = oldRouteNode.getId();
int routeNb = routesNode.getChildCount();
@@ -163,7 +148,7 @@ public class MoveActivitySeinesUIAction extends AbstractUIAction {
ObserveNode oldRouteNode = oldActivitiesNode.getParent();
ObserveNode routesNode = oldRouteNode.getParent();
- ObserveNode tripNode = routesNode.getParent();
+// ObserveNode tripNode = routesNode.getParent();
ObserveNode newRouteNode = treeHelper.getChild(routesNode, routeId);
String activitiesNodeId = ObserveI18nDecoratorHelper.getTypePluralI18nKey(ActivitySeineDto.class);
ObserveNode newActivitiesNode = treeHelper.getChild(newRouteNode, activitiesNodeId);
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveRoutesUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveRoutesUIAction.java
index c5179be..8fd275b 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveRoutesUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveRoutesUIAction.java
@@ -28,16 +28,14 @@ import fr.ird.observe.application.swing.decoration.decorators.DataReferenceDecor
import fr.ird.observe.application.swing.ui.ObserveMainUI;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.content.list.impl.seine.RoutesUI;
-import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper;
+import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import fr.ird.observe.application.swing.ui.tree.node.TripSeineNode;
import fr.ird.observe.application.swing.ui.util.DecoratedNodeEntity;
import fr.ird.observe.services.dto.DataReference;
import fr.ird.observe.services.dto.seine.RouteDto;
import fr.ird.observe.services.dto.seine.TripSeineDto;
import fr.ird.observe.services.service.data.seine.RouteService;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
@@ -60,11 +58,6 @@ public class MoveRoutesUIAction extends AbstractUIAction {
private static final long serialVersionUID = 1L;
- /**
- * Logger.
- */
- private static final Log log = LogFactory.getLog(MoveRoutesUIAction.class);
-
public static final String ACTION_NAME = "moveRoutes";
public MoveRoutesUIAction(ObserveMainUI mainUI) {
@@ -81,12 +74,9 @@ public class MoveRoutesUIAction extends AbstractUIAction {
SwingUtilities.invokeLater(() -> {
JComponent c = (JComponent) e.getSource();
- ContentUI<?> ui = (ContentUI<?>)
- c.getClientProperty("ui");
+ ContentUI<?, ?> ui = (ContentUI<?, ?>) c.getClientProperty("ui");
if (ui == null) {
- throw new IllegalStateException(
- "could not find client property " +
- "ui on component" + c);
+ throw new IllegalStateException("could not find client property ui on component" + c);
}
if (!(ui instanceof RoutesUI)) {
@@ -118,7 +108,7 @@ public class MoveRoutesUIAction extends AbstractUIAction {
}
- protected String chooseNewTripSeine(ContentUI<?> ui, ObserveNode oldTripSeineNode) {
+ protected String chooseNewTripSeine(ContentUI<?, ?> ui, ObserveNode oldTripSeineNode) {
ObserveNode programNode = oldTripSeineNode.getParent();
String oldTripSeineId = oldTripSeineNode.getId();
int tripSeineNb = programNode.getChildCount();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripLonglinesUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripLonglinesUIAction.java
index c70731d..bff6c8d 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripLonglinesUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripLonglinesUIAction.java
@@ -23,16 +23,14 @@ package fr.ird.observe.application.swing.ui.actions.shared;
*/
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
-import fr.ird.observe.services.dto.DataReference;
-import fr.ird.observe.services.dto.constants.GearType;
-import fr.ird.observe.services.dto.longline.TripLonglineDto;
-import fr.ird.observe.services.service.data.longline.TripLonglineService;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.content.list.impl.longline.TripLonglinesUI;
import fr.ird.observe.application.swing.ui.content.list.impl.longline.TripLonglinesUIModel;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import fr.ird.observe.services.dto.DataReference;
+import fr.ird.observe.services.dto.constants.GearType;
+import fr.ird.observe.services.dto.longline.TripLonglineDto;
+import fr.ird.observe.services.service.data.longline.TripLonglineService;
import java.util.ArrayList;
import java.util.List;
@@ -45,11 +43,6 @@ public class MoveTripLonglinesUIAction extends MoveTripsUIAction<TripLonglineDto
private static final long serialVersionUID = 1L;
- /**
- * Logger.
- */
- private static final Log log = LogFactory.getLog(MoveTripLonglinesUIAction.class);
-
public static final String ACTION_NAME = "moveTripLonglines";
public MoveTripLonglinesUIAction(ObserveMainUI mainUI) {
@@ -57,14 +50,14 @@ public class MoveTripLonglinesUIAction extends MoveTripsUIAction<TripLonglineDto
}
@Override
- protected void checkUIClass(ContentUI<?> ui) throws IllegalStateException {
+ protected void checkUIClass(ContentUI<?, ?> ui) throws IllegalStateException {
if (!(ui instanceof TripLonglinesUI)) {
throw new IllegalStateException("Can not come here!");
}
}
@Override
- protected GearType getGearType(ContentUI<?> ui) {
+ protected GearType getGearType(ContentUI<?, ?> ui) {
return GearType.longline;
}
@@ -75,7 +68,7 @@ public class MoveTripLonglinesUIAction extends MoveTripsUIAction<TripLonglineDto
}
@Override
- protected void updateModelData(ContentUI<?> ui) {
+ protected void updateModelData(ContentUI<?, ?> ui) {
TripLonglinesUI tripLonglinesUI = (TripLonglinesUI) ui;
TripLonglinesUIModel model = tripLonglinesUI.getModel();
List<DataReference<TripLonglineDto>> data = new ArrayList<>(model.getData());
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripSeinesUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripSeinesUIAction.java
index 5b19f83..4988af1 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripSeinesUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripSeinesUIAction.java
@@ -23,16 +23,14 @@ package fr.ird.observe.application.swing.ui.actions.shared;
*/
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
-import fr.ird.observe.services.dto.DataReference;
-import fr.ird.observe.services.dto.constants.GearType;
-import fr.ird.observe.services.dto.seine.TripSeineDto;
-import fr.ird.observe.services.service.data.seine.TripSeineService;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.content.list.impl.seine.TripSeinesUI;
import fr.ird.observe.application.swing.ui.content.list.impl.seine.TripSeinesUIModel;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import fr.ird.observe.services.dto.DataReference;
+import fr.ird.observe.services.dto.constants.GearType;
+import fr.ird.observe.services.dto.seine.TripSeineDto;
+import fr.ird.observe.services.service.data.seine.TripSeineService;
import java.util.ArrayList;
import java.util.List;
@@ -45,11 +43,6 @@ public class MoveTripSeinesUIAction extends MoveTripsUIAction<TripSeineDto> {
private static final long serialVersionUID = 1L;
- /**
- * Logger.
- */
- private static final Log log = LogFactory.getLog(MoveTripSeinesUIAction.class);
-
public static final String ACTION_NAME = "moveTripSeines";
public MoveTripSeinesUIAction(ObserveMainUI mainUI) {
@@ -57,14 +50,14 @@ public class MoveTripSeinesUIAction extends MoveTripsUIAction<TripSeineDto> {
}
@Override
- protected void checkUIClass(ContentUI<?> ui) throws IllegalStateException {
+ protected void checkUIClass(ContentUI<?,?> ui) throws IllegalStateException {
if (!(ui instanceof TripSeinesUI)) {
throw new IllegalStateException("Can not come here!");
}
}
@Override
- protected GearType getGearType(ContentUI<?> ui) {
+ protected GearType getGearType(ContentUI<?, ?> ui) {
return GearType.seine;
}
@@ -75,7 +68,7 @@ public class MoveTripSeinesUIAction extends MoveTripsUIAction<TripSeineDto> {
}
@Override
- protected void updateModelData(ContentUI<?> ui) {
+ protected void updateModelData(ContentUI<?, ?> ui) {
TripSeinesUI tripSeinesUI = (TripSeinesUI) ui;
TripSeinesUIModel model = tripSeinesUI.getModel();
List<DataReference<TripSeineDto>> data = new ArrayList<>(model.getData());
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripsUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripsUIAction.java
index 22ade74..e118785 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripsUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveTripsUIAction.java
@@ -23,20 +23,19 @@ package fr.ird.observe.application.swing.ui.actions.shared;
import fr.ird.observe.application.swing.ObserveOpenDataManager;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
-import fr.ird.observe.services.dto.DataDto;
-import fr.ird.observe.services.dto.DataReference;
-import fr.ird.observe.services.dto.constants.GearType;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.content.list.ContentListUIModel;
-import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper;
import fr.ird.observe.application.swing.ui.tree.menu.MoveTripNodeMenuPopulator;
+import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import fr.ird.observe.application.swing.ui.util.DecoratedNodeEntity;
+import fr.ird.observe.services.dto.DataDto;
+import fr.ird.observe.services.dto.DataReference;
+import fr.ird.observe.services.dto.constants.GearType;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import java.awt.event.ActionEvent;
@@ -77,15 +76,8 @@ public abstract class MoveTripsUIAction<T extends DataDto> extends AbstractUIAct
public void actionPerformed(final ActionEvent e) {
SwingUtilities.invokeLater(() -> {
- JComponent c = (JComponent) e.getSource();
- ContentUI<?> ui = (ContentUI<?>)
- c.getClientProperty("ui");
- if (ui == null) {
- throw new IllegalStateException(
- "could not find client property " +
- "ui on component" + c);
- }
+ ContentUI<?, ?> ui = getContentUI(e);
checkUIClass(ui);
// get current program id
@@ -111,9 +103,7 @@ public abstract class MoveTripsUIAction<T extends DataDto> extends AbstractUIAct
}
- protected String chooseNewProgram(ContentUI<?> ui, String oldProgramId) {
-
- ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get();
+ protected String chooseNewProgram(ContentUI<?, ?> ui, String oldProgramId) {
ObserveTreeHelper treeHelper = getMainUI().getTreeHelper();
@@ -141,7 +131,7 @@ public abstract class MoveTripsUIAction<T extends DataDto> extends AbstractUIAct
return decoratedProgram == null ? null : decoratedProgram.getId();
}
- protected void updateTree(ContentUI<?> ui,
+ protected void updateTree(ContentUI<?, ?> ui,
ObserveNode oldProgramNode,
String oldProgramId,
String programId,
@@ -186,12 +176,12 @@ public abstract class MoveTripsUIAction<T extends DataDto> extends AbstractUIAct
treeHelper.selectNode(newProgramNode);
}
- protected abstract void checkUIClass(ContentUI<?> ui) throws IllegalStateException;
+ protected abstract void checkUIClass(ContentUI<?, ?> ui) throws IllegalStateException;
- protected abstract GearType getGearType(ContentUI<?> ui);
+ protected abstract GearType getGearType(ContentUI<?, ?> ui);
protected abstract List<Integer> getPositions(List<String> tripIds, String programId);
- protected abstract void updateModelData(ContentUI<?> ui);
+ protected abstract void updateModelData(ContentUI<?, ?> ui);
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ReOpenUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ReOpenUIAction.java
index 7f5aa95..0a8a161 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ReOpenUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ReOpenUIAction.java
@@ -30,7 +30,6 @@ import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper;
import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import fr.ird.observe.services.dto.DataReference;
-import javax.swing.JComponent;
import javax.swing.SwingUtilities;
import java.awt.event.ActionEvent;
@@ -61,12 +60,7 @@ public class ReOpenUIAction extends AbstractUIAction {
@Override
public void actionPerformed(final ActionEvent e) {
SwingUtilities.invokeLater(() -> {
- JComponent c = (JComponent) e.getSource();
- ContentUI<?> ui = (ContentUI<?>) c.getClientProperty("ui");
-
- if (ui == null) {
- throw new IllegalStateException("could not find client property ui on component" + c);
- }
+ ContentUI<?, ?> ui = getContentUI(e);
ContentOpenableUI<?, ?> openUI;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ResetEditUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ResetEditUIAction.java
index be1d230..274ee60 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ResetEditUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ResetEditUIAction.java
@@ -24,10 +24,8 @@ package fr.ird.observe.application.swing.ui.actions.shared;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
import fr.ird.observe.application.swing.ui.content.ContentUI;
-import javax.swing.JComponent;
import javax.swing.SwingUtilities;
import java.awt.event.ActionEvent;
-import java.util.Objects;
import static org.nuiton.i18n.I18n.n;
@@ -56,10 +54,8 @@ public class ResetEditUIAction extends AbstractUIAction {
@Override
public void actionPerformed(final ActionEvent e) {
SwingUtilities.invokeLater(() -> {
- JComponent c = (JComponent) e.getSource();
- ContentUI<?> ui = (ContentUI<?>) c.getClientProperty("ui");
- Objects.requireNonNull(ui, "could not find client property ui on component" + c);
- ui.resetEdit();
+ ContentUI<?, ?> contentUI = getContentUI(e);
+ contentUI.resetEdit();
});
}
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SaveEditUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SaveEditUIAction.java
index e899b07..25b4a7a 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SaveEditUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SaveEditUIAction.java
@@ -24,7 +24,6 @@ package fr.ird.observe.application.swing.ui.actions.shared;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
import fr.ird.observe.application.swing.ui.content.ContentUI;
-import javax.swing.JComponent;
import javax.swing.SwingUtilities;
import java.awt.event.ActionEvent;
@@ -55,15 +54,8 @@ public class SaveEditUIAction extends AbstractUIAction {
@Override
public void actionPerformed(final ActionEvent e) {
SwingUtilities.invokeLater(() -> {
- JComponent c = (JComponent) e.getSource();
- ContentUI<?> ui = (ContentUI<?>)
- c.getClientProperty("ui");
- if (ui == null) {
- throw new IllegalStateException(
- "could not find client property " +
- "ui on component" + c);
- }
- ui.save(true);
+ ContentUI<?, ?> contentUI = getContentUI(e);
+ contentUI.save(true);
});
}
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SelectOpenNodeUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SelectOpenNodeUIAction.java
index 2e6594b..bc36961 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SelectOpenNodeUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/SelectOpenNodeUIAction.java
@@ -25,6 +25,7 @@ import fr.ird.observe.application.swing.ui.ObserveMainUI;
import javax.swing.JComponent;
import java.awt.event.ActionEvent;
+import java.util.Objects;
/**
* Action pour sélectionner un noeud (attaché à l'éditeur) dans l'arbre de
@@ -48,11 +49,7 @@ public class SelectOpenNodeUIAction extends AbstractUIAction {
JComponent c = (JComponent) e.getSource();
Class<?> type = (Class<?>) c.getClientProperty("type");
- if (type == null) {
- throw new IllegalStateException(
- "could not find client property " +
- "type on component" + c);
- }
+ Objects.requireNonNull(type, "could not find client property type on component" + c);
getMainUI().getTreeHelper().selectOpenNode(type);
}
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUI.jaxx
index 5edae7b..9b002c3 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUI.jaxx
@@ -21,7 +21,7 @@
-->
<org.jdesktop.swingx.JXTitledPanel
- abstract='true' genericType='E extends IdDto' implements="fr.ird.observe.application.swing.ui.content.ObserveContentUI<E>"
+ abstract='true' genericType='E extends IdDto, U extends ContentUI<E, U>' implements="fr.ird.observe.application.swing.ui.content.ObserveContentUI<E, U>"
title='{getHandler().updateTitle(getContentTitle())}'
contentContainer='{contentContainer}'
leftDecoration='{titleLeft}'
@@ -65,9 +65,9 @@
<ObserveTreeHelper id='treeHelper' initializer='getContextValue(ObserveTreeHelper.class)'/>
- <ContentUIModel id='model' genericType='E' initializer='ContentUIModel.newModel(this)'/>
+ <ContentUIModel id='model' genericType='E' initializer='ContentUIModel.newModel((U) this)'/>
- <ContentUIHandler id='handler' genericType='E' initializer='ContentUIHandler.newHandler(this)'/>
+ <ContentUIHandler id='handler' genericType='E, U' initializer='ContentUIHandler.newHandler((U) this)'/>
<IdDto id='bean' initializer='model.getBean()'/>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIHandler.java
index 6e977d8..f19ecba 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIHandler.java
@@ -42,7 +42,6 @@ import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import fr.ird.observe.application.swing.ui.tree.renderer.AbstractObserveTreeCellRenderer;
import fr.ird.observe.application.swing.ui.util.SpringUtilities;
import fr.ird.observe.application.swing.validation.ValidationContext;
-import fr.ird.observe.services.dto.AbstractObserveDto;
import fr.ird.observe.services.dto.DataDto;
import fr.ird.observe.services.dto.DataReference;
import fr.ird.observe.services.dto.Form;
@@ -106,7 +105,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.4
*/
-public abstract class ContentUIHandler<E extends IdDto> {
+public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U>> {
/** Logger */
static private final Log log = LogFactory.getLog(ContentUIHandler.class);
@@ -120,16 +119,16 @@ public abstract class ContentUIHandler<E extends IdDto> {
private final Icon errorIcon;
/** l'interface graphique que le controleur utilise */
- protected final ObserveContentUI<E> ui;
+ protected final U ui;
- static <E extends IdDto> ContentUIHandler<E> newHandler(ObserveContentUI<E> ui) {
+ static <E extends IdDto, U extends ContentUI<E, U>> ContentUIHandler<E, U> newHandler(U ui) {
String uiName = ui.getClass().getName();
String modelName = uiName + "Handler";
try {
- Class<ContentUIHandler<E>> handlerClass = (Class<ContentUIHandler<E>>) Class.forName(modelName);
+ Class<ContentUIHandler<E, U>> handlerClass = (Class) Class.forName(modelName);
return ConstructorUtils.invokeConstructor(handlerClass, ui);
} catch (Exception e) {
@@ -147,9 +146,9 @@ public abstract class ContentUIHandler<E extends IdDto> {
* @return {@code true} if ui can be safelty closed, {@code false}
* otherwise.
*/
- protected static boolean checkEdit(ObserveContentUI<?> ui) {
+ protected static <E extends IdDto, U extends ContentUI<E, U>> boolean checkEdit(U ui) {
- ContentUIModel<? extends AbstractObserveDto> model = ui.getModel();
+ ContentUIModel<E> model = ui.getModel();
if (model.isCreatingMode()) {
@@ -185,7 +184,7 @@ public abstract class ContentUIHandler<E extends IdDto> {
if (model.isValid()) {
// ask user if wants to save
int reponse = UIHelper.askUser(
- (JComponent) ui,
+ ui,
t("observe.title.need.confirm"),
t("observe.message.quit.valid.edit"),
JOptionPane.WARNING_MESSAGE,
@@ -216,7 +215,7 @@ public abstract class ContentUIHandler<E extends IdDto> {
} else {
// ask user if wants to quit without saving since edit is not valid
int reponse = UIHelper.askUser(
- (JComponent) ui,
+ ui,
t("observe.title.need.confirm"),
t("observe.message.quit.invalid.edit"),
JOptionPane.ERROR_MESSAGE,
@@ -245,22 +244,22 @@ public abstract class ContentUIHandler<E extends IdDto> {
return wasClosed;
}
- public static void addMessage(ObserveContentUI<?> ui, NuitonValidatorScope scope, String fieldName, String message) {
+ public static <E extends IdDto, U extends ContentUI<E,U>> void addMessage(U ui, NuitonValidatorScope scope, String fieldName, String message) {
SwingValidatorMessageTableModel model = ui.getErrorTableModel();
- model.addMessages((JComponent) ui, fieldName, scope, message);
+ model.addMessages(ui, fieldName, scope, message);
}
- public static void removeAllMessages(ContentUI<?> ui, NuitonValidatorScope scope, String fieldName) {
+ public static <E extends IdDto, U extends ContentUI<E,U>>void removeAllMessages(U ui, NuitonValidatorScope scope, String fieldName) {
SwingValidatorMessageTableModel model = ui.getErrorTableModel();
model.removeMessages(ui, fieldName, scope);
}
- protected static void removeAllMessages(ObserveContentUI<?> ui) {
+ protected static <E extends IdDto, U extends ContentUI<E,U>> void removeAllMessages(U ui) {
SwingValidatorMessageTableModel model = ui.getErrorTableModel();
- model.removeMessages((JComponent) ui, null);
+ model.removeMessages(ui, null);
}
- public ContentUIHandler(ObserveContentUI<E> ui, DataContextType parentType, DataContextType type) {
+ public ContentUIHandler(U ui, DataContextType parentType, DataContextType type) {
this.ui = ui;
this.parentType = parentType;
this.type = type;
@@ -277,7 +276,7 @@ public abstract class ContentUIHandler<E extends IdDto> {
}
}
- public ObserveContentUI<E> getUi() {
+ public final U getUi() {
return ui;
}
@@ -300,11 +299,11 @@ public abstract class ContentUIHandler<E extends IdDto> {
public void initUI() {
- final ContentUIInitializer<E, ObserveContentUI<E>> uiInitializer = new ContentUIInitializer<>(ui);
- uiInitializer.initUI();
+ new ContentUIInitializer<>(ui).initUI();
getModel().addPropertyChangeListener(ContentUIModel.PROPERTY_FORM, evt -> updateUiWithReferenceSetsFromModel());
+ ObserveSwingApplicationContext.get().getFocusManager().setFocusTraversalPolicy(ui);
}
public void openUI() {
@@ -761,7 +760,7 @@ public abstract class ContentUIHandler<E extends IdDto> {
}
protected void updateToolbarActions() {
- ObserveContentUI<E> ui = getUi();
+ U ui = getUi();
JToolBar toolBar = ui.getTitleRightToolBar();
Component[] components = toolBar.getComponents();
for (Component component : components) {
@@ -783,7 +782,7 @@ public abstract class ContentUIHandler<E extends IdDto> {
Icon updateModeIcon(ContentMode mode) {
Icon icon = null;
if (mode != null) {
- icon = (Icon) ((JComponent) ui).getClientProperty(mode.name() + "Icon");
+ icon = (Icon) ui.getClientProperty(mode.name() + "Icon");
}
return icon;
}
@@ -791,7 +790,7 @@ public abstract class ContentUIHandler<E extends IdDto> {
String updateModeTip(ContentMode mode) {
String tip = null;
if (mode != null) {
- tip = (String) ((JComponent) ui).getClientProperty(mode.name() + "Tip");
+ tip = (String) ui.getClientProperty(mode.name() + "Tip");
}
return tip;
}
@@ -1167,26 +1166,4 @@ public abstract class ContentUIHandler<E extends IdDto> {
popup.show(button, x, y);
}
-
-// protected static class LogPropertyChanges implements PropertyChangeListener {
-//
-// private final ImmutableSet<String> propertyNames;
-//
-// public LogPropertyChanges(ImmutableSet<String> propertyNames) {
-// this.propertyNames = propertyNames;
-// }
-//
-// @Override
-// public void propertyChange(PropertyChangeEvent evt) {
-//
-// if (propertyNames.contains(evt.getPropertyName())) {
-// if (log.isInfoEnabled()) {
-// log.info(String.format("Property %s changed (%s → %s)", evt.getPropertyName(), evt.getOldValue(), evt.getNewValue()));
-// }
-//
-// }
-//
-// }
-//
-// }
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java
index 3cc59b2..97ac366 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java
@@ -117,7 +117,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.7
*/
-public class ContentUIInitializer<E extends IdDto, UI extends ObserveContentUI<E>> {
+public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>> {
public static final String OBSERVE_ACTION = "observeAction";
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIManager.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIManager.java
index 4cbebde..1e70471 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIManager.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIManager.java
@@ -121,7 +121,7 @@ public class ContentUIManager {
/** Logger */
static private final Log log = LogFactory.getLog(ContentUIManager.class);
- private final Map<String, Class<? extends ObserveContentUI<?>>> mapping;
+ private final Map<String, Class<? extends ObserveContentUI<?, ?>>> mapping;
public ContentUIManager() {
@@ -191,7 +191,7 @@ public class ContentUIManager {
}
- public Class<? extends ObserveContentUI<?>> convertNodeToContentUI(ObserveNode node) {
+ public Class<? extends ObserveContentUI<?, ?>> convertNodeToContentUI(ObserveNode node) {
if (log.isDebugEnabled()) {
log.debug("Entrer for node = " + node);
}
@@ -230,7 +230,7 @@ public class ContentUIManager {
return mapping.get(mappingKey);
}
- public <U extends ObserveContentUI<?>> U getContent(Class<U> uiClass) {
+ public <U extends ObserveContentUI<?, ?>> U getContent(Class<U> uiClass) {
CardLayout2 layout = getLayout();
JPanel layoutContent = getLayoutContent();
@@ -250,7 +250,7 @@ public class ContentUIManager {
return content;
}
- public <U extends ObserveContentUI<?>> U createContent(Class<U> uiClass) {
+ public <U extends ObserveContentUI<?, ?>> U createContent(Class<U> uiClass) {
String constraints = uiClass.getName();
@@ -286,12 +286,12 @@ public class ContentUIManager {
}
}
- public ObserveContentUI<?> getCurrentContent() {
- return (ObserveContentUI<?>)
+ public ObserveContentUI<?, ?> getCurrentContent() {
+ return (ObserveContentUI<?, ?>)
getLayout().getVisibleComponent(getLayoutContent());
}
- public void openContent(ObserveContentUI<?> content) {
+ public void openContent(ObserveContentUI<?, ?> content) {
String constraints = content.getClass().getName();
@@ -320,7 +320,7 @@ public class ContentUIManager {
getLayout().reset(getLayoutContent());
}
- public ContentUI<?> getSelectedContentUI() {
+ public ContentUI<?, ?> getSelectedContentUI() {
return getSelectedContentUI(getMainUI());
}
@@ -337,7 +337,7 @@ public class ContentUIManager {
* @since 1.5
*/
public boolean closeSelectedContentUI(ObserveMainUI mainUI) {
- ContentUI<?> ui = getSelectedContentUI(mainUI);
+ ContentUI<?, ?> ui = getSelectedContentUI(mainUI);
if (ui == null) {
// no content ui
return true;
@@ -384,20 +384,20 @@ public class ContentUIManager {
return ObserveSwingApplicationContext.get().getMainUI();
}
- private ContentUI<?> getSelectedContentUI(ObserveMainUI ui) {
+ private ContentUI<?, ?> getSelectedContentUI(ObserveMainUI ui) {
if (ui == null) {
// no ui, so no modification
return null;
}
- ContentUI<?> result = null;
+ ContentUI<?, ?> result = null;
CardLayout2 layout = ui.getContentLayout();
JPanel container = ui.getContent();
Component currentContent = layout.getVisibleComponent(container);
- if (currentContent != null && currentContent instanceof ContentUI<?>) {
+ if (currentContent != null && currentContent instanceof ContentUI<?, ?>) {
- result = (ContentUI<?>) currentContent;
+ result = (ContentUI<?, ?>) currentContent;
}
return result;
}
@@ -409,7 +409,7 @@ public class ContentUIManager {
if (log.isDebugEnabled()) {
log.debug("Add key: " + key + " → " + contentClass.getName());
}
- mapping.put(key, (Class<? extends ContentUI<?>>) contentClass);
+ mapping.put(key, (Class<? extends ContentUI<?, ?>>) contentClass);
}
private String getMappingKey(String prefix, Class<?> klass, String context) {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIModel.java
index 883d57c..7ac6e1e 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIModel.java
@@ -106,14 +106,14 @@ public abstract class ContentUIModel<E extends IdDto> extends AbstractSerializab
*/
protected ImmutableMap<String, DataReferenceSet<?>> dataReferenceSetsByPropertyName = ImmutableMap.of();
- public static <E extends IdDto> ContentUIModel<E> newModel(ObserveContentUI<E> ui) {
+ public static <E extends IdDto, U extends ContentUI<E, U>> ContentUIModel<E> newModel(U ui) {
String uiName = ui.getClass().getName();
String modelName = uiName + "Model";
try {
- Class<ContentUIModel<E>> modelClass = (Class<ContentUIModel<E>>) Class.forName(modelName);
+ Class<ContentUIModel<E>> modelClass = (Class) Class.forName(modelName);
return modelClass.newInstance();
} catch (Exception e) {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ObserveContentUI.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ObserveContentUI.java
index 37d5eb5..cdc2fca 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ObserveContentUI.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ObserveContentUI.java
@@ -38,7 +38,7 @@ import javax.swing.JToolBar;
* @author Tony Chemit - chemit(a)codelutin.com
* @since XXX
*/
-public interface ObserveContentUI<E extends IdDto> extends JAXXObject {
+public interface ObserveContentUI<E extends IdDto, U extends ContentUI<E, U>> extends JAXXObject {
String CLIENT_PROPERTY_FORCE_LOAD = "forceLoad";
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ObserveFocusManager.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ObserveFocusManager.java
new file mode 100644
index 0000000..c649f10
--- /dev/null
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ObserveFocusManager.java
@@ -0,0 +1,1337 @@
+package fr.ird.observe.application.swing.ui.content;
+
+import com.google.common.collect.ImmutableMap;
+import fr.ird.observe.application.swing.ui.content.impl.longline.LonglineDetailCompositionUI;
+import fr.ird.observe.application.swing.ui.content.impl.longline.SetLonglineUI;
+import fr.ird.observe.application.swing.ui.content.impl.seine.FloatingObjectTransmittingBuoyOperationUI;
+import fr.ird.observe.application.swing.ui.content.impl.seine.FloatingObjectUI;
+import fr.ird.observe.application.swing.ui.content.impl.seine.SetSeineUI;
+import fr.ird.observe.application.swing.ui.content.list.ContentListUI;
+import fr.ird.observe.application.swing.ui.content.open.impl.longline.ActivityLonglineUI;
+import fr.ird.observe.application.swing.ui.content.open.impl.longline.TripLonglineUI;
+import fr.ird.observe.application.swing.ui.content.open.impl.seine.ActivitySeineUI;
+import fr.ird.observe.application.swing.ui.content.open.impl.seine.RouteUI;
+import fr.ird.observe.application.swing.ui.content.open.impl.seine.TripSeineUI;
+import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI;
+import fr.ird.observe.application.swing.ui.content.ref.ReferenceHomeUI;
+import fr.ird.observe.application.swing.ui.content.ref.impl.GearUI;
+import fr.ird.observe.application.swing.ui.content.ref.impl.LengthLengthParameterUI;
+import fr.ird.observe.application.swing.ui.content.ref.impl.LengthWeightParameterUI;
+import fr.ird.observe.application.swing.ui.content.ref.impl.ProgramUI;
+import fr.ird.observe.application.swing.ui.content.ref.impl.SpeciesListUI;
+import fr.ird.observe.application.swing.ui.content.ref.impl.SpeciesUI;
+import fr.ird.observe.application.swing.ui.content.ref.impl.VesselUI;
+import fr.ird.observe.application.swing.ui.content.ref.impl.seine.WeightCategoryUI;
+import fr.ird.observe.application.swing.ui.content.table.ContentTableUI;
+import fr.ird.observe.application.swing.ui.content.table.impl.longline.CatchLonglineUI;
+import fr.ird.observe.application.swing.ui.content.table.impl.longline.EncounterUI;
+import fr.ird.observe.application.swing.ui.content.table.impl.longline.GearUseFeaturesLonglineUI;
+import fr.ird.observe.application.swing.ui.content.table.impl.longline.SensorUsedUI;
+import fr.ird.observe.application.swing.ui.content.table.impl.longline.TdrUI;
+import fr.ird.observe.application.swing.ui.content.table.impl.seine.GearUseFeaturesSeineUI;
+import fr.ird.observe.application.swing.ui.content.table.impl.seine.NonTargetCatchUI;
+import fr.ird.observe.application.swing.ui.content.table.impl.seine.NonTargetSampleUI;
+import fr.ird.observe.application.swing.ui.content.table.impl.seine.ObjectObservedSpeciesUI;
+import fr.ird.observe.application.swing.ui.content.table.impl.seine.ObjectSchoolEstimateUI;
+import fr.ird.observe.application.swing.ui.content.table.impl.seine.SchoolEstimateUI;
+import fr.ird.observe.application.swing.ui.content.table.impl.seine.TargetCatchUI;
+import fr.ird.observe.application.swing.ui.content.table.impl.seine.TargetDiscardCatchUI;
+import fr.ird.observe.application.swing.ui.content.table.impl.seine.TargetSampleUI;
+
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JSpinner;
+import javax.swing.LayoutFocusTraversalPolicy;
+import java.awt.Component;
+import java.awt.Container;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.function.Supplier;
+
+/**
+ * Created on 09/11/16.
+ *
+ * @author Tony Chemit - chemit(a)codelutin.com
+ * @since 5.1
+ */
+public class ObserveFocusManager {
+
+ private final ImmutableMap<Class<? extends ContentUI>, ObserveLayoutFocusTraversalPolicy> policies;
+
+ public <U extends ContentUI> void setFocusTraversalPolicy(U ui) {
+ Objects.requireNonNull(ui);
+ Class<? extends ContentUI> uiClass = ui.getClass();
+ if (ui instanceof ContentListUI) {
+ uiClass = ContentListUI.class;
+ }
+ ObserveLayoutFocusTraversalPolicy policy = policies.get(uiClass);
+ if (policy == null && ui instanceof ContentReferenceUI) {
+ uiClass = ContentReferenceUI.class;
+ policy = policies.get(uiClass);
+ }
+
+ Objects.requireNonNull(policy, "Could not focus traversal policy for ui: " + ui.getClass().getName());
+ ui.setFocusCycleRoot(true);
+ policy.setUiSupplier(() -> ui);
+ ui.setFocusTraversalPolicy(policy);
+ }
+
+ public ObserveFocusManager() {
+
+ ImmutableMap.Builder<Class<? extends ContentUI>, ObserveLayoutFocusTraversalPolicy> builder = ImmutableMap.builder();
+
+ builder.put(LonglineDetailCompositionUI.class, new ObserveLayoutFocusTraversalPolicy<LonglineDetailCompositionUI>() {
+
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ LonglineDetailCompositionUI ui = getUi();
+ int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
+ if (selectedIndex == 2) {
+ if (aComponent.equals(ui.getBranchlineDetailUI().getTopType().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ if (aComponent.equals(ui.getBranchlineDetailUI().getHookType().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ LonglineDetailCompositionUI ui = getUi();
+ int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
+ if (selectedIndex == 2) {
+ int subSelectedIndex = ui.getBranchlineDetailUI().getFishingOperationTabPane().getSelectedIndex();
+ switch (subSelectedIndex) {
+ case 0:
+ return ui.getBranchlineDetailUI().getTopType();
+ case 1:
+ return ui.getBranchlineDetailUI().getHookType();
+ }
+ }
+ return super.getFirstComponent(aContainer);
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+
+ LonglineDetailCompositionUI ui = getUi();
+ if (ui.getSave().isEnabled()) {
+ return ui.getSave();
+ }
+ if (ui.getReset().isEnabled()) {
+ return ui.getReset();
+ }
+ int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
+ if (selectedIndex == 2) {
+ ui.getBranchlineDetailUI().getComment2();
+ }
+ return super.getLastComponent(aContainer);
+ }
+ });
+
+ builder.put(SetLonglineUI.class, new ObserveLayoutFocusTraversalPolicy<SetLonglineUI>() {
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ SetLonglineUI ui = getUi();
+ int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ return ui.getHomeId();
+ case 1:
+ return ui.getSettingShape();
+ case 2:
+ return ui.getHaulingDirectionSameAsSetting();
+ }
+ return super.getFirstComponent(aContainer);
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ return getUi().getDelete();
+ }
+
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ SetLonglineUI ui = getUi();
+ if (aComponent.equals(ui.getHomeId())) {
+ return getLastComponent(aContainer);
+ }
+ if (aComponent.equals(ui.getHaulingDirectionSameAsSetting())) {
+ return getLastComponent(aContainer);
+ }
+ if (aComponent.equals(ui.getSettingShape().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+ });
+ builder.put(FloatingObjectTransmittingBuoyOperationUI.class, new ObserveLayoutFocusTraversalPolicy<FloatingObjectTransmittingBuoyOperationUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+
+ if (aComponent.equals(getUi().getTypeOperation())) {
+ return getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ return getUi().getTypeOperation();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ FloatingObjectTransmittingBuoyOperationUI ui = getUi();
+ if (ui.getSave().isEnabled()) {
+ return ui.getSave();
+ }
+ if (ui.getReset().isEnabled()) {
+ return ui.getReset();
+ }
+ return ui.getComment2();
+ }
+
+ });
+
+ builder.put(SetSeineUI.class, new ObserveLayoutFocusTraversalPolicy<SetSeineUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ SetSeineUI ui = getUi();
+ int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ if (aComponent.getParent().equals(ui.getStartTime().getHourEditor().getEditor())) {
+ return getLastComponent(aContainer);
+ }
+ case 1:
+ if (aComponent.equals(ui.getSchoolThickness().getTextField())) {
+ return getLastComponent(aContainer);
+ }
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ SetSeineUI ui = getUi();
+ int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ JComponent editor = ui.getStartTime().getHourEditor().getEditor();
+ return ((JSpinner.DateEditor) editor).getTextField();
+ case 1:
+ return ui.getSchoolThickness();
+ }
+ return super.getFirstComponent(aContainer);
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ SetSeineUI ui = getUi();
+ if (ui.getDelete().isVisible() && ui.getDelete().isEnabled()) {
+ return ui.getDelete();
+ }
+ if (ui.getSave().isEnabled()) {
+ return ui.getSave();
+ }
+ return ui.getReset();
+ }
+ });
+
+ builder.put(FloatingObjectUI.class, new ObserveLayoutFocusTraversalPolicy<FloatingObjectUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ FloatingObjectUI ui = getUi();
+ if (aComponent.equals(ui.getObjectOperation().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ return getUi().getObjectOperation();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ FloatingObjectUI ui = getUi();
+ if (ui.getDelete().isVisible() && ui.getDelete().isEnabled()) {
+ return ui.getDelete();
+ }
+ if (ui.getSave().isEnabled()) {
+ return ui.getSave();
+ }
+ return ui.getReset();
+ }
+ });
+
+ builder.put(ContentListUI.class, new ObserveLayoutFocusTraversalPolicy<ContentListUI>() {
+
+ private List<JComponent> actions;
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ return getUi().getList();
+ }
+
+ public List<JComponent> getActions() {
+ if (actions == null) {
+
+ actions = new ArrayList<>();
+ actions.add(getUi().getGotoSelectedChild());
+ actions.add(getUi().getReopenChild());
+ actions.add(getUi().getCloseChild());
+ actions.add(getUi().getGotoOpenChild());
+ actions.add(getUi().getGotoOpenChild2());
+ actions.add(getUi().getCreateChild());
+ for (Component component : getUi().getExtraActions().getComponents()) {
+ if (component instanceof JButton) {
+ actions.add((JComponent) component);
+ }
+ }
+ actions.add(getUi().getMoveSelectedChildren());
+
+ }
+ List<JComponent> result = new ArrayList<>(actions);
+ Collections.reverse(result);
+ return result;
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ Optional<JComponent> optional = getActions().stream().filter(a -> a.isEnabled() && a.isVisible()).findFirst();
+ return optional.isPresent() ? optional.get() : super.getLastComponent(aContainer);
+ }
+
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ if (aComponent.equals(getUi().getList())) {
+ return getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ });
+
+ builder.put(TripLonglineUI.class, new ObserveLayoutFocusTraversalPolicy<TripLonglineUI>() {
+
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ TripLonglineUI ui = getUi();
+ if (aComponent.equals(ui.getTripType().getCombobox().getEditor().getEditorComponent())) {
+ if (ui.getCloseAndCreate().isEnabled()) {
+ return ui.getCloseAndCreate();
+ }
+ return ui.getDelete();
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getComponentAfter(Container aContainer, Component aComponent) {
+ TripLonglineUI ui = getUi();
+ if (!ui.getCloseAndCreate().isEnabled() && aComponent.equals(ui.getDelete())) {
+
+ // retour au début
+ return ui.getTripType();
+ }
+ if (aComponent.equals(ui.getCloseAndCreate())) {
+
+ // retour au début
+ return ui.getTripType();
+ }
+ return super.getComponentAfter(aContainer, aComponent);
+ }
+ });
+ builder.put(ActivityLonglineUI.class, new ObserveLayoutFocusTraversalPolicy<ActivityLonglineUI>() {
+
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ ActivityLonglineUI ui = getUi();
+ if (aComponent.equals(ui.getTimeStamp().getDayDateEditor().getEditor())) {
+ if (ui.getCloseAndCreate().isEnabled()) {
+ return ui.getCloseAndCreate();
+ }
+ return ui.getDelete();
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getComponentAfter(Container aContainer, Component aComponent) {
+ ActivityLonglineUI ui = getUi();
+ if (!ui.getCloseAndCreate().isEnabled() && aComponent.equals(ui.getDelete())) {
+
+ // retour au début
+ return ui.getTimeStamp().getDayDateEditor().getEditor();
+ }
+ if (aComponent.equals(ui.getCloseAndCreate())) {
+
+ // retour au début
+ return ui.getTimeStamp().getDayDateEditor().getEditor();
+ }
+ return super.getComponentAfter(aContainer, aComponent);
+ }
+ });
+ builder.put(ActivitySeineUI.class, new ObserveLayoutFocusTraversalPolicy<ActivitySeineUI>() {
+
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ ActivitySeineUI ui = getUi();
+ int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ if (aComponent.getParent().equals(ui.getTime().getHourEditor().getEditor())) {
+ if (ui.getCloseAndCreate().isEnabled()) {
+ return ui.getCloseAndCreate();
+ }
+ return ui.getDelete();
+ }
+ break;
+ case 1:
+ if (aComponent.equals(ui.getVesselSpeed().getTextField())) {
+ return getLastComponent(aContainer);
+ }
+ case 2:
+ if (aComponent.equals(ui.getObservedSystem().getUniverseList())) {
+ return getLastComponent(aContainer);
+ }
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ ActivitySeineUI ui = getUi();
+ int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ JComponent editor = ui.getTime().getHourEditor().getEditor();
+ return ((JSpinner.DateEditor) editor).getTextField();
+ case 1:
+ return ui.getVesselSpeed();
+ case 2:
+ return ui.getObservedSystem().getUniverseList();
+ }
+ return super.getFirstComponent(aContainer);
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ ActivitySeineUI ui = getUi();
+ if (ui.getModel().isCreatingMode()) {
+ if (ui.getSave().isEnabled()) {
+ return ui.getSave();
+ }
+ return ui.getReset();
+ } else
+ return ui.getCloseAndCreate();
+ }
+ });
+
+ builder.put(TripSeineUI.class, new ObserveLayoutFocusTraversalPolicy<TripSeineUI>() {
+
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ TripSeineUI ui = getUi();
+ if (aComponent.equals(ui.getCaptain().getCombobox().getEditor().getEditorComponent())) {
+ if (ui.getCloseAndCreate().isEnabled()) {
+ return ui.getCloseAndCreate();
+ }
+ return ui.getDelete();
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getComponentAfter(Container aContainer, Component aComponent) {
+ TripSeineUI ui = getUi();
+ if (!ui.getCloseAndCreate().isEnabled() && aComponent.equals(ui.getDelete())) {
+
+ // retour au début
+ return ui.getCaptain();
+ }
+ if (aComponent.equals(ui.getCloseAndCreate())) {
+
+ // retour au début
+ return ui.getCaptain();
+ }
+ return super.getComponentAfter(aContainer, aComponent);
+ }
+ });
+ builder.put(RouteUI.class, new ObserveLayoutFocusTraversalPolicy<RouteUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ RouteUI ui = getUi();
+ if (aComponent.equals(ui.getDate().getEditor())) {
+ if (ui.getCloseAndCreate().isEnabled()) {
+ return ui.getCloseAndCreate();
+ }
+ return ui.getDelete();
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getComponentAfter(Container aContainer, Component aComponent) {
+ RouteUI ui = getUi();
+ if (!ui.getCloseAndCreate().isEnabled() && aComponent.equals(ui.getDelete())) {
+
+ // retour au début
+ return ui.getDate();
+ }
+ if (aComponent.equals(ui.getCloseAndCreate())) {
+
+ // retour au début
+ return ui.getDate();
+ }
+ return super.getComponentAfter(aContainer, aComponent);
+ }
+ });
+ builder.put(TdrUI.class, new ObserveLayoutFocusTraversalPolicy<TdrUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ TdrUI ui = getUi();
+ int selectedIndex = ui.getEditTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ if (aComponent.equals(ui.getHomeId())) {
+ return getLastComponent(aContainer);
+ }
+ case 1:
+ if (aComponent.equals(ui.getSection().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ case 2:
+ if (aComponent.equals(ui.getEnableTimestamp())) {
+ return getLastComponent(aContainer);
+ }
+ case 3:
+ if (aComponent.equals(ui.getFishingStartDepth())) {
+ return getLastComponent(aContainer);
+ }
+ case 4:
+ if (aComponent.equals(ui.getSpecies().getUniverseList())) {
+ return getLastComponent(aContainer);
+ }
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ TdrUI ui = getUi();
+ int selectedIndex = ui.getEditTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ return ui.getHomeId();
+ case 1:
+ return ui.getSection();
+ case 2:
+ return ui.getEnableTimestamp();
+ case 3:
+ return ui.getFishingStartDepth();
+ case 4:
+ return ui.getSpecies().getUniverseList();
+ }
+ return super.getFirstComponent(aContainer);
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ TdrUI ui = getUi();
+ if (ui.getSave().isEnabled()) {
+ return ui.getSave();
+ }
+ if (ui.getReset().isEnabled()) {
+ return ui.getReset();
+ }
+ if (ui.getDeleteEntry().isEnabled()) {
+ return ui.getDeleteEntry();
+ }
+ if (ui.getSaveNewEntry().isEnabled()) {
+ return ui.getSaveNewEntry();
+ }
+ if (ui.getResetEntry().isEnabled()) {
+ return ui.getResetEntry();
+ }
+
+ return super.getLastComponent(aContainer);
+ }
+ });
+ builder.put(SensorUsedUI.class, new ObserveLayoutFocusTraversalPolicy<SensorUsedUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ SensorUsedUI ui = getUi();
+ if (aComponent.equals(ui.getSensorType().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ return getUi().getSensorType();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ SensorUsedUI ui = getUi();
+ if (ui.getSave().isEnabled()) {
+ return ui.getSave();
+ }
+ if (ui.getReset().isEnabled()) {
+ return ui.getReset();
+ }
+ return ui.getComment2();
+ }
+ });
+ builder.put(GearUseFeaturesLonglineUI.class, new ObserveLayoutFocusTraversalPolicy<GearUseFeaturesLonglineUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ GearUseFeaturesLonglineUI ui = getUi();
+ int selectedIndex = ui.getGearUseFeaturesTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ if (aComponent.equals(ui.getGear().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ GearUseFeaturesLonglineUI ui = getUi();
+ int selectedIndex = ui.getGearUseFeaturesTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ return ui.getGear();
+ }
+ return super.getFirstComponent(aContainer);
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ return getDefaultLastComponent(getUi(), null);
+ }
+ });
+ builder.put(EncounterUI.class, new ObserveLayoutFocusTraversalPolicy<EncounterUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ EncounterUI ui = getUi();
+ if (aComponent.equals(ui.getEncounterType().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ return getUi().getEncounterType();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ EncounterUI ui = getUi();
+ if (ui.getSave().isEnabled()) {
+ return ui.getSave();
+ }
+ if (ui.getReset().isEnabled()) {
+ return ui.getReset();
+ }
+ return ui.getComment2();
+ }
+ });
+ builder.put(CatchLonglineUI.class, new ObserveLayoutFocusTraversalPolicy<CatchLonglineUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ CatchLonglineUI ui = getUi();
+ int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ if (ui.getTableModel().isCreate()) {
+ if (aComponent.equals(ui.getAcquisitionModeIndividual())) {
+ return getLastComponent(aContainer);
+ }
+ } else {
+ if (aComponent.equals(ui.getSection().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ }
+
+ case 1:
+ if (aComponent.equals(ui.getDepredated())) {
+ return getLastComponent(aContainer);
+ }
+ case 2:
+ if (aComponent.equals(ui.getStomacFullness().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ case 5:
+ if (aComponent.equals(ui.getDepthRecorder())) {
+ return getLastComponent(aContainer);
+ }
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ CatchLonglineUI ui = getUi();
+ int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ if (ui.getTableModel().isCreate()) {
+ return ui.getAcquisitionModeIndividual();
+ } else {
+ return ui.getSection();
+ }
+ case 1:
+ return ui.getDepredated();
+ case 2:
+ return ui.getStomacFullness();
+ case 5:
+ return ui.getDepthRecorder();
+ }
+ return super.getFirstComponent(aContainer);
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ return getDefaultLastComponent(getUi(), null);
+ }
+ });
+ builder.put(TargetSampleUI.class, new ObserveLayoutFocusTraversalPolicy<TargetSampleUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ TargetSampleUI ui = getUi();
+ if (aComponent.equals(ui.getAcquisitionModeEffectif())) {
+ return getLastComponent(aContainer);
+ }
+ if (aComponent.equals(ui.getSizeMeasureType().getCombobox().getEditor().getEditorComponent()) && !ui.getAcquisitionModeEffectif().isEnabled()) {
+ return super.getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ TargetSampleUI ui = getUi();
+ if (ui.getAcquisitionModeEffectif().isEnabled()) {
+ return ui.getAcquisitionModeEffectif();
+ }
+ return ui.getSizeMeasureType();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ TargetSampleUI ui = getUi();
+ return getDefaultLastComponent(ui, ui.getComment2());
+ }
+ });
+ builder.put(TargetDiscardCatchUI.class, new ObserveLayoutFocusTraversalPolicy<TargetDiscardCatchUI>() {
+
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ TargetDiscardCatchUI ui = getUi();
+ if (aComponent.equals(ui.getSpecies().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ if (aComponent.equals(ui.getCatchWeight().getTextField()) && !ui.getSpecies().isEnabled()) {
+ return super.getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ TargetDiscardCatchUI ui = getUi();
+ if (ui.getSpecies().isEnabled()) {
+ return ui.getSpecies();
+ }
+ return ui.getCatchWeight();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ TargetDiscardCatchUI ui = getUi();
+ return getDefaultLastComponent(ui, ui.getTargetDiscardCatchCompositionEstimatedByObserver());
+ }
+ });
+ builder.put(TargetCatchUI.class, new ObserveLayoutFocusTraversalPolicy<TargetCatchUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ TargetCatchUI ui = getUi();
+ if (aComponent.equals(ui.getSpecies().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ if (aComponent.equals(ui.getCatchWeight().getTextField()) && !ui.getSpecies().isEnabled()) {
+ return super.getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ TargetCatchUI ui = getUi();
+ if (ui.getSpecies().isEnabled()) {
+ return ui.getSpecies();
+ }
+ return ui.getCatchWeight();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ TargetCatchUI ui = getUi();
+ return getDefaultLastComponent(ui, ui.getTargetCatchCompositionEstimatedByObserver());
+ }
+ });
+ builder.put(SchoolEstimateUI.class, new ObserveLayoutFocusTraversalPolicy<SchoolEstimateUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ SchoolEstimateUI ui = getUi();
+ if (aComponent.equals(ui.getSpecies().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ if (aComponent.equals(ui.getTotalWeight().getTextField()) && !ui.getSpecies().isEnabled()) {
+ return getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ SchoolEstimateUI ui = getUi();
+ if (ui.getSpecies().isEnabled()) {
+ return ui.getSpecies();
+ }
+ return ui.getTotalWeight();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ SchoolEstimateUI ui = getUi();
+ return getDefaultLastComponent(ui, ui.getComment2());
+ }
+
+ });
+ builder.put(ObjectSchoolEstimateUI.class, new ObserveLayoutFocusTraversalPolicy<ObjectSchoolEstimateUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ if (aComponent.equals(getUi().getSpecies().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ return getUi().getSpecies();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ ObjectSchoolEstimateUI ui = getUi();
+ return getDefaultLastComponent(ui, ui.getComment2());
+ }
+
+ });
+ builder.put(ObjectObservedSpeciesUI.class, new ObserveLayoutFocusTraversalPolicy<ObjectObservedSpeciesUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ if (aComponent.equals(getUi().getSpecies().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ return getUi().getSpecies();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ ObjectObservedSpeciesUI ui = getUi();
+ return getDefaultLastComponent(ui, ui.getComment2());
+ }
+
+ });
+ builder.put(NonTargetSampleUI.class, new ObserveLayoutFocusTraversalPolicy<NonTargetSampleUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ NonTargetSampleUI ui = getUi();
+ if (aComponent.equals(ui.getAcquisitionModeEffectif())) {
+ return getLastComponent(aContainer);
+ }
+ if (aComponent.equals(ui.getSizeMeasureType().getCombobox().getEditor().getEditorComponent()) && !ui.getAcquisitionModeEffectif().isEnabled()) {
+ return super.getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ NonTargetSampleUI ui = getUi();
+ if (ui.getAcquisitionModeEffectif().isEnabled()) {
+ return ui.getAcquisitionModeEffectif();
+ }
+ return ui.getSizeMeasureType();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ NonTargetSampleUI ui = getUi();
+ return getDefaultLastComponent(ui, ui.getComment2());
+ }
+
+ });
+ builder.put(NonTargetCatchUI.class, new ObserveLayoutFocusTraversalPolicy<NonTargetCatchUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ if (aComponent.equals(getUi().getSpecies().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ return getUi().getSpecies();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ return getDefaultLastComponent(getUi(), null);
+ }
+
+ });
+ builder.put(GearUseFeaturesSeineUI.class, new ObserveLayoutFocusTraversalPolicy<GearUseFeaturesSeineUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ GearUseFeaturesSeineUI ui = getUi();
+ int selectedIndex = ui.getGearUseFeaturesTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ if (aComponent.equals(ui.getGear().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ GearUseFeaturesSeineUI ui = getUi();
+ int selectedIndex = ui.getGearUseFeaturesTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ return ui.getGear();
+ }
+ return super.getFirstComponent(aContainer);
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ return getDefaultLastComponent(getUi(), null);
+ }
+ });
+ builder.put(ContentReferenceUI.class, new ObserveLayoutFocusTraversalPolicy<ContentReferenceUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ if (aComponent.equals(getUi().getUri())) {
+ return getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ return getUi().getUri();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ return getUi().getBackToList();
+ }
+ });
+
+ builder.put(ReferenceHomeUI.class, new ObserveLayoutFocusTraversalPolicy<ReferenceHomeUI>());
+
+ builder.put(VesselUI.class, new ObserveLayoutFocusTraversalPolicy<VesselUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ VesselUI ui = getUi();
+ int selectedIndex = ui.getTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ if (aComponent.equals(ui.getKeelCode().getTextField())) {
+ return getLastComponent(aContainer);
+ }
+ break;
+ case 1:
+ if (aComponent.equals(ui.getLength().getTextField())) {
+ return getLastComponent(aContainer);
+ }
+ break;
+ }
+
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ VesselUI ui = getUi();
+ int selectedIndex = ui.getTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ return ui.getKeelCode();
+ case 1:
+ return ui.getLength();
+ }
+ return ui.getUri();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ return getUi().getBackToList();
+ }
+ });
+
+ builder.put(SpeciesUI.class, new ObserveLayoutFocusTraversalPolicy<SpeciesUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ SpeciesUI ui = getUi();
+ int selectedIndex = ui.getTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ if (aComponent.equals(ui.getUri())) {
+ return getLastComponent(aContainer);
+ }
+ break;
+ case 1:
+ if (aComponent.equals(ui.getSizeMeasureType().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ break;
+ }
+
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ SpeciesUI ui = getUi();
+ int selectedIndex = ui.getTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ return ui.getUri();
+ case 1:
+ return ui.getSizeMeasureType();
+ }
+ return ui.getUri();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ return getUi().getBackToList();
+ }
+ });
+
+ builder.put(SpeciesListUI.class, new ObserveLayoutFocusTraversalPolicy<SpeciesListUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ SpeciesListUI ui = getUi();
+ int selectedIndex = ui.getTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ if (aComponent.equals(ui.getUri())) {
+ return getLastComponent(aContainer);
+ }
+ break;
+ case 1:
+ if (aComponent.equals(ui.getSpecies().getUniverseList())) {
+ return getLastComponent(aContainer);
+ }
+ break;
+ }
+
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ SpeciesListUI ui = getUi();
+ int selectedIndex = ui.getTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ return ui.getUri();
+ case 1:
+ return ui.getSpecies().getUniverseList();
+ }
+ return ui.getUri();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ return getUi().getBackToList();
+ }
+ });
+
+ builder.put(ProgramUI.class, new ObserveLayoutFocusTraversalPolicy<ProgramUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ ProgramUI ui = getUi();
+ int selectedIndex = ui.getTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ if (aComponent.equals(ui.getUri())) {
+ return getLastComponent(aContainer);
+ }
+ break;
+ case 1:
+ if (aComponent.equals(ui.getNonTargetObservation())) {
+ return getLastComponent(aContainer);
+ }
+ break;
+ }
+
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ ProgramUI ui = getUi();
+ int selectedIndex = ui.getTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ return ui.getUri();
+ case 1:
+ return ui.getNonTargetObservation();
+ }
+ return ui.getUri();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ return getUi().getBackToList();
+ }
+ });
+
+ builder.put(LengthWeightParameterUI.class, new ObserveLayoutFocusTraversalPolicy<LengthWeightParameterUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ LengthWeightParameterUI ui = getUi();
+ int selectedIndex = ui.getTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ if (ui.getModel().isCreatingMode()) {
+ if (aComponent.equals(ui.getSex().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ } else {
+
+ if (aComponent.equals(ui.getStartDate().getEditor())) {
+ return getLastComponent(aContainer);
+ }
+ }
+ break;
+ case 1:
+ if (aComponent.equals(ui.getCoefficients())) {
+ return getLastComponent(aContainer);
+ }
+ break;
+ }
+
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ LengthWeightParameterUI ui = getUi();
+ int selectedIndex = ui.getTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ if (ui.getModel().isCreatingMode()) {
+ return ui.getSex();
+ } else {
+
+ return ui.getStartDate();
+ }
+ case 1:
+ return ui.getCoefficients();
+ }
+ return ui.getUri();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ return getUi().getBackToList();
+ }
+ });
+
+ builder.put(LengthLengthParameterUI.class, new ObserveLayoutFocusTraversalPolicy<LengthLengthParameterUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ LengthLengthParameterUI ui = getUi();
+ int selectedIndex = ui.getTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ if (ui.getModel().isCreatingMode()) {
+ if (aComponent.equals(ui.getInputSizeMeasureType().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ } else {
+
+ if (aComponent.equals(ui.getUri())) {
+ return getLastComponent(aContainer);
+ }
+ }
+ break;
+ case 1:
+ if (aComponent.equals(ui.getCoefficients())) {
+ return getLastComponent(aContainer);
+ }
+ break;
+ }
+
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ LengthLengthParameterUI ui = getUi();
+ int selectedIndex = ui.getTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ if (ui.getModel().isCreatingMode()) {
+ return ui.getInputSizeMeasureType();
+ } else {
+
+ return ui.getUri();
+ }
+ case 1:
+ return ui.getCoefficients();
+ }
+ return ui.getUri();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ return getUi().getBackToList();
+ }
+ });
+
+ builder.put(GearUI.class, new ObserveLayoutFocusTraversalPolicy<GearUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ GearUI ui = getUi();
+ int selectedIndex = ui.getTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ if (aComponent.equals(ui.getUri())) {
+ return getLastComponent(aContainer);
+ }
+ break;
+ case 1:
+ if (aComponent.equals(ui.getGearCaracteristic().getUniverseList())) {
+ return getLastComponent(aContainer);
+ }
+ break;
+ }
+
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ GearUI ui = getUi();
+ int selectedIndex = ui.getTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ return ui.getUri();
+ case 1:
+ return ui.getGearCaracteristic().getUniverseList();
+ }
+ return ui.getUri();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ return getUi().getBackToList();
+ }
+ });
+
+
+ builder.put(WeightCategoryUI.class, new ObserveLayoutFocusTraversalPolicy<WeightCategoryUI>() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ WeightCategoryUI ui = getUi();
+ if (aComponent.equals(ui.getSpecies().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ return getUi().getSpecies();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ return getUi().getBackToList();
+ }
+ });
+
+ policies = builder.build();
+
+ }
+
+ public static class ObserveLayoutFocusTraversalPolicy<U extends ContentUI> extends LayoutFocusTraversalPolicy {
+
+ private Supplier<U> uiSupplier;
+
+ public void setUiSupplier(Supplier<U> uiSupplier) {
+ this.uiSupplier = uiSupplier;
+ }
+
+ public U getUi() {
+ return uiSupplier.get();
+ }
+
+ protected <UU extends ContentTableUI> Component getDefaultLastComponent(UU ui, Component optionalComponent) {
+ if (ui.getSave().isEnabled()) {
+ return ui.getSave();
+ }
+ if (ui.getReset().isEnabled()) {
+ return ui.getReset();
+ }
+ if (optionalComponent != null) {
+ return optionalComponent;
+ }
+ if (ui.getDeleteEntry().isVisible() && ui.getDeleteEntry().isEnabled()) {
+ return ui.getDeleteEntry();
+ }
+ if (ui.getSaveNewEntry().isVisible() && ui.getSaveNewEntry().isEnabled()) {
+ return ui.getSaveNewEntry();
+ }
+ if (ui.getResetNewEntry().isVisible() && ui.getResetNewEntry().isEnabled()) {
+ return ui.getResetNewEntry();
+ }
+ return ui.getResetEntry();
+ }
+
+ }
+
+
+}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/BranchlineUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/BranchlineUI.jaxx
index 0f7d7ad..b3b48b5 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/BranchlineUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/BranchlineUI.jaxx
@@ -18,7 +18,8 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ContentUI superGenericType='BranchlineDto' contentTitle='{n("observe.content.branchline.title")}'>
+<fr.ird.observe.application.swing.ui.content.ContentUI superGenericType='BranchlineDto, BranchlineUI'
+ contentTitle='{n("observe.content.branchline.title")}'>
<import>
fr.ird.observe.services.dto.CommentableDto
@@ -31,9 +32,6 @@
fr.ird.observe.services.dto.referential.longline.HookSizeDto
fr.ird.observe.services.dto.referential.longline.HookTypeDto
- fr.ird.observe.application.swing.ui.actions.shared.ResetEditUIAction
- fr.ird.observe.application.swing.ui.actions.shared.SaveEditUIAction
-
jaxx.runtime.swing.editor.NumberEditor
jaxx.runtime.swing.editor.bean.BeanComboBox
org.nuiton.jaxx.widgets.datetime.DateTimeEditor
@@ -89,7 +87,9 @@ public void edit(BranchlineDto branchline) { getHandler().edit(branchline); }
<JLabel id='topTypeLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <BeanComboBox id='topType' constructorParams='this' genericType='ReferentialReference<LineTypeDto>' _entityClass='LineTypeDto.class'/>
+ <BeanComboBox id='topType' constructorParams='this'
+ genericType='ReferentialReference<LineTypeDto>'
+ _entityClass='LineTypeDto.class'/>
</cell>
</row>
@@ -99,7 +99,9 @@ public void edit(BranchlineDto branchline) { getHandler().edit(branchline); }
<JLabel id='tracelineTypeLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <BeanComboBox id='tracelineType' constructorParams='this' genericType='ReferentialReference<LineTypeDto>' _entityClass='LineTypeDto.class'/>
+ <BeanComboBox id='tracelineType' constructorParams='this'
+ genericType='ReferentialReference<LineTypeDto>'
+ _entityClass='LineTypeDto.class'/>
</cell>
</row>
@@ -179,7 +181,9 @@ public void edit(BranchlineDto branchline) { getHandler().edit(branchline); }
<JLabel id='hookTypeLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <BeanComboBox id='hookType' constructorParams='this' genericType='ReferentialReference<HookTypeDto>' _entityClass='HookTypeDto.class'/>
+ <BeanComboBox id='hookType' constructorParams='this'
+ genericType='ReferentialReference<HookTypeDto>'
+ _entityClass='HookTypeDto.class'/>
</cell>
</row>
@@ -189,7 +193,9 @@ public void edit(BranchlineDto branchline) { getHandler().edit(branchline); }
<JLabel id='hookSizeLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <BeanComboBox id='hookSize' constructorParams='this' genericType='ReferentialReference<HookSizeDto>' _entityClass='HookSizeDto.class'/>
+ <BeanComboBox id='hookSize' constructorParams='this'
+ genericType='ReferentialReference<HookSizeDto>'
+ _entityClass='HookSizeDto.class'/>
</cell>
</row>
@@ -209,7 +215,9 @@ public void edit(BranchlineDto branchline) { getHandler().edit(branchline); }
<JLabel id='baitTypeLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <BeanComboBox id='baitType' constructorParams='this' genericType='ReferentialReference<BaitTypeDto>' _entityClass='BaitTypeDto.class'/>
+ <BeanComboBox id='baitType' constructorParams='this'
+ genericType='ReferentialReference<BaitTypeDto>'
+ _entityClass='BaitTypeDto.class'/>
</cell>
</row>
@@ -219,7 +227,9 @@ public void edit(BranchlineDto branchline) { getHandler().edit(branchline); }
<JLabel id='baitSettingStatusLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <BeanComboBox id='baitSettingStatus' constructorParams='this' genericType='ReferentialReference<BaitSettingStatusDto>' _entityClass='BaitSettingStatusDto.class'/>
+ <BeanComboBox id='baitSettingStatus' constructorParams='this'
+ genericType='ReferentialReference<BaitSettingStatusDto>'
+ _entityClass='BaitSettingStatusDto.class'/>
</cell>
</row>
@@ -229,7 +239,9 @@ public void edit(BranchlineDto branchline) { getHandler().edit(branchline); }
<JLabel id='baitHaulingStatusLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <BeanComboBox id='baitHaulingStatus' constructorParams='this' genericType='ReferentialReference<BaitHaulingStatusDto>' _entityClass='BaitHaulingStatusDto.class'/>
+ <BeanComboBox id='baitHaulingStatus' constructorParams='this'
+ genericType='ReferentialReference<BaitHaulingStatusDto>'
+ _entityClass='BaitHaulingStatusDto.class'/>
</cell>
</row>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/BranchlineUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/BranchlineUIHandler.java
index 20b7a17..56cab3e 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/BranchlineUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/BranchlineUIHandler.java
@@ -54,7 +54,7 @@ import java.util.Set;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.10
*/
-public class BranchlineUIHandler extends ContentUIHandler<BranchlineDto> {
+public class BranchlineUIHandler extends ContentUIHandler<BranchlineDto, BranchlineUI> {
/** Logger */
private static final Log log = LogFactory.getLog(BranchlineUIHandler.class);
@@ -131,11 +131,6 @@ public class BranchlineUIHandler extends ContentUIHandler<BranchlineDto> {
}
@Override
- public BranchlineUI getUi() {
- return (BranchlineUI) super.getUi();
- }
-
- @Override
protected boolean computeCanWrite(ObserveSwingDataSource source) {
return source.canWriteData();
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineDetailCompositionUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineDetailCompositionUI.jaxx
index 660ba58..c9eb46d 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineDetailCompositionUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineDetailCompositionUI.jaxx
@@ -18,8 +18,9 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ContentUI superGenericType='SetLonglineDetailCompositionDto'
- contentTitle='{n("observe.content.longlineDetailComposition.title")}'>
+<fr.ird.observe.application.swing.ui.content.ContentUI
+ superGenericType='SetLonglineDetailCompositionDto, LonglineDetailCompositionUI'
+ contentTitle='{n("observe.content.longlineDetailComposition.title")}'>
<import>
fr.ird.observe.application.swing.ObserveSwingApplicationContext
@@ -31,7 +32,6 @@
org.jdesktop.swingx.JXTable
- static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
static org.nuiton.i18n.I18n.n
</import>
@@ -59,7 +59,8 @@
<SetLonglineDetailCompositionDto id='bean'/>
<!-- validator -->
- <BeanValidator id='validator' autoField='true' beanClass='fr.ird.observe.services.dto.longline.SetLonglineDetailCompositionDto'
+ <BeanValidator id='validator' autoField='true'
+ beanClass='fr.ird.observe.services.dto.longline.SetLonglineDetailCompositionDto'
errorTableModel='{getErrorTableModel()}' context='ui-update-longlineDetailComposition'>
</BeanValidator>
@@ -172,7 +173,8 @@
<Table fill="both" constraints='BorderLayout.NORTH'>
<row>
<cell weightx="1" fill="both" weighty="1">
- <BranchlineUI id="branchlineDetailUI" constructorParams="ObserveSwingApplicationContext.get().getMainUI()"/>
+ <BranchlineUI id="branchlineDetailUI"
+ constructorParams="ObserveSwingApplicationContext.get().getMainUI()"/>
</cell>
</row>
</Table>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineDetailCompositionUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineDetailCompositionUIHandler.java
index d7d03d7..7875656 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineDetailCompositionUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineDetailCompositionUIHandler.java
@@ -74,7 +74,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.8
*/
-public class LonglineDetailCompositionUIHandler extends ContentUIHandler<SetLonglineDetailCompositionDto> {
+public class LonglineDetailCompositionUIHandler extends ContentUIHandler<SetLonglineDetailCompositionDto, LonglineDetailCompositionUI> {
static final String SECTION_TEMPLATES_EDITOR = "sectionTemplatesEditor";
@@ -234,11 +234,6 @@ public class LonglineDetailCompositionUIHandler extends ContentUIHandler<SetLong
}
@Override
- public LonglineDetailCompositionUI getUi() {
- return (LonglineDetailCompositionUI) super.getUi();
- }
-
- @Override
public LonglineDetailCompositionUIModel getModel() {
return (LonglineDetailCompositionUIModel) super.getModel();
}
@@ -332,54 +327,6 @@ public class LonglineDetailCompositionUIHandler extends ContentUIHandler<SetLong
tabPane.setChangeSelectedIndex(tabbedPaneWillChanged);
tabPane.addChangeListener(tabbedPaneChanged);
- getUi().setFocusCycleRoot(true);
- getUi().setFocusTraversalPolicy(new LayoutFocusTraversalPolicy() {
-
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- int selectedIndex = getUi().getFishingOperationTabPane().getSelectedIndex();
- if (selectedIndex == 2) {
- if (aComponent.equals(getUi().getBranchlineDetailUI().getTopType().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- if (aComponent.equals(getUi().getBranchlineDetailUI().getHookType().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getFirstComponent(Container aContainer) {
- int selectedIndex = getUi().getFishingOperationTabPane().getSelectedIndex();
- if (selectedIndex == 2) {
- int subSelectedIndex = getUi().getBranchlineDetailUI().getFishingOperationTabPane().getSelectedIndex();
- switch (subSelectedIndex) {
- case 0:
- return getUi().getBranchlineDetailUI().getTopType();
- case 1:
- return getUi().getBranchlineDetailUI().getHookType();
- }
- }
- return super.getFirstComponent(aContainer);
- }
-
- @Override
- public Component getLastComponent(Container aContainer) {
-
- if (getUi().getSave().isEnabled()) {
- return getUi().getSave();
- }
- if (getUi().getReset().isEnabled()) {
- return getUi().getReset();
- }
- int selectedIndex = getUi().getFishingOperationTabPane().getSelectedIndex();
- if (selectedIndex == 2) {
- getUi().getBranchlineDetailUI().getComment2();
- }
- return super.getLastComponent(aContainer);
- }
- });
}
@Override
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineGlobalCompositionUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineGlobalCompositionUI.jaxx
index ecc74e3..91de3f7 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineGlobalCompositionUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineGlobalCompositionUI.jaxx
@@ -18,8 +18,9 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ContentUI superGenericType='SetLonglineGlobalCompositionDto'
- contentTitle='{n("observe.content.longlineGlobalComposition.title")}'>
+<fr.ird.observe.application.swing.ui.content.ContentUI
+ superGenericType='SetLonglineGlobalCompositionDto, LonglineGlobalCompositionUI'
+ contentTitle='{n("observe.content.longlineGlobalComposition.title")}'>
<import>
fr.ird.observe.application.swing.ObserveSwingApplicationContext
@@ -61,7 +62,8 @@
<SetLonglineGlobalCompositionDto id='bean'/>
<!-- validator -->
- <BeanValidator id='validator' autoField='true' beanClass='fr.ird.observe.services.dto.longline.SetLonglineGlobalCompositionDto'
+ <BeanValidator id='validator' autoField='true'
+ beanClass='fr.ird.observe.services.dto.longline.SetLonglineGlobalCompositionDto'
errorTableModel='{getErrorTableModel()}' context='ui-update-globalComposition'>
</BeanValidator>
@@ -112,7 +114,9 @@
<Table fill='both' constraints='BorderLayout.NORTH'>
<row>
<cell weighty="1" weightx="1">
- <FilterableDoubleList id='mitigationType' genericType='ReferentialReference<MitigationTypeDto>' _entityClass='MitigationTypeDto.class'/>
+ <FilterableDoubleList id='mitigationType'
+ genericType='ReferentialReference<MitigationTypeDto>'
+ _entityClass='MitigationTypeDto.class'/>
</cell>
</row>
</Table>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineGlobalCompositionUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineGlobalCompositionUIHandler.java
index 4d2ced8..a9d5ded 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineGlobalCompositionUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineGlobalCompositionUIHandler.java
@@ -54,7 +54,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.8
*/
-public class LonglineGlobalCompositionUIHandler extends ContentUIHandler<SetLonglineGlobalCompositionDto> {
+public class LonglineGlobalCompositionUIHandler extends ContentUIHandler<SetLonglineGlobalCompositionDto, LonglineGlobalCompositionUI> {
/** Logger */
private static final Log log = LogFactory.getLog(LonglineGlobalCompositionUIHandler.class);
@@ -64,11 +64,6 @@ public class LonglineGlobalCompositionUIHandler extends ContentUIHandler<SetLong
}
@Override
- public LonglineGlobalCompositionUI getUi() {
- return (LonglineGlobalCompositionUI) super.getUi();
- }
-
- @Override
protected boolean computeCanWrite(ObserveSwingDataSource source) {
return source.canWriteData();
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/SetLonglineUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/SetLonglineUI.jaxx
index 8345b48..0fd6436 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/SetLonglineUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/SetLonglineUI.jaxx
@@ -20,7 +20,8 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ContentUI superGenericType='SetLonglineDto' contentTitle='{n("observe.content.setLongline.title")}'>
+<fr.ird.observe.application.swing.ui.content.ContentUI superGenericType='SetLonglineDto, SetLonglineUI'
+ contentTitle='{n("observe.content.setLongline.title")}'>
<import>
fr.ird.observe.services.dto.CommentableDto
@@ -39,13 +40,10 @@
fr.ird.observe.application.swing.ui.util.BooleanEditor
jaxx.runtime.swing.editor.NumberEditor
- org.nuiton.jaxx.widgets.datetime.TimeEditor
jaxx.runtime.swing.editor.bean.BeanComboBox
org.nuiton.jaxx.widgets.gis.absolute.CoordinatesEditor
org.nuiton.jaxx.widgets.datetime.DateTimeEditor
- org.jdesktop.swingx.JXDatePicker
-
org.apache.commons.lang3.BooleanUtils
java.awt.Dimension
@@ -171,7 +169,9 @@
<JLabel id='settingShapeLabel'/>
</cell>
<cell columns="3" fill="both">
- <BeanComboBox id='settingShape' constructorParams='this' genericType='ReferentialReference<SettingShapeDto>' _entityClass='SettingShapeDto.class'/>
+ <BeanComboBox id='settingShape' constructorParams='this'
+ genericType='ReferentialReference<SettingShapeDto>'
+ _entityClass='SettingShapeDto.class'/>
</cell>
</row>
<!-- setting vessel speed -->
@@ -261,7 +261,9 @@
<JLabel id='lineTypeLabel'/>
</cell>
<cell columns="3">
- <BeanComboBox id='lineType' constructorParams='this' genericType='ReferentialReference<LineTypeDto>' _entityClass='LineTypeDto.class'/>
+ <BeanComboBox id='lineType' constructorParams='this'
+ genericType='ReferentialReference<LineTypeDto>'
+ _entityClass='LineTypeDto.class'/>
</cell>
</row>
<!-- weighted swivels -->
@@ -306,7 +308,9 @@
<JLabel id='lightsticksTypeLabel'/>
</cell>
<cell columns="3">
- <BeanComboBox id='lightsticksType' constructorParams='this' genericType='ReferentialReference<LightsticksTypeDto>' _entityClass='LightsticksTypeDto.class'/>
+ <BeanComboBox id='lightsticksType' constructorParams='this'
+ genericType='ReferentialReference<LightsticksTypeDto>'
+ _entityClass='LightsticksTypeDto.class'/>
</cell>
</row>
<!-- lightsticks color -->
@@ -315,7 +319,9 @@
<JLabel id='lightsticksColorLabel'/>
</cell>
<cell columns="3">
- <BeanComboBox id='lightsticksColor' constructorParams='this' genericType='ReferentialReference<LightsticksColorDto>' _entityClass='LightsticksColorDto.class'/>
+ <BeanComboBox id='lightsticksColor' constructorParams='this'
+ genericType='ReferentialReference<LightsticksColorDto>'
+ _entityClass='LightsticksColorDto.class'/>
</cell>
</row>
<!-- monitored -->
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/SetLonglineUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/SetLonglineUIHandler.java
index 02c0a18..fab54cd 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/SetLonglineUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/SetLonglineUIHandler.java
@@ -49,10 +49,7 @@ import org.nuiton.jaxx.widgets.gis.CoordinateFormat;
import org.nuiton.jaxx.widgets.gis.absolute.CoordinatesEditorModel;
import org.nuiton.validator.NuitonValidatorScope;
-import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.event.TableModelListener;
-import java.awt.Component;
-import java.awt.Container;
import java.beans.PropertyChangeListener;
import java.util.HashSet;
import java.util.Set;
@@ -65,7 +62,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.7
*/
-public class SetLonglineUIHandler extends ContentUIHandler<SetLonglineDto> {
+public class SetLonglineUIHandler extends ContentUIHandler<SetLonglineDto, SetLonglineUI> {
/** Logger */
private static final Log log = LogFactory.getLog(SetLonglineUIHandler.class);
@@ -102,11 +99,6 @@ public class SetLonglineUIHandler extends ContentUIHandler<SetLonglineDto> {
}
@Override
- public SetLonglineUI getUi() {
- return (SetLonglineUI) super.getUi();
- }
-
- @Override
protected boolean computeCanWrite(ObserveSwingDataSource source) {
return source.canWriteData();
}
@@ -155,42 +147,6 @@ public class SetLonglineUIHandler extends ContentUIHandler<SetLonglineDto> {
getUi().getHaulingStartCoordinates().getModel().addPropertyChangeListener(CoordinatesEditorModel.PROPERTY_FORMAT, onCoordinateFormatChangedListener);
getUi().getHaulingEndCoordinates().getModel().addPropertyChangeListener(CoordinatesEditorModel.PROPERTY_FORMAT, onCoordinateFormatChangedListener);
- getUi().setFocusCycleRoot(true);
- getUi().setFocusTraversalPolicy(new LayoutFocusTraversalPolicy() {
-
- @Override
- public Component getFirstComponent(Container aContainer) {
- int selectedIndex = getUi().getFishingOperationTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- return getUi().getHomeId();
- case 1:
- return getUi().getSettingShape();
- case 2:
- return getUi().getHaulingDirectionSameAsSetting();
- }
- return super.getFirstComponent(aContainer);
- }
-
- @Override
- public Component getLastComponent(Container aContainer) {
- return getUi().getDelete();
- }
-
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- if (aComponent.equals(getUi().getHomeId())) {
- return getLastComponent(aContainer);
- }
- if (aComponent.equals(getUi().getHaulingDirectionSameAsSetting())) {
- return getLastComponent(aContainer);
- }
- if (aComponent.equals(getUi().getSettingShape().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
- });
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectTransmittingBuoyOperationUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectTransmittingBuoyOperationUI.jaxx
index 256be32..cde2155 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectTransmittingBuoyOperationUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectTransmittingBuoyOperationUI.jaxx
@@ -20,8 +20,9 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ContentUI superGenericType='FloatingObjectTransmittingBuoyDto'
- contentTitle='{n("observe.content.floatingObjectTransmittingBuoyOperation.title")}'>
+<fr.ird.observe.application.swing.ui.content.ContentUI
+ superGenericType='FloatingObjectTransmittingBuoyDto, FloatingObjectTransmittingBuoyOperationUI'
+ contentTitle='{n("observe.content.floatingObjectTransmittingBuoyOperation.title")}'>
<import>
fr.ird.observe.services.dto.seine.FloatingObjectTransmittingBuoyDto
@@ -34,7 +35,6 @@
fr.ird.observe.services.dto.referential.seine.TransmittingBuoyTypeDto
fr.ird.observe.application.swing.ui.actions.shared.ResetEditUIAction
fr.ird.observe.application.swing.ui.actions.shared.SaveEditUIAction
- fr.ird.observe.application.swing.ui.content.ContentUIModel
jaxx.runtime.swing.editor.bean.BeanComboBox
java.awt.Dimension
@@ -59,18 +59,12 @@
<TransmittingBuoyDto id='transmittingBuoy2' initializer='new TransmittingBuoyDto()'/>
<!-- validator -->
- <BeanValidator id='validator'
- autoField='true'
- beanClass='fr.ird.observe.services.dto.seine.FloatingObjectTransmittingBuoyDto'
- errorTableModel='{getErrorTableModel()}'
- context='ui-update-objectOperation'>
+ <BeanValidator id='validator' errorTableModel='{getErrorTableModel()}' context='ui-update-objectOperation'
+ beanClass='fr.ird.observe.services.dto.seine.FloatingObjectTransmittingBuoyDto' autoField='true'>
</BeanValidator>
- <BeanValidator id='validatorBalise1'
- beanClass='fr.ird.observe.services.dto.seine.TransmittingBuoyDto'
- errorTableModel='{getErrorTableModel()}'
- parentValidator='{validator}'
- context='ui-update'>
+ <BeanValidator id='validatorBalise1' beanClass='fr.ird.observe.services.dto.seine.TransmittingBuoyDto'
+ errorTableModel='{getErrorTableModel()}' parentValidator='{validator}' context='ui-update'>
<field name="transmittingBuoyType" component="transmittingBuoyType1"/>
<field name="transmittingBuoyOperation" component="transmittingBuoyOperation1"/>
<field name="ownership" component="ownership1"/>
@@ -78,11 +72,8 @@
<field name="country" component="country1"/>
</BeanValidator>
- <BeanValidator id='validatorBalise2'
- beanClass='fr.ird.observe.services.dto.seine.TransmittingBuoyDto'
- errorTableModel='{getErrorTableModel()}'
- parentValidator='{validator}'
- context='ui-update'>
+ <BeanValidator id='validatorBalise2' beanClass='fr.ird.observe.services.dto.seine.TransmittingBuoyDto'
+ errorTableModel='{getErrorTableModel()}' parentValidator='{validator}' context='ui-update'>
<field name="transmittingBuoyType" component="transmittingBuoyType2"/>
<field name="transmittingBuoyOperation" component="transmittingBuoyOperation2"/>
<field name="ownership" component="ownership2"/>
@@ -101,8 +92,7 @@
<JLabel id='typeOperationLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <EnumEditor id='typeOperation'
- genericType='TypeTransmittingBuoyOperation'
+ <EnumEditor id='typeOperation' genericType='TypeTransmittingBuoyOperation'
constructorParams='TypeTransmittingBuoyOperation.class'
onItemStateChanged='if(event.getStateChange()==ItemEvent.SELECTED && model.isEditing()) { getHandler().changeTypeOperation(typeOperation.getSelectedItem(), true); model.setModified(true); }'/>
</cell>
@@ -111,10 +101,8 @@
<JPanel id="transmittingBuoys" constraints="BorderLayout.CENTER"/>
- <JScrollPane id='comment' constraints="BorderLayout.SOUTH"
- onFocusGained='comment2.requestFocus()'>
- <JTextArea id='comment2'
- onKeyReleased='getBean().setComment(comment2.getText())'/>
+ <JScrollPane id='comment' constraints="BorderLayout.SOUTH" onFocusGained='comment2.requestFocus()'>
+ <JTextArea id='comment2' onKeyReleased='getBean().setComment(comment2.getText())'/>
</JScrollPane>
</JPanel>
@@ -171,7 +159,8 @@
<JLabel id='country1Label'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <BeanComboBox id='country1' constructorParams='this' genericType='ReferentialReference<CountryDto>' _entityClass='CountryDto.class'/>
+ <BeanComboBox id='country1' constructorParams='this' genericType='ReferentialReference<CountryDto>'
+ _entityClass='CountryDto.class'/>
</cell>
</row>
<row>
@@ -179,8 +168,7 @@
<JLabel id='code1Label'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <JTextField id='code1'
- onKeyReleased='transmittingBuoy1.setCode(code1.getText())'/>
+ <JTextField id='code1' onKeyReleased='transmittingBuoy1.setCode(code1.getText())'/>
</cell>
</row>
<row>
@@ -188,8 +176,7 @@
<JLabel id='brand1Label'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <JTextField id='brand1'
- onKeyReleased='transmittingBuoy1.setBrand(brand1.getText())'/>
+ <JTextField id='brand1' onKeyReleased='transmittingBuoy1.setBrand(brand1.getText())'/>
</cell>
</row>
</Table>
@@ -220,8 +207,7 @@
<JLabel id='ownership2Label'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <EnumEditor id='ownership2'
- constructorParams='Ownership.class'
+ <EnumEditor id='ownership2' constructorParams='Ownership.class'
onItemStateChanged='transmittingBuoy2.setOwnership((Ownership) ownership2.getSelectedItem())'/>
</cell>
</row>
@@ -230,7 +216,8 @@
<JLabel id='country2Label'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <BeanComboBox id='country2' constructorParams='this' genericType='ReferentialReference<CountryDto>' _entityClass='CountryDto.class'/>
+ <BeanComboBox id='country2' constructorParams='this' genericType='ReferentialReference<CountryDto>'
+ _entityClass='CountryDto.class'/>
</cell>
</row>
<row>
@@ -238,8 +225,7 @@
<JLabel id='code2Label'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <JTextField id='code2'
- onKeyReleased='transmittingBuoy2.setCode(code2.getText())'/>
+ <JTextField id='code2' onKeyReleased='transmittingBuoy2.setCode(code2.getText())'/>
</cell>
</row>
<row>
@@ -247,8 +233,7 @@
<JLabel id='brand2Label'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <JTextField id='brand2'
- onKeyReleased='transmittingBuoy2.setBrand(brand2.getText())'/>
+ <JTextField id='brand2' onKeyReleased='transmittingBuoy2.setBrand(brand2.getText())'/>
</cell>
</row>
</Table>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectTransmittingBuoyOperationUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectTransmittingBuoyOperationUIHandler.java
index 8e4a2c3..6f46841 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectTransmittingBuoyOperationUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectTransmittingBuoyOperationUIHandler.java
@@ -47,10 +47,7 @@ import org.apache.commons.logging.LogFactory;
import org.nuiton.validator.NuitonValidatorScope;
import javax.swing.JPanel;
-import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.SwingUtilities;
-import java.awt.Component;
-import java.awt.Container;
import java.awt.GridLayout;
import java.util.ArrayList;
import java.util.Collection;
@@ -62,7 +59,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.0
*/
-public class FloatingObjectTransmittingBuoyOperationUIHandler extends ContentUIHandler<FloatingObjectTransmittingBuoyDto> {
+public class FloatingObjectTransmittingBuoyOperationUIHandler extends ContentUIHandler<FloatingObjectTransmittingBuoyDto, FloatingObjectTransmittingBuoyOperationUI> {
/** Logger */
private static final Log log = LogFactory.getLog(FloatingObjectTransmittingBuoyOperationUIHandler.class);
@@ -72,11 +69,6 @@ public class FloatingObjectTransmittingBuoyOperationUIHandler extends ContentUIH
}
@Override
- public FloatingObjectTransmittingBuoyOperationUI getUi() {
- return (FloatingObjectTransmittingBuoyOperationUI) super.getUi();
- }
-
- @Override
public FloatingObjectTransmittingBuoyOperationUIModel getModel() {
return (FloatingObjectTransmittingBuoyOperationUIModel) super.getModel();
}
@@ -105,41 +97,6 @@ public class FloatingObjectTransmittingBuoyOperationUIHandler extends ContentUIH
}
@Override
- public void initUI() {
- super.initUI();
-
- FloatingObjectTransmittingBuoyOperationUI ui = getUi();
-
- ui.setFocusCycleRoot(true);
- ui.setFocusTraversalPolicy(new LayoutFocusTraversalPolicy() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
-
- if (aComponent.equals(ui.getTypeOperation())) {
- return getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getFirstComponent(Container aContainer) {
- return ui.getTypeOperation();
- }
-
- @Override
- public Component getLastComponent(Container aContainer) {
- if (ui.getSave().isEnabled()) {
- return ui.getSave();
- }
- if (ui.getReset().isEnabled()) {
- return ui.getReset();
- }
- return ui.getComment2();
- }
- });
- }
-
- @Override
public void openUI() {
super.openUI();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectUI.jaxx
index d149fb1..47721bb 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectUI.jaxx
@@ -20,7 +20,8 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ContentUI superGenericType='FloatingObjectDto' contentTitle='{n("observe.content.floatingObject.title")}'>
+<fr.ird.observe.application.swing.ui.content.ContentUI superGenericType='FloatingObjectDto, FloatingObjectUI'
+ contentTitle='{n("observe.content.floatingObject.title")}'>
<import>
fr.ird.observe.services.dto.seine.FloatingObjectDto
@@ -52,9 +53,8 @@
<FloatingObjectDto id='bean'/>
<!-- validator -->
- <BeanValidator id='validator' autoField='true' context='ui-create'
- beanClass='fr.ird.observe.services.dto.seine.FloatingObjectDto'
- errorTableModel='{getErrorTableModel()}'/>
+ <BeanValidator id='validator' autoField='true' context='ui-create' errorTableModel='{getErrorTableModel()}'
+ beanClass='fr.ird.observe.services.dto.seine.FloatingObjectDto'/>
<!-- formulaire -->
<JPanel id="body" layout='{new BorderLayout()}'>
@@ -64,7 +64,9 @@
<JLabel id='objectOperationLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <BeanComboBox id='objectOperation' constructorParams='this' genericType='ReferentialReference<ObjectOperationDto>' _entityClass='ObjectOperationDto.class'/>
+ <BeanComboBox id='objectOperation' constructorParams='this'
+ genericType='ReferentialReference<ObjectOperationDto>'
+ _entityClass='ObjectOperationDto.class'/>
</cell>
</row>
<row>
@@ -72,7 +74,8 @@
<JLabel id='objectTypeLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <BeanComboBox id='objectType' constructorParams='this' genericType='ReferentialReference<ObjectTypeDto>' _entityClass='ObjectTypeDto.class'/>
+ <BeanComboBox id='objectType' constructorParams='this' genericType='ReferentialReference<ObjectTypeDto>'
+ _entityClass='ObjectTypeDto.class'/>
</cell>
</row>
<row>
@@ -80,7 +83,8 @@
<JLabel id='objectFateLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <BeanComboBox id='objectFate' constructorParams='this' genericType='ReferentialReference<ObjectFateDto>' _entityClass='ObjectFateDto.class'/>
+ <BeanComboBox id='objectFate' constructorParams='this' genericType='ReferentialReference<ObjectFateDto>'
+ _entityClass='ObjectFateDto.class'/>
</cell>
</row>
<row>
@@ -93,10 +97,8 @@
</row>
<row>
<cell columns='2' fill="both" weighty="0.7">
- <JScrollPane id='comment'
- onFocusGained='comment2.requestFocus()'>
- <JTextArea id='comment2'
- onKeyReleased='getBean().setComment(comment2.getText())'/>
+ <JScrollPane id='comment' onFocusGained='comment2.requestFocus()'>
+ <JTextArea id='comment2' onKeyReleased='getBean().setComment(comment2.getText())'/>
</JScrollPane>
</cell>
</row>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectUIHandler.java
index 582a5b4..e4335b9 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectUIHandler.java
@@ -41,17 +41,13 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.validator.NuitonValidatorScope;
-import javax.swing.LayoutFocusTraversalPolicy;
-import java.awt.Component;
-import java.awt.Container;
-
import static org.nuiton.i18n.I18n.t;
/**
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.0
*/
-public class FloatingObjectUIHandler extends ContentUIHandler<FloatingObjectDto> {
+public class FloatingObjectUIHandler extends ContentUIHandler<FloatingObjectDto, FloatingObjectUI> {
/** Logger */
private static final Log log = LogFactory.getLog(FloatingObjectUIHandler.class);
@@ -61,11 +57,6 @@ public class FloatingObjectUIHandler extends ContentUIHandler<FloatingObjectDto>
}
@Override
- public FloatingObjectUI getUi() {
- return (FloatingObjectUI) super.getUi();
- }
-
- @Override
protected boolean computeCanWrite(ObserveSwingDataSource source) {
return source.canWriteData();
}
@@ -100,40 +91,6 @@ public class FloatingObjectUIHandler extends ContentUIHandler<FloatingObjectDto>
}
@Override
- public void initUI() {
- super.initUI();
-
- FloatingObjectUI ui = getUi();
-
- ui.setFocusCycleRoot(true);
- ui.setFocusTraversalPolicy(new LayoutFocusTraversalPolicy() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- if (aComponent.equals(ui.getObjectOperation().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getFirstComponent(Container aContainer) {
- return ui.getObjectOperation();
- }
-
- @Override
- public Component getLastComponent(Container aContainer) {
- if (ui.getDelete().isVisible() && ui.getDelete().isEnabled()) {
- return ui.getDelete();
- }
- if (ui.getSave().isEnabled()) {
- return ui.getSave();
- }
- return ui.getReset();
- }
- });
- }
-
- @Override
public void openUI() {
super.openUI();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/SetSeineUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/SetSeineUI.jaxx
index 8bb0f6e..638dc60 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/SetSeineUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/SetSeineUI.jaxx
@@ -20,7 +20,8 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ContentUI superGenericType='SetSeineDto' contentTitle='{n("observe.content.setSeine.title")}'>
+<fr.ird.observe.application.swing.ui.content.ContentUI superGenericType='SetSeineDto, SetSeineUI'
+ contentTitle='{n("observe.content.setSeine.title")}'>
<import>
fr.ird.observe.services.dto.CommentableDto
@@ -38,8 +39,6 @@
org.nuiton.jaxx.widgets.datetime.DateTimeEditor
- org.jdesktop.swingx.JXDatePicker
-
java.awt.Dimension
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
@@ -93,7 +92,8 @@
<JLabel id='reasonForNullSetLabel'/>
</cell>
<cell anchor='east' fill='both'>
- <BeanComboBox id='reasonForNullSet' genericType='ReferentialReference<ReasonForNullSetDto>' _entityClass='ReasonForNullSetDto.class' constructorParams='this'/>
+ <BeanComboBox id='reasonForNullSet' genericType='ReferentialReference<ReasonForNullSetDto>'
+ _entityClass='ReasonForNullSetDto.class' constructorParams='this'/>
</cell>
</row>
<row>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/SetSeineUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/SetSeineUIHandler.java
index 3b2a5a6..ec01a12 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/SetSeineUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/SetSeineUIHandler.java
@@ -50,12 +50,7 @@ import org.apache.commons.logging.LogFactory;
import org.nuiton.util.DateUtil;
import org.nuiton.validator.NuitonValidatorScope;
-import javax.swing.JComponent;
-import javax.swing.JSpinner;
-import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.event.TableModelListener;
-import java.awt.Component;
-import java.awt.Container;
import java.beans.PropertyChangeListener;
import java.util.Date;
import java.util.HashSet;
@@ -67,7 +62,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.0
*/
-public class SetSeineUIHandler extends ContentUIHandler<SetSeineDto> {
+public class SetSeineUIHandler extends ContentUIHandler<SetSeineDto, SetSeineUI> {
/** Logger */
private static final Log log = LogFactory.getLog(SetSeineUIHandler.class);
@@ -94,11 +89,6 @@ public class SetSeineUIHandler extends ContentUIHandler<SetSeineDto> {
};
}
- @Override
- public SetSeineUI getUi() {
- return (SetSeineUI) super.getUi();
- }
-
public String updateTypeValue(SchoolType schoolType) {
if (schoolType == null) {
return t("observe.content.setSeine.schoolType.not.fill");
@@ -152,48 +142,6 @@ public class SetSeineUIHandler extends ContentUIHandler<SetSeineDto> {
ui.getEndPursingTimeStamp().getSliderHidor().addPropertyChangeListener(HidorButton.PROPERTY_TARGET_VISIBLE, onToogleTimeEditorSliderChangedListener);
ui.getEndSetTimeStamp().getSliderHidor().addPropertyChangeListener(HidorButton.PROPERTY_TARGET_VISIBLE, onToogleTimeEditorSliderChangedListener);
- ui.setFocusCycleRoot(true);
- ui.setFocusTraversalPolicy(new LayoutFocusTraversalPolicy() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- if (aComponent.getParent().equals(ui.getStartTime().getHourEditor().getEditor())) {
- return getLastComponent(aContainer);
- }
- case 1:
- if (aComponent.equals(ui.getSchoolThickness().getTextField())) {
- return getLastComponent(aContainer);
- }
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getFirstComponent(Container aContainer) {
- int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- JComponent editor = ui.getStartTime().getHourEditor().getEditor();
- return ((JSpinner.DateEditor) editor).getTextField();
- case 1:
- return ui.getSchoolThickness();
- }
- return super.getFirstComponent(aContainer);
- }
-
- @Override
- public Component getLastComponent(Container aContainer) {
- if (ui.getDelete().isVisible() && ui.getDelete().isEnabled()) {
- return ui.getDelete();
- }
- if (ui.getSave().isEnabled()) {
- return ui.getSave();
- }
- return ui.getReset();
- }
- });
}
@Override
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUI.jaxx
index b40b058..f0091a0 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUI.jaxx
@@ -21,7 +21,7 @@
-->
<fr.ird.observe.application.swing.ui.content.ContentUI
- abstract='true' superGenericType='E'
+ abstract='true' superGenericType='E, U'
genericType='E extends IdDto, C extends DataDto, U extends ContentListUI<E,C, U>'>
<import>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUIHandler.java
index a2efb7f..d98dabe 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUIHandler.java
@@ -61,7 +61,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.5
*/
-public abstract class ContentListUIHandler<E extends IdDto, C extends DataDto, U extends ContentListUI<E, C, U>> extends ContentUIHandler<E> {
+public abstract class ContentListUIHandler<E extends IdDto, C extends DataDto, U extends ContentListUI<E, C, U>> extends ContentUIHandler<E, U> {
/** Logger */
private static final Log log = LogFactory.getLog(ContentListUIHandler.class);
@@ -89,11 +89,6 @@ public abstract class ContentListUIHandler<E extends IdDto, C extends DataDto, U
}
@Override
- public U getUi() {
- return (U) super.getUi();
- }
-
- @Override
public final ContentListUIModel<E, C> getModel() {
return (ContentListUIModel<E, C>) super.getModel();
}
@@ -110,53 +105,6 @@ public abstract class ContentListUIHandler<E extends IdDto, C extends DataDto, U
ListCellRenderer renderer2 = new EntityListCellRenderer(renderer, treeHelper);
getUi().getList().setCellRenderer(renderer2);
- getUi().setFocusCycleRoot(true);
- getUi().setFocusTraversalPolicy(new LayoutFocusTraversalPolicy() {
-
- private List<JComponent> actions;
-
- @Override
- public Component getFirstComponent(Container aContainer) {
- return getUi().getList();
- }
-
- public List<JComponent> getActions() {
- if (actions == null) {
-
- actions = new ArrayList<>();
- actions.add(getUi().getGotoSelectedChild());
- actions.add(getUi().getReopenChild());
- actions.add(getUi().getCloseChild());
- actions.add(getUi().getGotoOpenChild());
- actions.add(getUi().getGotoOpenChild2());
- actions.add(getUi().getCreateChild());
- for (Component component : getUi().getExtraActions().getComponents()) {
- if (component instanceof JButton) {
- actions.add((JComponent) component);
- }
- }
- actions.add(getUi().getMoveSelectedChildren());
-
- }
- List<JComponent> result = new ArrayList<>(actions);
- Collections.reverse(result);
- return result;
- }
-
- @Override
- public Component getLastComponent(Container aContainer) {
- Optional<JComponent> optional = getActions().stream().filter(a -> a.isEnabled() && a.isVisible()).findFirst();
- return optional.isPresent() ? optional.get() : super.getLastComponent(aContainer);
- }
-
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- if (aComponent.equals(getUi().getList())) {
- return getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
- });
}
@Override
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/ActivitySeinesUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/ActivitySeinesUIHandler.java
index 8e13d88..56536bd 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/ActivitySeinesUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/ActivitySeinesUIHandler.java
@@ -24,14 +24,13 @@ package fr.ird.observe.application.swing.ui.content.list.impl.seine;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
import fr.ird.observe.application.swing.db.DataContext;
import fr.ird.observe.application.swing.db.constants.DataContextType;
-import fr.ird.observe.application.swing.ui.content.open.impl.seine.ActivitySeineUI;
+import fr.ird.observe.application.swing.ui.content.ContentMode;
+import fr.ird.observe.application.swing.ui.content.list.ContentListUIHandler;
import fr.ird.observe.services.dto.DataReference;
import fr.ird.observe.services.dto.DataReferenceSet;
import fr.ird.observe.services.dto.seine.ActivitySeineDto;
import fr.ird.observe.services.dto.seine.RouteDto;
import fr.ird.observe.services.service.data.seine.ActivitySeineService;
-import fr.ird.observe.application.swing.ui.content.ContentMode;
-import fr.ird.observe.application.swing.ui.content.list.ContentListUIHandler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUI.jaxx
index ba5ebcd..bc7195b 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUI.jaxx
@@ -21,7 +21,7 @@
-->
<fr.ird.observe.application.swing.ui.content.ContentUI
- abstract='true' superGenericType='E'
+ abstract='true' superGenericType='E, U'
genericType='E extends IdDto, U extends ContentOpenableUI<E, U>'>
<import>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUIHandler.java
index 491671c..bb95dae 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUIHandler.java
@@ -39,16 +39,13 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.validator.NuitonValidatorScope;
-import javax.swing.JComponent;
-import java.awt.FocusTraversalPolicy;
-
import static org.nuiton.i18n.I18n.t;
/**
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.0
*/
-public abstract class ContentOpenableUIHandler<E extends IdDto, U extends ContentOpenableUI<E, U>> extends ContentUIHandler<E> {
+public abstract class ContentOpenableUIHandler<E extends IdDto, U extends ContentOpenableUI<E, U>> extends ContentUIHandler<E, U> {
protected static final String POSITION_OPENABLE = "positionOpenable";
@@ -67,21 +64,6 @@ public abstract class ContentOpenableUIHandler<E extends IdDto, U extends Conten
protected abstract boolean obtainCanReopen(boolean create);
-
- public void initUI() {
-
- super.initUI();
- ((JComponent) ui).setFocusCycleRoot(true);
- ((JComponent) ui).setFocusTraversalPolicy(createFocusTraversalPolicy(getUi()));
- }
-
- protected abstract FocusTraversalPolicy createFocusTraversalPolicy(U ui);
-
- @Override
- public U getUi() {
- return (U) super.getUi();
- }
-
@Override
public ContentOpenableUIModel<E> getModel() {
return (ContentOpenableUIModel<E>) super.getModel();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/ActivityLonglineUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/ActivityLonglineUIHandler.java
index b0fbc96..23fb43f 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/ActivityLonglineUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/ActivityLonglineUIHandler.java
@@ -40,11 +40,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.validator.NuitonValidatorScope;
-import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.SwingUtilities;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.FocusTraversalPolicy;
import static org.nuiton.i18n.I18n.n;
import static org.nuiton.i18n.I18n.t;
@@ -76,38 +72,6 @@ class ActivityLonglineUIHandler extends ContentOpenableUIHandler<ActivityLonglin
}
@Override
- protected FocusTraversalPolicy createFocusTraversalPolicy(ActivityLonglineUI ui) {
- return new LayoutFocusTraversalPolicy() {
-
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- if (aComponent.equals(ui.getTimeStamp().getDayDateEditor().getEditor())) {
- if (ui.getCloseAndCreate().isEnabled()) {
- return ui.getCloseAndCreate();
- }
- return ui.getDelete();
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getComponentAfter(Container aContainer, Component aComponent) {
- if (!ui.getCloseAndCreate().isEnabled() && aComponent.equals(ui.getDelete())) {
-
- // retour au début
- return ui.getTimeStamp().getDayDateEditor().getEditor();
- }
- if (aComponent.equals(ui.getCloseAndCreate())) {
-
- // retour au début
- return ui.getTimeStamp().getDayDateEditor().getEditor();
- }
- return super.getComponentAfter(aContainer, aComponent);
- }
- };
- }
-
- @Override
protected boolean doOpenData() {
boolean result = getOpenDataManager().canOpenActivityLongline(getSelectedParentId());
if (result) {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/TripLonglineUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/TripLonglineUIHandler.java
index 1ea6413..9e6dea6 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/TripLonglineUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/TripLonglineUIHandler.java
@@ -45,11 +45,7 @@ import org.apache.commons.logging.LogFactory;
import org.nuiton.util.DateUtil;
import javax.swing.JTabbedPane;
-import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.SwingUtilities;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.FocusTraversalPolicy;
import java.util.Collection;
import java.util.Date;
import java.util.LinkedList;
@@ -78,44 +74,6 @@ class TripLonglineUIHandler extends ContentOpenableUIHandler<TripLonglineDto,Tri
n("observe.content.tripLongline.message.not.open"));
}
-// @Override
-// public TripLonglineUI getUi() {
-// return (TripLonglineUI) super.getUi();
-// }
-
-
- @Override
- protected FocusTraversalPolicy createFocusTraversalPolicy(TripLonglineUI ui) {
- return new LayoutFocusTraversalPolicy() {
-
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- if (aComponent.equals(ui.getTripType().getCombobox().getEditor().getEditorComponent())) {
- if (ui.getCloseAndCreate().isEnabled()) {
- return ui.getCloseAndCreate();
- }
- return ui.getDelete();
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getComponentAfter(Container aContainer, Component aComponent) {
- if (!ui.getCloseAndCreate().isEnabled() && aComponent.equals(ui.getDelete())) {
-
- // retour au début
- return ui.getTripType();
- }
- if (aComponent.equals(ui.getCloseAndCreate())) {
-
- // retour au début
- return ui.getTripType();
- }
- return super.getComponentAfter(aContainer, aComponent);
- }
- };
- }
-
@Override
public boolean doCloseData() {
boolean result = getOpenDataManager().isOpenTripLongline(getSelectedId());
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/ActivitySeineUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/ActivitySeineUIHandler.java
index de4ee78..381b4aa 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/ActivitySeineUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/ActivitySeineUIHandler.java
@@ -43,14 +43,8 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.validator.NuitonValidatorScope;
-import javax.swing.JComponent;
-import javax.swing.JSpinner;
-import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.SwingUtilities;
import javax.swing.event.TableModelListener;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.FocusTraversalPolicy;
import java.util.HashSet;
import java.util.Set;
@@ -83,61 +77,6 @@ class ActivitySeineUIHandler extends ContentOpenableUIHandler<ActivitySeineDto,
}
@Override
- protected FocusTraversalPolicy createFocusTraversalPolicy(ActivitySeineUI ui) {
- return new LayoutFocusTraversalPolicy() {
-
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- if (aComponent.getParent().equals(ui.getTime().getHourEditor().getEditor())) {
- if (ui.getCloseAndCreate().isEnabled()) {
- return ui.getCloseAndCreate();
- }
- return ui.getDelete();
- }
- break;
- case 1:
- if (aComponent.equals(ui.getVesselSpeed().getTextField())) {
- return getLastComponent(aContainer);
- }
- case 2:
- if (aComponent.equals(ui.getObservedSystem().getUniverseList())) {
- return getLastComponent(aContainer);
- }
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getFirstComponent(Container aContainer) {
- int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- JComponent editor = ui.getTime().getHourEditor().getEditor();
- return ((JSpinner.DateEditor) editor).getTextField();
- case 1:
- return ui.getVesselSpeed();
- case 2: return ui.getObservedSystem().getUniverseList();
- }
- return super.getFirstComponent(aContainer);
- }
-
- @Override
- public Component getLastComponent(Container aContainer) {
- if (getModel().isCreatingMode()) {
- if (ui.getSave().isEnabled()) {
- return ui.getSave();
- }
- return ui.getReset();
- } else
- return ui.getCloseAndCreate();
- }
- };
- }
-
- @Override
protected void prepareValidationContext() {
super.prepareValidationContext();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/RouteUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/RouteUIHandler.java
index b911436..6196f15 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/RouteUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/RouteUIHandler.java
@@ -45,10 +45,6 @@ import org.nuiton.util.DateUtil;
import org.nuiton.validator.NuitonValidatorScope;
import javax.swing.JOptionPane;
-import javax.swing.LayoutFocusTraversalPolicy;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.FocusTraversalPolicy;
import java.util.Date;
import static org.nuiton.i18n.I18n.n;
@@ -71,38 +67,6 @@ class RouteUIHandler extends ContentOpenableUIHandler<RouteDto, RouteUI> {
}
@Override
- protected FocusTraversalPolicy createFocusTraversalPolicy(RouteUI ui) {
- return new LayoutFocusTraversalPolicy() {
-
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- if (aComponent.equals(ui.getDate().getEditor())) {
- if (ui.getCloseAndCreate().isEnabled()) {
- return ui.getCloseAndCreate();
- }
- return ui.getDelete();
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getComponentAfter(Container aContainer, Component aComponent) {
- if (!ui.getCloseAndCreate().isEnabled() && aComponent.equals(ui.getDelete())) {
-
- // retour au début
- return ui.getDate();
- }
- if (aComponent.equals(ui.getCloseAndCreate())) {
-
- // retour au début
- return ui.getDate();
- }
- return super.getComponentAfter(aContainer, aComponent);
- }
- };
- }
-
- @Override
protected ContentMode getContentMode(DataContext dataContext) {
String routeId = getSelectedId();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/TripSeineUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/TripSeineUIHandler.java
index 7a31c57..f2ef463 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/TripSeineUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/TripSeineUIHandler.java
@@ -85,38 +85,6 @@ class TripSeineUIHandler extends ContentOpenableUIHandler<TripSeineDto, TripSein
}
@Override
- protected FocusTraversalPolicy createFocusTraversalPolicy(TripSeineUI ui) {
- return new LayoutFocusTraversalPolicy() {
-
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- if (aComponent.equals(ui.getCaptain().getCombobox().getEditor().getEditorComponent())) {
- if (ui.getCloseAndCreate().isEnabled()) {
- return ui.getCloseAndCreate();
- }
- return ui.getDelete();
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getComponentAfter(Container aContainer, Component aComponent) {
- if (!ui.getCloseAndCreate().isEnabled() && aComponent.equals(ui.getDelete())) {
-
- // retour au début
- return ui.getCaptain();
- }
- if (aComponent.equals(ui.getCloseAndCreate())) {
-
- // retour au début
- return ui.getCaptain();
- }
- return super.getComponentAfter(aContainer, aComponent);
- }
- };
- }
-
- @Override
public void initUI() {
super.initUI();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/VesselActivitySeineUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentI18nReferenceUI.jaxx
similarity index 54%
copy from application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/VesselActivitySeineUI.jaxx
copy to application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentI18nReferenceUI.jaxx
index 4001742..70df810 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/VesselActivitySeineUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentI18nReferenceUI.jaxx
@@ -20,70 +20,21 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='VesselActivitySeineDto'>
-
- <style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
+<ContentReferenceUI abstract='true' superGenericType='E, U'
+ genericType='E extends I18nReferentialDto, U extends ContentI18nReferenceUI<E, U>'>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
- fr.ird.observe.services.dto.referential.seine.VesselActivitySeineDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
+ fr.ird.observe.services.dto.referential.I18nReferentialDto
+ static org.nuiton.i18n.I18n.t
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
- </import>
-
- <!-- validator -->
- <BeanValidator id='validator' autoField='true' context='ui-create' errorTableModel='{getErrorTableModel()}'
- beanClass='fr.ird.observe.services.dto.referential.seine.VesselActivitySeineDto'/>
-
- <!-- model -->
- <VesselActivitySeineUIModel id='model'/>
-
- <!-- edit bean -->
- <VesselActivitySeineDto id='bean'/>
-
- <Table id='editTable'>
-
- <!-- uri -->
- <row>
- <cell anchor="west">
- <JLabel id='uriLabel' styleClass='unique'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='uri' styleClass='unique' onKeyReleased='getBean().setUri(uri.getText())'/>
- </cell>
- </row>
- <!-- code / status -->
- <row>
- <cell anchor="west">
- <JLabel id='codeStatusLabel'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST' onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER' constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
- </JPanel>
- </cell>
- </row>
+ </import>
- <!-- needComment -->
- <row>
- <cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
- </cell>
- </row>
- <!-- allowFad -->
- <row>
- <cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='allowFad' onItemStateChanged='getBean().setAllowFad(allowFad.isSelected())'/>
- </cell>
- </row>
- </Table>
+ <script>
+ @Override
+ public E getBean() { return (E) super.getBean(); }
+ </script>
<Table id='editI18nTable'>
<row>
@@ -143,4 +94,5 @@
</cell>
</row>
</Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+
+</ContentReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentI18nReferenceUI.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentI18nReferenceUI.jcss
new file mode 100644
index 0000000..a4ef0b7
--- /dev/null
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentI18nReferenceUI.jcss
@@ -0,0 +1,71 @@
+#label1Label {
+ text:"observe.common.label1";
+ labelFor:{label1};
+}
+
+#label1 {
+ text:{getStringValue(getBean().getLabel1())};
+}
+
+#label2Label {
+ text:"observe.common.label2";
+ labelFor:{label2};
+}
+
+#label2 {
+ text:{getStringValue(getBean().getLabel2())};
+}
+
+#label3Label {
+ text:"observe.common.label3";
+ labelFor:{label3};
+}
+
+#label3 {
+ text:{getStringValue(getBean().getLabel3())};
+}
+
+#label4Label {
+ text:"observe.common.label4";
+ labelFor:{label4};
+}
+
+#label4 {
+ text:{getStringValue(getBean().getLabel4())};
+}
+
+#label5Label {
+ text:"observe.common.label5";
+ labelFor:{label5};
+}
+
+#label5 {
+ text:{getStringValue(getBean().getLabel5())};
+}
+
+#label6Label {
+ text:"observe.common.label6";
+ labelFor:{label6};
+}
+
+#label6 {
+ text:{getStringValue(getBean().getLabel6())};
+}
+
+#label7Label {
+ text:"observe.common.label7";
+ labelFor:{label7};
+}
+
+#label7 {
+ text:{getStringValue(getBean().getLabel7())};
+}
+
+#label8Label {
+ text:"observe.common.label8";
+ labelFor:{label8};
+}
+
+#label8 {
+ text:{getStringValue(getBean().getLabel8())};
+}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUI.jaxx
index 9933a45..7bf35bf 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUI.jaxx
@@ -20,10 +20,9 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ContentUI abstract='true'
- superGenericType='E'
+<fr.ird.observe.application.swing.ui.content.ContentUI abstract='true' superGenericType='E, U'
contentTitle='{t("observe.type.management", t(ObserveI18nDecoratorHelper.getTypePluralI18nKey(bean.getClass())))}'
- genericType='E extends ReferentialDto'>
+ genericType='E extends ReferentialDto, U extends ContentReferenceUI<E, U>'>
<import>
fr.ird.observe.services.dto.referential.ReferentialDto
@@ -40,13 +39,15 @@
javax.swing.DefaultListModel
javax.swing.ListSelectionModel
javax.swing.JTable
+ javax.swing.JTextField
javax.swing.UIManager
javax.swing.table.TableCellRenderer
static org.nuiton.i18n.I18n.t
</import>
- <java.lang.String id='pluralTypeI18nKey' initializer='t(ObserveI18nDecoratorHelper.getTypePluralI18nKey(bean.getClass()))'/>
+ <java.lang.String id='pluralTypeI18nKey'
+ initializer='t(ObserveI18nDecoratorHelper.getTypePluralI18nKey(bean.getClass()))'/>
<java.lang.String id='typeI18nKey' initializer='t(ObserveI18nDecoratorHelper.getTypeI18nKey(bean.getClass()))'/>
<java.lang.String id='listText' initializer='t("observe.type.list", pluralTypeI18nKey)'/>
@@ -58,7 +59,9 @@
<ContentReferenceUIModel id='model' genericType='E'/>
- <ContentReferenceUIHandler id='handler' genericType='E' constructorParams='this'/>
+ <ReferentialDto id='bean'/>
+
+ <ContentReferenceUIHandler id='handler' genericType='E, U' constructorParams='(U) this'/>
<BlockingLayerUI id='editKeyTableLayerUI'/>
@@ -72,6 +75,8 @@ public static final String DETAIL_VIEW = "detailView";
public abstract SwingValidator<E> getValidator();
+public abstract JTextField getUri();
+
public void decorateUniqueKeyTable(JTable table,
TableCellRenderer renderer,
JScrollPane pane) {
@@ -98,12 +103,11 @@ viewLayout.addLayoutComponent(editView, DETAIL_VIEW);
</JScrollPane>
</JPanel>
- <Table id="editView" insets="0" weightx="1" fill="both"
- constraints="DETAIL_VIEW">
+ <Table id="editView" insets="0" weightx="1" fill="both" constraints="DETAIL_VIEW">
<row>
<cell anchor='north'>
<!-- pour les autres propriétés du référentiel à editer -->
- <Table id='editTable' fill='both' insets="1"/>
+ <Table id='editTable'/>
</cell>
</row>
<row>
@@ -131,12 +135,6 @@ viewLayout.addLayoutComponent(editView, DETAIL_VIEW);
</Table>
</cell>
</row>
- <!--row>
- <cell weighty="1" anchor='north'>
- <javax.swing.Box.Filler id='filler'
- constructorParams='UIHelper.newMinDimension(), UIHelper.newMinDimension(), UIHelper.newMaxXDimension()'/>
- </cell>
- </row-->
</Table>
</JPanel>
@@ -164,8 +162,7 @@ viewLayout.addLayoutComponent(editView, DETAIL_VIEW);
</row>
<row>
<cell>
- <Table id="detailActions" fill='both' insets="1,4,1,1"
- visible='{model.isEditing()}'>
+ <Table id="detailActions" fill='both' insets="1,4,1,1" visible='{model.isEditing()}'>
<row>
<cell fill="both" weightx="1">
<Table fill="both" weightx="1" insets="1" visible='{!model.isReadingMode()}'>
@@ -186,7 +183,6 @@ viewLayout.addLayoutComponent(editView, DETAIL_VIEW);
<row>
<cell fill="both" weightx="1">
<JButton id='backToList' onActionPerformed='getHandler().backToList()'/>
- <!--onActionPerformed='getHandelr().backToList();if (!model.isModified() || fr.ird.observe.application.swing.ui.content.ContentUIHandler.checkEdit(this)) { stopEdit(); }'/-->
</cell>
</row>
</Table>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUI.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUI.jcss
index 47ea585..e325e6d 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUI.jcss
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUI.jcss
@@ -103,6 +103,7 @@
#reset{
_observeAction:"ResetEditUIAction.ACTION_NAME";
enabled:{model.isModified()};
+ visible:{model.isUpdatingMode()};
}
#save {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUIHandler.java
index 62ccbc2..c04f2f5 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ContentReferenceUIHandler.java
@@ -93,23 +93,23 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.4
*/
-public class ContentReferenceUIHandler<E extends ReferentialDto> extends ContentUIHandler<E> {
+public class ContentReferenceUIHandler<E extends ReferentialDto, U extends ContentReferenceUI<E, U>> extends ContentUIHandler<E, U> {
/** Logger */
private static final Log log = LogFactory.getLog(ContentReferenceUIHandler.class);
private final Runnable revalidate;
- private final ReferentialContentUIInitializer<E, ContentReferenceUI<E>> uiInitializer;
+ private final ReferentialContentUIInitializer<E, U> uiInitializer;
- public ContentReferenceUIHandler(ContentReferenceUI<E> ui) {
+ public ContentReferenceUIHandler(U ui) {
super(ui, null, null);
uiInitializer = new ReferentialContentUIInitializer<>(ui);
revalidate = () -> {
// revalidate ui layout
- ContentReferenceUI<E> ui1 = getUi();
+ ContentReferenceUI<E, U> ui1 = getUi();
Container parent = ui1.getParent();
if (parent == null) {
@@ -230,11 +230,6 @@ public class ContentReferenceUIHandler<E extends ReferentialDto> extends Content
}
@Override
- public ContentReferenceUI<E> getUi() {
- return (ContentReferenceUI<E>) super.getUi();
- }
-
- @Override
public ContentReferenceUIModel<E> getModel() {
return getUi().getModel();
}
@@ -367,7 +362,7 @@ public class ContentReferenceUIHandler<E extends ReferentialDto> extends Content
type = t(type);
String message = t("observe.message.show.usages", type, decorator.toString(bean));
- ContentReferenceUI<E> ui = getUi();
+ ContentReferenceUI<E, U> ui = getUi();
UsagesUI usagesUI = new UsagesUI(ui);
usagesUI.init(message, null, null, usages, null);
@@ -390,12 +385,13 @@ public class ContentReferenceUIHandler<E extends ReferentialDto> extends Content
uiInitializer.initUI();
- ContentReferenceUI<E> ui = getUi();
+ U ui = getUi();
ui.getViewLayout().addPropertyChangeListener(CardLayout2Ext.SELECTED_PROPERTY_NAME,
evt -> SwingUtilities.invokeLater(revalidate));
-// UIHelper.getLayer(ui.getEditKeyTable()).setUI(ui.getEditKeyTableLayerUI());
+ ObserveSwingApplicationContext.get().getFocusManager().setFocusTraversalPolicy(ui);
+
}
@Override
@@ -410,7 +406,7 @@ public class ContentReferenceUIHandler<E extends ReferentialDto> extends Content
// Chargement des données
updateUiWithReferenceSetsFromModel();
- ContentReferenceUI<E> ui = getUi();
+ ContentReferenceUI<E, U> ui = getUi();
if (I18nReferentialDto.class.isAssignableFrom(model.getBeanType())) {
// on met en gras le libelle selectionne en base
@@ -455,7 +451,7 @@ public class ContentReferenceUIHandler<E extends ReferentialDto> extends Content
super.updateToolbarActions();
// on ajoute les deux actions showUsages et showUniqueKeys
- ContentReferenceUI<E> ui = getUi();
+ ContentReferenceUI<E, U> ui = getUi();
JToolBar toolBar = ui.getTitleRightToolBar();
toolBar.add(ui.getShowUniqueKeys(), 2);
// toolBar.add(ui.getShowTechnicalInformations(), 2);
@@ -465,7 +461,7 @@ public class ContentReferenceUIHandler<E extends ReferentialDto> extends Content
@Override
public void startEditUI(String... binding) {
- ContentReferenceUI<E> ui = getUi();
+ U ui = getUi();
ContentReferenceUIModel<E> model = getModel();
@@ -549,7 +545,7 @@ public class ContentReferenceUIHandler<E extends ReferentialDto> extends Content
void createUI() {
- ContentReferenceUI<E> ui = getUi();
+ ContentReferenceUI<E, U> ui = getUi();
// force le mode creation
getModel().setMode(ContentMode.CREATE);
@@ -582,7 +578,7 @@ public class ContentReferenceUIHandler<E extends ReferentialDto> extends Content
public void stopEditUI() {
super.stopEditUI();
- ContentReferenceUI<E> ui = getUi();
+ U ui = getUi();
ContentReferenceUIModel<E> model = getModel();
if (model.getMode() != ContentMode.READ) {
@@ -730,7 +726,7 @@ public class ContentReferenceUIHandler<E extends ReferentialDto> extends Content
@Override
protected boolean doDelete(E bean) {
- ContentReferenceUI<E> ui = getUi();
+ ContentReferenceUI<E, U> ui = getUi();
ContentReferenceUIModel<E> model = getModel();
if (log.isInfoEnabled()) {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ReferenceHomeUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ReferenceHomeUI.jaxx
index 595cce2..3326f7c 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ReferenceHomeUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ReferenceHomeUI.jaxx
@@ -20,11 +20,7 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ContentUI
- superGenericType='ProgramDto'
-
- >
-
+<fr.ird.observe.application.swing.ui.content.ContentUI superGenericType='ProgramDto, ReferenceHomeUI'>
<import>
fr.ird.observe.services.dto.referential.ProgramDto
fr.ird.observe.application.swing.ui.content.ContentMode
@@ -34,7 +30,6 @@
<ReferenceHomeUIHandler id='handler' constructorParams='this'/>
-
<Table id='body' fill='both' weighty="1">
<row weighty="1" weightx="1">
<cell>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ReferenceHomeUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ReferenceHomeUIHandler.java
index 30bfc5e..1739471 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ReferenceHomeUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ReferenceHomeUIHandler.java
@@ -24,9 +24,9 @@ package fr.ird.observe.application.swing.ui.content.ref;
import fr.ird.observe.application.swing.db.DataContext;
import fr.ird.observe.application.swing.db.ObserveSwingDataSource;
-import fr.ird.observe.services.dto.referential.ProgramDto;
import fr.ird.observe.application.swing.ui.content.ContentMode;
import fr.ird.observe.application.swing.ui.content.ContentUIHandler;
+import fr.ird.observe.services.dto.referential.ProgramDto;
/**
* Created on 9/28/14.
@@ -34,7 +34,7 @@ import fr.ird.observe.application.swing.ui.content.ContentUIHandler;
* @author Tony Chemit - chemit(a)codelutin.com
* @since XXX
*/
-public class ReferenceHomeUIHandler extends ContentUIHandler<ProgramDto> {
+public class ReferenceHomeUIHandler extends ContentUIHandler<ProgramDto, ReferenceHomeUI> {
public ReferenceHomeUIHandler(ReferenceHomeUI ui) {
super(ui, null, null);
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ReferenceHomeUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ReferenceHomeUIModel.java
index bd0b3a0..197b62e 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ReferenceHomeUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ReferenceHomeUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref;
* #L%
*/
-import fr.ird.observe.services.dto.referential.ProgramDto;
import fr.ird.observe.application.swing.ui.content.ContentUIModel;
+import fr.ird.observe.services.dto.referential.ProgramDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ReferentialContentUIInitializer.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ReferentialContentUIInitializer.java
index c99ad10..67db91f 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ReferentialContentUIInitializer.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/ReferentialContentUIInitializer.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref;
* #L%
*/
-import fr.ird.observe.services.dto.referential.ReferentialDto;
import fr.ird.observe.application.swing.ui.content.ContentUIInitializer;
+import fr.ird.observe.services.dto.referential.ReferentialDto;
/**
* Created on 11/28/14.
@@ -31,12 +31,9 @@ import fr.ird.observe.application.swing.ui.content.ContentUIInitializer;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.9
*/
-public class ReferentialContentUIInitializer<E extends ReferentialDto, UI extends ContentReferenceUI<E>> extends ContentUIInitializer<E, UI> {
+public class ReferentialContentUIInitializer<E extends ReferentialDto, U extends ContentReferenceUI<E, U>> extends ContentUIInitializer<E, U> {
-// /** Logger. */
-// private static final Log log = LogFactory.getLog(ReferentialContentUIInitializer.class);
-
- public ReferentialContentUIInitializer(UI ui) {
+ public ReferentialContentUIInitializer(U ui) {
super(ui);
}
@@ -50,8 +47,4 @@ public class ReferentialContentUIInitializer<E extends ReferentialDto, UI extend
}
-// protected Decorator<ReferenceDto> getDecorator(Class<? extends ReferentialDto> dtoClass) {
-// return ObserveSwingApplicationContext.get().getDecorator(ReferenceDto.class, dtoClass.getSimpleName());
-// }
-
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/UniqueKeyTableModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/UniqueKeyTableModel.java
index f7fd9d6..54ca68b 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/UniqueKeyTableModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/UniqueKeyTableModel.java
@@ -21,8 +21,8 @@
*/
package fr.ird.observe.application.swing.ui.content.ref;
-import fr.ird.observe.application.swing.decoration.DecoratorService;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
+import fr.ird.observe.application.swing.decoration.DecoratorService;
import fr.ird.observe.application.swing.decoration.ObserveI18nDecoratorHelper;
import javax.swing.table.AbstractTableModel;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/CountryUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/CountryUI.jaxx
index cef1e33..b96eac0 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/CountryUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/CountryUI.jaxx
@@ -20,25 +20,21 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='CountryDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI superGenericType='CountryDto, CountryUI'>
<style source="ReferenceEntity.jcss"/>
- <style source="I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.CountryDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.CountryDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<CountryUIModel id='model'/>
@@ -65,12 +61,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' constraints='BorderLayout.WEST'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -81,8 +75,7 @@
<JLabel id='iso2CodeLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <JTextField id='iso2Code'
- onKeyReleased='getBean().setIso2Code(iso2Code.getText())'/>
+ <JTextField id='iso2Code' onKeyReleased='getBean().setIso2Code(iso2Code.getText())'/>
</cell>
</row>
@@ -92,84 +85,16 @@
<JLabel id='iso3CodeLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <JTextField id='iso3Code'
- onKeyReleased='getBean().setIso3Code(iso3Code.getText())'/>
+ <JTextField id='iso3Code' onKeyReleased='getBean().setIso3Code(iso3Code.getText())'/>
</cell>
</row>
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/CountryUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/CountryUIModel.java
index d5ab75a..45a9049 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/CountryUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/CountryUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
* #L%
*/
-import fr.ird.observe.services.dto.referential.CountryDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.CountryDto;
/**
* Created on 9/27/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/FpaZoneUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/FpaZoneUI.jaxx
index 1b73d4d..7d05e3d 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/FpaZoneUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/FpaZoneUI.jaxx
@@ -20,20 +20,17 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='FpaZoneDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI superGenericType='FpaZoneDto, FpaZoneUI'>
<style source="ReferenceEntity.jcss"/>
- <style source="I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.FpaZoneDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
org.jdesktop.swingx.JXDatePicker
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
@@ -67,12 +64,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -80,8 +75,7 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
@@ -92,80 +86,11 @@
</cell>
<cell anchor='west' weightx="1" fill="both">
<JPanel layout='{new GridLayout()}'>
- <JXDatePicker id='startDate'
- onActionPerformed='getBean().setStartDate(startDate.getDate())'/>
- <JXDatePicker id='endDate'
- onActionPerformed='getBean().setEndDate(endDate.getDate())'/>
+ <JXDatePicker id='startDate' onActionPerformed='getBean().setStartDate(startDate.getDate())'/>
+ <JXDatePicker id='endDate' onActionPerformed='getBean().setEndDate(endDate.getDate())'/>
</JPanel>
</cell>
</row>
</Table>
-
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/FpaZoneUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/FpaZoneUIModel.java
index 4ebdbee..493abcb 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/FpaZoneUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/FpaZoneUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
* #L%
*/
-import fr.ird.observe.services.dto.referential.FpaZoneDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.FpaZoneDto;
/**
* Created on 9/27/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearCaracteristicTypeUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearCaracteristicTypeUI.jaxx
index 88f145d..4d594c9 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearCaracteristicTypeUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearCaracteristicTypeUI.jaxx
@@ -20,25 +20,22 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='GearCaracteristicTypeDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='GearCaracteristicTypeDto, GearCaracteristicTypeUI'>
<style source="ReferenceEntity.jcss"/>
- <style source="I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.GearCaracteristicTypeDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.GearCaracteristicTypeDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<GearCaracteristicTypeUIModel id='model'/>
@@ -54,7 +51,7 @@
<JLabel id="uriLabel"/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <JTextField id='uri' onKeyReleased='getBean().setUri(uri.getText())'/>
+ <JTextField id='uri'/>
</cell>
</row>
@@ -65,12 +62,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,77 +73,9 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
-
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearCaracteristicTypeUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearCaracteristicTypeUIModel.java
index 2456d74..eace8f9 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearCaracteristicTypeUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearCaracteristicTypeUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
* #L%
*/
-import fr.ird.observe.services.dto.referential.GearCaracteristicTypeDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.GearCaracteristicTypeDto;
/**
* Created on 3/23/15.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearCaracteristicUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearCaracteristicUI.jaxx
index 5b56c3b..694d0d5 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearCaracteristicUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearCaracteristicUI.jaxx
@@ -20,29 +20,26 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='GearCaracteristicDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='GearCaracteristicDto, GearCaracteristicUI'>
<style source="ReferenceEntity.jcss"/>
- <style source="I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.ReferentialReference
fr.ird.observe.services.dto.referential.GearCaracteristicDto
fr.ird.observe.services.dto.referential.GearCaracteristicTypeDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
jaxx.runtime.swing.editor.bean.BeanComboBox
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.GearCaracteristicDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<GearCaracteristicUIModel id='model'/>
@@ -69,12 +66,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -82,8 +77,7 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
@@ -93,7 +87,9 @@
<JLabel id='gearCaracteristicTypeLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <BeanComboBox id='gearCaracteristicType' constructorParams='this' genericType='ReferentialReference<GearCaracteristicTypeDto>' _entityClass='GearCaracteristicTypeDto.class'/>
+ <BeanComboBox id='gearCaracteristicType' constructorParams='this'
+ genericType='ReferentialReference<GearCaracteristicTypeDto>'
+ _entityClass='GearCaracteristicTypeDto.class'/>
</cell>
</row>
@@ -109,71 +105,4 @@
</Table>
-
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearCaracteristicUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearCaracteristicUIModel.java
index 1aef09d..2a90e56 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearCaracteristicUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearCaracteristicUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
* #L%
*/
-import fr.ird.observe.services.dto.referential.GearCaracteristicDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.GearCaracteristicDto;
/**
* Created on 3/23/15.
@@ -42,7 +42,7 @@ public class GearCaracteristicUIModel extends ContentReferenceUIModel<GearCaract
GearCaracteristicDto.PROPERTY_UNIT,
},
new String[]{GearCaracteristicDto.PROPERTY_GEAR_CARACTERISTIC_TYPE + SUFFIX_SELECTED_ITEM,
- GearCaracteristicDto.PROPERTY_UNIT + SUFFIX_TEXT}
+ GearCaracteristicDto.PROPERTY_UNIT + SUFFIX_TEXT}
);
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearUI.jaxx
index 868b64e..88dbab2 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearUI.jaxx
@@ -18,30 +18,27 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='GearDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='GearDto, GearUI'>
<style source="ReferenceEntity.jcss"/>
- <style source="I18nReferenceEntity.jcss"/>
+ <style source="../ContentI18nReferenceUI.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.ReferentialReference
fr.ird.observe.services.dto.referential.GearDto
fr.ird.observe.services.dto.referential.GearCaracteristicDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
org.nuiton.jaxx.widgets.select.FilterableDoubleList
java.util.Collection
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
+ static org.nuiton.i18n.I18n.t
</import>
<!-- validator -->
- <BeanValidator id='validator' autoField='true'
- beanClass='fr.ird.observe.services.dto.referential.GearDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ <BeanValidator id='validator' autoField='true' beanClass='fr.ird.observe.services.dto.referential.GearDto'
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<GearUIModel id='model'/>
@@ -76,12 +73,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' constraints='BorderLayout.WEST'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearUI.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearUI.jcss
index f33ae6e..d94bbd7 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearUI.jcss
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearUI.jcss
@@ -30,10 +30,6 @@
icon:{getHandler().getErrorIconIfFalse(model.isGearCaracteristicTabValid())};
}
-#editI18nTable2 {
- border:{new TitledBorder(t("observe.common.libelles"))};
-}
-
#gearCaracteristicPane {
verticalScrollBarPolicy:{JScrollPane.VERTICAL_SCROLLBAR_NEVER};
horizontalScrollBarPolicy:{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER};
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearUIHandler.java
index b0a5b11..82a8e69 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearUIHandler.java
@@ -22,10 +22,9 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
* #L%
*/
+import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIHandler;
import fr.ird.observe.services.dto.referential.GearDto;
import fr.ird.observe.services.dto.referential.ReferentialReference;
-import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI;
-import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIHandler;
import jaxx.runtime.validator.swing.SwingValidatorMessage;
import jaxx.runtime.validator.swing.SwingValidatorMessageTableModel;
import org.nuiton.validator.NuitonValidatorScope;
@@ -40,12 +39,12 @@ import java.util.Set;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.16
*/
-public class GearUIHandler extends ContentReferenceUIHandler<GearDto> {
+public class GearUIHandler extends ContentReferenceUIHandler<GearDto, GearUI> {
// Compute valid state of tab from the error table
protected final TableModelListener computeTabValidStateListener;
- public GearUIHandler(ContentReferenceUI<GearDto> ui) {
+ public GearUIHandler(GearUI ui) {
super(ui);
computeTabValidStateListener = e -> {
@@ -75,7 +74,7 @@ public class GearUIHandler extends ContentReferenceUIHandler<GearDto> {
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
computeTabValidState(errorTableModel);
- ((GearUI) getUi()).getTabPane().setSelectedIndex(0);
+ getUi().getTabPane().setSelectedIndex(0);
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearUIModel.java
index c2ed0ee..905780c 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/GearUIModel.java
@@ -23,8 +23,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
*/
import com.google.common.collect.ImmutableSet;
-import fr.ird.observe.services.dto.referential.GearDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.GearDto;
import java.util.Set;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/HarbourUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/HarbourUI.jaxx
index f73746c..6ceb806 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/HarbourUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/HarbourUI.jaxx
@@ -20,29 +20,26 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='HarbourDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='HarbourDto, HarbourUI'>
<style source="ReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.ReferentialReference
fr.ird.observe.services.dto.referential.HarbourDto
fr.ird.observe.services.dto.referential.CountryDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
jaxx.runtime.swing.editor.bean.BeanComboBox
org.nuiton.jaxx.widgets.gis.absolute.CoordinatesEditor
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
- <BeanValidator id='validator' autoField='true' context='ui-create'
- beanClass='fr.ird.observe.services.dto.referential.HarbourDto'
- errorTableModel='{getErrorTableModel()}'>
+ <BeanValidator id='validator' autoField='true' context='ui-create' errorTableModel='{getErrorTableModel()}'
+ beanClass='fr.ird.observe.services.dto.referential.HarbourDto'>
<field name='longitude' component='coordinates'/>
<field name='latitude' component='coordinates'/>
@@ -76,12 +73,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -112,7 +107,8 @@
<JLabel id='countryLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <BeanComboBox id='country' constructorParams='this' genericType='ReferentialReference<CountryDto>' _entityClass='CountryDto.class'/>
+ <BeanComboBox id='country' constructorParams='this' genericType='ReferentialReference<CountryDto>'
+ _entityClass='CountryDto.class'/>
</cell>
</row>
@@ -130,8 +126,7 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/HarbourUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/HarbourUIModel.java
index 8de4bed..46c6732 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/HarbourUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/HarbourUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
* #L%
*/
-import fr.ird.observe.services.dto.referential.HarbourDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.HarbourDto;
/**
* Created on 1/7/15.
@@ -38,17 +38,17 @@ public class HarbourUIModel extends ContentReferenceUIModel<HarbourDto> {
public HarbourUIModel() {
super(HarbourDto.class,
new String[]{HarbourDto.PROPERTY_NAME,
- HarbourDto.PROPERTY_COUNTRY,
- HarbourDto.PROPERTY_LOCODE,
- HarbourDto.PROPERTY_LATITUDE,
- HarbourDto.PROPERTY_LONGITUDE,
- HarbourDto.PROPERTY_QUADRANT},
+ HarbourDto.PROPERTY_COUNTRY,
+ HarbourDto.PROPERTY_LOCODE,
+ HarbourDto.PROPERTY_LATITUDE,
+ HarbourDto.PROPERTY_LONGITUDE,
+ HarbourDto.PROPERTY_QUADRANT},
new String[]{HarbourUI.BINDING_COUNTRY_SELECTED_ITEM,
- HarbourUI.BINDING_HARBOUR_NAME_TEXT,
- HarbourUI.BINDING_LOCODE_TEXT,
- HarbourUI.BINDING_COORDINATES_LATITUDE,
- HarbourUI.BINDING_COORDINATES_LONGITUDE,
- HarbourUI.BINDING_COORDINATES_QUADRANT}
+ HarbourUI.BINDING_HARBOUR_NAME_TEXT,
+ HarbourUI.BINDING_LOCODE_TEXT,
+ HarbourUI.BINDING_COORDINATES_LATITUDE,
+ HarbourUI.BINDING_COORDINATES_LONGITUDE,
+ HarbourUI.BINDING_COORDINATES_QUADRANT}
);
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/I18nReferenceEntity.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/I18nReferenceEntity.jcss
deleted file mode 100644
index aa2e74e..0000000
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/I18nReferenceEntity.jcss
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * #%L
- * ObServe :: Swing
- * %%
- * Copyright (C) 2008 - 2010 IRD, Codelutin, Tony Chemit
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-#label1Label {
- text:"observe.common.label1";
- labelFor:{label1};
-}
-
-#label1 {
- text:{getStringValue(bean.getLabel1())};
-}
-
-#label2Label {
- text:"observe.common.label2";
- labelFor:{label2};
-}
-
-#label2 {
- text:{getStringValue(bean.getLabel2())};
-}
-
-#label3Label {
- text:"observe.common.label3";
- labelFor:{label3};
-}
-
-#label3 {
- text:{getStringValue(bean.getLabel3())};
-}
-
-#label4Label {
- text:"observe.common.label4";
- labelFor:{label4};
-}
-
-#label4 {
- text:{getStringValue(bean.getLabel4())};
-}
-
-#label5Label {
- text:"observe.common.label5";
- labelFor:{label5};
-}
-
-#label5 {
- text:{getStringValue(bean.getLabel5())};
-}
-
-#label6Label {
- text:"observe.common.label6";
- labelFor:{label6};
-}
-
-#label6 {
- text:{getStringValue(bean.getLabel6())};
-}
-
-#label7Label {
- text:"observe.common.label7";
- labelFor:{label7};
-}
-
-#label7 {
- text:{getStringValue(bean.getLabel7())};
-}
-
-#label8Label {
- text:"observe.common.label8";
- labelFor:{label8};
-}
-
-#label8 {
- text:{getStringValue(bean.getLabel8())};
-}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/LengthLengthParameterUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/LengthLengthParameterUI.jaxx
index 860bf89..e61e3b3 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/LengthLengthParameterUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/LengthLengthParameterUI.jaxx
@@ -20,17 +20,16 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='LengthLengthParameterDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI
+ superGenericType='LengthLengthParameterDto, LengthLengthParameterUI'>
<style source="ReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.ReferentialReference
fr.ird.observe.services.dto.referential.SizeMeasureTypeDto
fr.ird.observe.services.dto.referential.LengthLengthParameterDto
fr.ird.observe.application.swing.ui.UIHelper
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
jaxx.runtime.swing.editor.NumberEditor
jaxx.runtime.swing.editor.bean.BeanComboBox
@@ -40,7 +39,7 @@
javax.swing.table.TableCellRenderer
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/LengthLengthParameterUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/LengthLengthParameterUIHandler.java
index b0a645b..e1d91d4 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/LengthLengthParameterUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/LengthLengthParameterUIHandler.java
@@ -22,7 +22,6 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
* #L%
*/
-import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIHandler;
import fr.ird.observe.services.dto.referential.LengthLengthParameterDto;
import fr.ird.observe.services.dto.referential.ReferentialReference;
@@ -40,12 +39,12 @@ import java.util.Set;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 5.1
*/
-public class LengthLengthParameterUIHandler extends ContentReferenceUIHandler<LengthLengthParameterDto> {
+public class LengthLengthParameterUIHandler extends ContentReferenceUIHandler<LengthLengthParameterDto, LengthLengthParameterUI> {
// Compute valid state of tab from the error table
protected final TableModelListener computeTabValidStateListener;
- public LengthLengthParameterUIHandler(ContentReferenceUI<LengthLengthParameterDto> ui) {
+ public LengthLengthParameterUIHandler(LengthLengthParameterUI ui) {
super(ui);
computeTabValidStateListener = e -> {
@@ -75,7 +74,7 @@ public class LengthLengthParameterUIHandler extends ContentReferenceUIHandler<Le
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
computeTabValidState(errorTableModel);
- ((LengthLengthParameterUI) getUi()).getTabPane().setSelectedIndex(0);
+ getUi().getTabPane().setSelectedIndex(0);
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/LengthWeightParameterUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/LengthWeightParameterUI.jaxx
index f6bf375..082a22b 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/LengthWeightParameterUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/LengthWeightParameterUI.jaxx
@@ -20,12 +20,12 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='LengthWeightParameterDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI
+ superGenericType='LengthWeightParameterDto, LengthWeightParameterUI'>
<style source="ReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.ReferentialReference
fr.ird.observe.services.dto.referential.SexDto
fr.ird.observe.services.dto.referential.SizeMeasureTypeDto
@@ -33,7 +33,6 @@
fr.ird.observe.services.dto.referential.OceanDto
fr.ird.observe.services.dto.referential.LengthWeightParameterDto
fr.ird.observe.application.swing.ui.UIHelper
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
jaxx.runtime.swing.editor.NumberEditor
jaxx.runtime.swing.editor.bean.BeanComboBox
@@ -45,7 +44,7 @@
javax.swing.table.TableCellRenderer
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/LengthWeightParameterUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/LengthWeightParameterUIHandler.java
index 096cbd3..f059032 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/LengthWeightParameterUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/LengthWeightParameterUIHandler.java
@@ -22,10 +22,9 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
* #L%
*/
+import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIHandler;
import fr.ird.observe.services.dto.referential.LengthWeightParameterDto;
import fr.ird.observe.services.dto.referential.ReferentialReference;
-import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI;
-import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIHandler;
import jaxx.runtime.validator.swing.SwingValidatorMessage;
import jaxx.runtime.validator.swing.SwingValidatorMessageTableModel;
import org.nuiton.validator.NuitonValidatorScope;
@@ -40,12 +39,12 @@ import java.util.Set;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.11
*/
-public class LengthWeightParameterUIHandler extends ContentReferenceUIHandler<LengthWeightParameterDto> {
+public class LengthWeightParameterUIHandler extends ContentReferenceUIHandler<LengthWeightParameterDto, LengthWeightParameterUI> {
// Compute valid state of tab from the error table
protected final TableModelListener computeTabValidStateListener;
- public LengthWeightParameterUIHandler(ContentReferenceUI<LengthWeightParameterDto> ui) {
+ public LengthWeightParameterUIHandler(LengthWeightParameterUI ui) {
super(ui);
computeTabValidStateListener = e -> {
@@ -75,7 +74,7 @@ public class LengthWeightParameterUIHandler extends ContentReferenceUIHandler<Le
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
computeTabValidState(errorTableModel);
- ((LengthWeightParameterUI) getUi()).getTabPane().setSelectedIndex(0);
+ getUi().getTabPane().setSelectedIndex(0);
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/LengthWeightParameterUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/LengthWeightParameterUIModel.java
index 49a61c1..5f0395a 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/LengthWeightParameterUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/LengthWeightParameterUIModel.java
@@ -23,9 +23,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
*/
import com.google.common.collect.ImmutableSet;
-import fr.ird.observe.services.dto.referential.LengthWeightParameterDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
-import fr.ird.observe.services.dto.referential.SpeciesDto;
+import fr.ird.observe.services.dto.referential.LengthWeightParameterDto;
import java.util.Set;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/NeedCommentReferenceEntity.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/NeedCommentReferenceEntity.jcss
deleted file mode 100644
index 9c6fe5d..0000000
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/NeedCommentReferenceEntity.jcss
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * #%L
- * ObServe :: Swing
- * %%
- * Copyright (C) 2008 - 2010 IRD, Codelutin, Tony Chemit
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-#needComment {
- text:"observe.common.needComment";
- selected:{bean.isNeedComment()};
-}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/OceanUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/OceanUI.jaxx
index 1811267..6078bbc 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/OceanUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/OceanUI.jaxx
@@ -20,25 +20,21 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='OceanDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI superGenericType='OceanDto, OceanUI'>
<style source="ReferenceEntity.jcss"/>
- <style source="I18nReferenceEntity.jcss"/>
<import>
fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.OceanDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
- <BeanValidator id='validator' autoField='true'
- beanClass='fr.ird.observe.services.dto.referential.OceanDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ <BeanValidator id='validator' autoField='true' beanClass='fr.ird.observe.services.dto.referential.OceanDto'
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<OceanUIModel id='model'/>
@@ -54,8 +50,7 @@
<JLabel id='uriLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <JTextField id='uri'
- onKeyReleased='getBean().setUri(uri.getText())'/>
+ <JTextField id='uri' onKeyReleased='getBean().setUri(uri.getText())'/>
</cell>
</row>
@@ -66,12 +61,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -79,76 +72,9 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/OceanUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/OceanUIModel.java
index 32d1e6c..37fba7f 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/OceanUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/OceanUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
* #L%
*/
-import fr.ird.observe.services.dto.referential.OceanDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.OceanDto;
/**
* Created on 9/27/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/OrganismUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/OrganismUI.jaxx
index 33022f7..bc3034d 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/OrganismUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/OrganismUI.jaxx
@@ -20,22 +20,20 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='OrganismDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI superGenericType='OrganismDto, OrganismUI'>
<style source="ReferenceEntity.jcss"/>
- <style source="I18nReferenceEntity.jcss"/>
<import>
fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.ReferentialReference
fr.ird.observe.services.dto.referential.OrganismDto
fr.ird.observe.services.dto.referential.CountryDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
jaxx.runtime.swing.editor.bean.BeanComboBox
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
@@ -58,8 +56,7 @@
<JLabel id='uriLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <JTextField id='uri'
- onKeyReleased='getBean().setUri(uri.getText())'/>
+ <JTextField id='uri' onKeyReleased='getBean().setUri(uri.getText())'/>
</cell>
</row>
@@ -70,12 +67,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -86,7 +81,8 @@
<JLabel id='countryLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <BeanComboBox id='country' constructorParams='this' genericType='ReferentialReference<CountryDto>' _entityClass='CountryDto.class'/>
+ <BeanComboBox id='country' constructorParams='this' genericType='ReferentialReference<CountryDto>'
+ _entityClass='CountryDto.class'/>
</cell>
</row>
@@ -96,84 +92,18 @@
<JLabel id='descriptionLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <JTextField id='description'
- onKeyReleased='getBean().setDescription(description.getText())'/>
+ <JTextField id='description' onKeyReleased='getBean().setDescription(description.getText())'/>
</cell>
</row>
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/OrganismUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/OrganismUIModel.java
index 1b5ba0d..c67a242 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/OrganismUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/OrganismUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
* #L%
*/
-import fr.ird.observe.services.dto.referential.OrganismDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.OrganismDto;
/**
* Created on 9/27/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/PersonUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/PersonUI.jaxx
index 7f699e5..fb36489 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/PersonUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/PersonUI.jaxx
@@ -20,7 +20,7 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='PersonDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='PersonDto, PersonUI'>
<style source="ReferenceEntity.jcss"/>
@@ -30,7 +30,6 @@
fr.ird.observe.services.dto.referential.PersonDto
fr.ird.observe.services.dto.referential.CountryDto
fr.ird.observe.application.swing.ui.UIHelper
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
javax.swing.JTable
javax.swing.JScrollPane
@@ -39,7 +38,7 @@
jaxx.runtime.swing.editor.bean.BeanComboBox
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
@@ -71,7 +70,7 @@ public void decorateUniqueKeyTable(JTable table,
<JLabel id='uriLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <JTextField id='uri' onKeyReleased='getBean().setUri(uri.getText())'/>
+ <JTextField id='uri'/>
</cell>
</row>
@@ -82,12 +81,10 @@ public void decorateUniqueKeyTable(JTable table,
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -120,15 +117,15 @@ public void decorateUniqueKeyTable(JTable table,
<JLabel id='countryLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <BeanComboBox id='country' constructorParams='this' genericType='ReferentialReference<CountryDto>' _entityClass='CountryDto.class'/>
+ <BeanComboBox id='country' constructorParams='this' genericType='ReferentialReference<CountryDto>'
+ _entityClass='CountryDto.class'/>
</cell>
</row>
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/PersonUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/PersonUIModel.java
index 93fb9aa..5fb4e96 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/PersonUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/PersonUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
* #L%
*/
-import fr.ird.observe.services.dto.referential.PersonDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.PersonDto;
/**
* Created on 9/27/14.
@@ -48,12 +48,12 @@ public class PersonUIModel extends ContentReferenceUIModel<PersonDto> {
},
new String[]{PersonDto.PROPERTY_CODE},
new String[]{PersonUI.BINDING_CODE_TEXT,
- PersonUI.BINDING_FIRST_NAME_TEXT,
- PersonUI.BINDING_LAST_NAME_TEXT,
- PersonUI.BINDING_CAPTAIN_SELECTED,
- PersonUI.BINDING_OBSERVER_SELECTED,
- PersonUI.BINDING_DATA_ENTRY_OPERATOR_SELECTED,
- PersonUI.BINDING_COUNTRY_SELECTED_ITEM,
+ PersonUI.BINDING_FIRST_NAME_TEXT,
+ PersonUI.BINDING_LAST_NAME_TEXT,
+ PersonUI.BINDING_CAPTAIN_SELECTED,
+ PersonUI.BINDING_OBSERVER_SELECTED,
+ PersonUI.BINDING_DATA_ENTRY_OPERATOR_SELECTED,
+ PersonUI.BINDING_COUNTRY_SELECTED_ITEM,
}
);
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/ProgramUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/ProgramUI.jaxx
index 9592915..9fc60ad 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/ProgramUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/ProgramUI.jaxx
@@ -20,10 +20,10 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='ProgramDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='ProgramDto, ProgramUI'>
<style source="ReferenceEntity.jcss"/>
- <style source="I18nReferenceEntity.jcss"/>
+ <style source="../ContentI18nReferenceUI.jcss"/>
<import>
fr.ird.observe.services.dto.constants.ReferenceStatus
@@ -31,7 +31,6 @@
fr.ird.observe.services.dto.referential.ReferentialReference
fr.ird.observe.services.dto.referential.ProgramDto
fr.ird.observe.services.dto.referential.OrganismDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
fr.ird.observe.application.swing.ui.content.ref.impl.ProgramObservationEnum
jaxx.runtime.swing.editor.bean.BeanComboBox
@@ -41,12 +40,13 @@
java.awt.Dimension
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true' context='ui-create'
- beanClass='fr.ird.observe.services.dto.referential.ProgramDto' errorTableModel='{getErrorTableModel()}'/>
+ beanClass='fr.ird.observe.services.dto.referential.ProgramDto'
+ errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<ProgramUIModel id='model'/>
@@ -83,10 +83,9 @@
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
<JTextField id='code' constraints='BorderLayout.WEST'
onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -210,9 +209,8 @@
<JLabel id='nonTargetObservationLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <EnumEditor id='nonTargetObservation'
+ <EnumEditor id='nonTargetObservation' genericType='ProgramObservationEnum'
constructorParams='ProgramObservationEnum.class, getConfig().getNonTargetObservation()'
- genericType='ProgramObservationEnum'
onItemStateChanged='getBean().setNonTargetObservation(nonTargetObservation.getSelectedIndex())'/>
</cell>
@@ -223,9 +221,8 @@
<JLabel id='targetDiscardsObservationLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <EnumEditor id='targetDiscardsObservation'
+ <EnumEditor id='targetDiscardsObservation' genericType='ProgramObservationEnum'
constructorParams='ProgramObservationEnum.class, getConfig().getTargetDiscardsObservation()'
- genericType='ProgramObservationEnum'
onItemStateChanged='getBean().setTargetDiscardsObservation(targetDiscardsObservation.getSelectedIndex())'/>
</cell>
</row>
@@ -236,9 +233,8 @@
<JLabel id='samplesObservationLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <EnumEditor id='samplesObservation'
+ <EnumEditor id='samplesObservation' genericType='ProgramObservationEnum'
constructorParams='ProgramObservationEnum.class, getConfig().getSamplesObservation()'
- genericType='ProgramObservationEnum'
onItemStateChanged='getBean().setSamplesObservation(samplesObservation.getSelectedIndex())'/>
</cell>
</row>
@@ -248,9 +244,8 @@
<JLabel id='objectsObservationLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <EnumEditor id='objectsObservation'
+ <EnumEditor id='objectsObservation' genericType='ProgramObservationEnum'
constructorParams='ProgramObservationEnum.class, getConfig().getObjectsObservation()'
- genericType='ProgramObservationEnum'
onItemStateChanged='getBean().setObjectsObservation(objectsObservation.getSelectedIndex())'/>
</cell>
</row>
@@ -261,9 +256,8 @@
<JLabel id='detailledActivitiesObservationLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <EnumEditor id='detailledActivitiesObservation'
+ <EnumEditor id='detailledActivitiesObservation' genericType='ProgramObservationEnum'
constructorParams='ProgramObservationEnum.class, getConfig().getDetailledActivitiesObservation()'
- genericType='ProgramObservationEnum'
onItemStateChanged='getBean().setDetailledActivitiesObservation(detailledActivitiesObservation.getSelectedIndex())'/>
</cell>
</row>
@@ -273,9 +267,8 @@
<JLabel id='mammalsObservationLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <EnumEditor id='mammalsObservation'
+ <EnumEditor id='mammalsObservation' genericType='ProgramObservationEnum'
constructorParams='ProgramObservationEnum.class, getConfig().getMammalsObservation()'
- genericType='ProgramObservationEnum'
onItemStateChanged='getBean().setMammalsObservation(mammalsObservation.getSelectedIndex())'/>
</cell>
</row>
@@ -286,9 +279,8 @@
<JLabel id='birdsObservationLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <EnumEditor id='birdsObservation'
+ <EnumEditor id='birdsObservation' genericType='ProgramObservationEnum'
constructorParams='ProgramObservationEnum.class, getConfig().getBirdsObservation()'
- genericType='ProgramObservationEnum'
onItemStateChanged='getBean().setBirdsObservation(birdsObservation.getSelectedIndex())'/>
</cell>
</row>
@@ -298,9 +290,8 @@
<JLabel id='baitObservationLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <EnumEditor id='baitObservation'
+ <EnumEditor id='baitObservation' genericType='ProgramObservationEnum'
constructorParams='ProgramObservationEnum.class, getConfig().getBaitObservation()'
- genericType='ProgramObservationEnum'
onItemStateChanged='getBean().setBaitObservation(baitObservation.getSelectedIndex())'/>
</cell>
</row>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/ProgramUI.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/ProgramUI.jcss
index 2facc2a..e6cc669 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/ProgramUI.jcss
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/ProgramUI.jcss
@@ -30,10 +30,6 @@
icon:{getHandler().getErrorIconIfFalse(model.isObservationsTabValid())};
}
-#editI18nTable2 {
- border:{new TitledBorder(t("observe.common.libelles"))};
-}
-
#organismLabel {
text:"observe.common.organism";
labelFor:{organism};
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/ProgramUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/ProgramUIHandler.java
index 70cc7d4..37d44e3 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/ProgramUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/ProgramUIHandler.java
@@ -22,10 +22,9 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
* #L%
*/
+import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIHandler;
import fr.ird.observe.services.dto.referential.ProgramDto;
import fr.ird.observe.services.dto.referential.ReferentialReference;
-import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI;
-import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIHandler;
import jaxx.runtime.validator.swing.SwingValidatorMessage;
import jaxx.runtime.validator.swing.SwingValidatorMessageTableModel;
import org.nuiton.validator.NuitonValidatorScope;
@@ -40,12 +39,12 @@ import java.util.Set;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.11
*/
-public class ProgramUIHandler extends ContentReferenceUIHandler<ProgramDto> {
+public class ProgramUIHandler extends ContentReferenceUIHandler<ProgramDto, ProgramUI> {
// Compute valid state of tab from the error table
protected final TableModelListener computeTabValidStateListener;
- public ProgramUIHandler(ContentReferenceUI<ProgramDto> ui) {
+ public ProgramUIHandler(ProgramUI ui) {
super(ui);
computeTabValidStateListener = e -> {
@@ -75,7 +74,7 @@ public class ProgramUIHandler extends ContentReferenceUIHandler<ProgramDto> {
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
computeTabValidState(errorTableModel);
- ((ProgramUI) getUi()).getTabPane().setSelectedIndex(0);
+ getUi().getTabPane().setSelectedIndex(0);
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/ProgramUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/ProgramUIModel.java
index d323339..a620993 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/ProgramUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/ProgramUIModel.java
@@ -23,8 +23,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
*/
import com.google.common.collect.ImmutableSet;
-import fr.ird.observe.services.dto.referential.ProgramDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.ProgramDto;
import java.util.Set;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/ReferenceEntity.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/ReferenceEntity.jcss
index 46dde16..797fcf8 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/ReferenceEntity.jcss
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/ReferenceEntity.jcss
@@ -19,6 +19,9 @@
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
+#editI18nTable2 {
+ border:{new TitledBorder(t("observe.common.libelles"))};
+}
#code {
text:{bean.getCode()};
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SexUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SexUI.jaxx
index 86bb1f1..9c11fc1 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SexUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SexUI.jaxx
@@ -20,25 +20,20 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='SexDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI superGenericType='SexDto, SexUI'>
<style source="ReferenceEntity.jcss"/>
- <style source="I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.SexDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
- <BeanValidator id='validator' autoField='true'
- beanClass='fr.ird.observe.services.dto.referential.SexDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ <BeanValidator id='validator' autoField='true' beanClass='fr.ird.observe.services.dto.referential.SexDto'
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<SexUIModel id='model'/>
@@ -65,12 +60,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,77 +71,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
+ <Table id='editI18nTable'/>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SexUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SexUIModel.java
index 5f11177..6d05e9e 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SexUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SexUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
* #L%
*/
-import fr.ird.observe.services.dto.referential.SexDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.SexDto;
/**
* Created on 9/27/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/ShipOwnerUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/ShipOwnerUI.jaxx
index 32df01c..329b92c 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/ShipOwnerUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/ShipOwnerUI.jaxx
@@ -18,29 +18,24 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='ShipOwnerDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='ShipOwnerDto, ShipOwnerUI'>
<style source="ReferenceEntity.jcss"/>
- <style source="I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.ReferentialReference
fr.ird.observe.services.dto.referential.ShipOwnerDto
fr.ird.observe.services.dto.referential.CountryDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
jaxx.runtime.swing.editor.bean.BeanComboBox
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
- <BeanValidator id='validator' autoField='true'
- beanClass='fr.ird.observe.services.dto.referential.ShipOwnerDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ <BeanValidator id='validator' autoField='true' beanClass='fr.ird.observe.services.dto.referential.ShipOwnerDto'
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<ShipOwnerUIModel id='model'/>
@@ -67,10 +62,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST' onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER' constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -98,8 +93,7 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SizeMeasureTypeUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SizeMeasureTypeUI.jaxx
index 78cbdf1..aa0738f 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SizeMeasureTypeUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SizeMeasureTypeUI.jaxx
@@ -19,19 +19,16 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='SizeMeasureTypeDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='SizeMeasureTypeDto, SizeMeasureTypeUI'>
<style source="ReferenceEntity.jcss"/>
- <style source="I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.SizeMeasureTypeDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
@@ -65,12 +62,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +73,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SizeMeasureTypeUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SizeMeasureTypeUIModel.java
index 1d44fb3..58e77b6 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SizeMeasureTypeUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SizeMeasureTypeUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
* #L%
*/
-import fr.ird.observe.services.dto.referential.SizeMeasureTypeDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.SizeMeasureTypeDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesGroupUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesGroupUI.jaxx
index 4d875fb..5fdaf13 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesGroupUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesGroupUI.jaxx
@@ -20,27 +20,23 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='SpeciesGroupDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='SpeciesGroupDto, SpeciesGroupUI'>
<style source="ReferenceEntity.jcss"/>
- <style source="I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.SpeciesGroupDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
jaxx.runtime.swing.editor.NumberEditor
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
- <BeanValidator id='validator' autoField='true'
- beanClass='fr.ird.observe.services.dto.referential.SpeciesGroupDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ <BeanValidator id='validator' autoField='true' beanClass='fr.ird.observe.services.dto.referential.SpeciesGroupDto'
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<SpeciesGroupUIModel id='model'/>
@@ -67,12 +63,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -80,77 +74,12 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesGroupUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesGroupUIModel.java
index db22fb9..54daa17 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesGroupUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesGroupUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
* #L%
*/
-import fr.ird.observe.services.dto.referential.SpeciesGroupDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.SpeciesGroupDto;
/**
* Created on 9/27/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesListUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesListUI.jaxx
index d3f353e..4f84b55 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesListUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesListUI.jaxx
@@ -19,19 +19,18 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='SpeciesListDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI
+ superGenericType='SpeciesListDto, SpeciesListUI'>
<style source="ReferenceEntity.jcss"/>
- <style source="I18nReferenceEntity.jcss"/>
+ <style source="../ContentI18nReferenceUI.jcss"/>
<import>
fr.ird.observe.services.dto.referential.ReferentialReference
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.SpeciesListDto
fr.ird.observe.services.dto.referential.SpeciesDto
fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
- jaxx.runtime.swing.editor.bean.BeanComboBox
org.nuiton.jaxx.widgets.select.FilterableDoubleList
javax.swing.DefaultListModel
@@ -40,14 +39,13 @@
java.util.Collection
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
+ static org.nuiton.i18n.I18n.t
</import>
<!-- validator -->
- <BeanValidator id='validator' autoField='true'
- beanClass='fr.ird.observe.services.dto.referential.SpeciesListDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ <BeanValidator id='validator' autoField='true' beanClass='fr.ird.observe.services.dto.referential.SpeciesListDto'
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<SpeciesListUIModel id='model'/>
@@ -82,12 +80,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' constraints='BorderLayout.WEST'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -175,8 +171,7 @@
<row>
<cell weightx="1" weighty="1">
<JScrollPane id='speciesPane' layout='{new GridLayout(1,1)}'>
- <FilterableDoubleList id='species'
- genericType='ReferentialReference<SpeciesDto>'
+ <FilterableDoubleList id='species' genericType='ReferentialReference<SpeciesDto>'
_entityClass='SpeciesDto.class'/>
</JScrollPane>
</cell>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesListUI.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesListUI.jcss
index 326c992..e0b9f0f 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesListUI.jcss
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesListUI.jcss
@@ -30,10 +30,6 @@
icon:{getHandler().getErrorIconIfFalse(model.isSpeciesTabValid())};
}
-#editI18nTable2 {
- border:{new TitledBorder(t("observe.common.libelles"))};
-}
-
#speciesPane {
verticalScrollBarPolicy:{JScrollPane.VERTICAL_SCROLLBAR_NEVER};
horizontalScrollBarPolicy:{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER};
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesListUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesListUIHandler.java
index a3d5d04..8abdfac 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesListUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesListUIHandler.java
@@ -22,10 +22,9 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
* #L%
*/
+import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIHandler;
import fr.ird.observe.services.dto.referential.ReferentialReference;
import fr.ird.observe.services.dto.referential.SpeciesListDto;
-import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI;
-import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIHandler;
import jaxx.runtime.validator.swing.SwingValidatorMessage;
import jaxx.runtime.validator.swing.SwingValidatorMessageTableModel;
import org.nuiton.validator.NuitonValidatorScope;
@@ -40,12 +39,12 @@ import java.util.Set;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.11
*/
-public class SpeciesListUIHandler extends ContentReferenceUIHandler<SpeciesListDto> {
+public class SpeciesListUIHandler extends ContentReferenceUIHandler<SpeciesListDto, SpeciesListUI> {
// Compute valid state of tab from the error table
protected final TableModelListener computeTabValidStateListener;
- public SpeciesListUIHandler(ContentReferenceUI<SpeciesListDto> ui) {
+ public SpeciesListUIHandler(SpeciesListUI ui) {
super(ui);
computeTabValidStateListener = e -> {
@@ -75,7 +74,7 @@ public class SpeciesListUIHandler extends ContentReferenceUIHandler<SpeciesListD
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
computeTabValidState(errorTableModel);
- ((SpeciesListUI) getUi()).getTabPane().setSelectedIndex(0);
+ getUi().getTabPane().setSelectedIndex(0);
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesListUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesListUIModel.java
index 6d40cf8..88449a2 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesListUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesListUIModel.java
@@ -23,8 +23,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
*/
import com.google.common.collect.ImmutableSet;
-import fr.ird.observe.services.dto.referential.SpeciesListDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.SpeciesListDto;
import java.util.Set;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesUI.jaxx
index 9278e6e..3578be0 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesUI.jaxx
@@ -20,14 +20,13 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='SpeciesDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='SpeciesDto, SpeciesUI'>
<style source="ReferenceEntity.jcss"/>
- <style source="I18nReferenceEntity.jcss"/>
+ <style source="../ContentI18nReferenceUI.jcss"/>
<import>
fr.ird.observe.services.dto.referential.ReferentialReference
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.SpeciesDto
fr.ird.observe.services.dto.referential.SpeciesGroupDto
fr.ird.observe.services.dto.referential.OceanDto
@@ -40,12 +39,11 @@
java.util.Collection
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
- <BeanValidator id='validator' autoField='true'
- beanClass='fr.ird.observe.services.dto.referential.SpeciesDto'
+ <BeanValidator id='validator' autoField='true' beanClass='fr.ird.observe.services.dto.referential.SpeciesDto'
context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
@@ -81,11 +79,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER' constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' constraints='BorderLayout.WEST'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesUI.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesUI.jcss
index a34bafc..fd0d503 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesUI.jcss
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesUI.jcss
@@ -30,10 +30,6 @@
icon:{getHandler().getErrorIconIfFalse(model.isOtherTabValid())};
}
-#editI18nTable2 {
- border:{new TitledBorder(t("observe.common.libelles"))};
-}
-
#homeIdFAOWormsIdLabel {
font-style:"italic";
text:"observe.common.homeIdFAOWormsId";
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesUIHandler.java
index 1c90b1c..7d61a13 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesUIHandler.java
@@ -22,10 +22,9 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
* #L%
*/
+import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIHandler;
import fr.ird.observe.services.dto.referential.ReferentialReference;
import fr.ird.observe.services.dto.referential.SpeciesDto;
-import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI;
-import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIHandler;
import jaxx.runtime.validator.swing.SwingValidatorMessage;
import jaxx.runtime.validator.swing.SwingValidatorMessageTableModel;
import org.nuiton.validator.NuitonValidatorScope;
@@ -40,12 +39,12 @@ import java.util.Set;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.11
*/
-public class SpeciesUIHandler extends ContentReferenceUIHandler<SpeciesDto> {
+public class SpeciesUIHandler extends ContentReferenceUIHandler<SpeciesDto, SpeciesUI> {
// Compute valid state of tab from the error table
protected final TableModelListener computeTabValidStateListener;
- public SpeciesUIHandler(ContentReferenceUI<SpeciesDto> ui) {
+ public SpeciesUIHandler(SpeciesUI ui) {
super(ui);
computeTabValidStateListener = e -> {
@@ -75,7 +74,7 @@ public class SpeciesUIHandler extends ContentReferenceUIHandler<SpeciesDto> {
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
computeTabValidState(errorTableModel);
- ((SpeciesUI) getUi()).getTabPane().setSelectedIndex(0);
+ getUi().getTabPane().setSelectedIndex(0);
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesUIModel.java
index e272fa1..4e6f1a0 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/SpeciesUIModel.java
@@ -23,8 +23,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
*/
import com.google.common.collect.ImmutableSet;
-import fr.ird.observe.services.dto.referential.SpeciesDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.SpeciesDto;
import java.util.Set;
@@ -77,16 +77,16 @@ public class SpeciesUIModel extends ContentReferenceUIModel<SpeciesDto> {
public SpeciesUIModel() {
super(SpeciesDto.class,
new String[]{SpeciesDto.PROPERTY_SPECIES_GROUP,
- SpeciesDto.PROPERTY_OCEAN,
- SpeciesDto.PROPERTY_SIZE_MEASURE_TYPE,
- SpeciesDto.PROPERTY_MIN_LENGTH,
- SpeciesDto.PROPERTY_MAX_LENGTH,
- SpeciesDto.PROPERTY_MIN_WEIGHT,
- SpeciesDto.PROPERTY_MAX_WEIGHT,
- SpeciesDto.PROPERTY_HOME_ID,
- SpeciesDto.PROPERTY_FAO_CODE,
- SpeciesDto.PROPERTY_WORMS_ID,
- SpeciesDto.PROPERTY_SCIENTIFIC_LABEL},
+ SpeciesDto.PROPERTY_OCEAN,
+ SpeciesDto.PROPERTY_SIZE_MEASURE_TYPE,
+ SpeciesDto.PROPERTY_MIN_LENGTH,
+ SpeciesDto.PROPERTY_MAX_LENGTH,
+ SpeciesDto.PROPERTY_MIN_WEIGHT,
+ SpeciesDto.PROPERTY_MAX_WEIGHT,
+ SpeciesDto.PROPERTY_HOME_ID,
+ SpeciesDto.PROPERTY_FAO_CODE,
+ SpeciesDto.PROPERTY_WORMS_ID,
+ SpeciesDto.PROPERTY_SCIENTIFIC_LABEL},
new String[]{
SpeciesDto.PROPERTY_SPECIES_GROUP + SUFFIX_SELECTED_ITEM,
SpeciesDto.PROPERTY_SIZE_MEASURE_TYPE + SUFFIX_SELECTED_ITEM,
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselSizeCategoryUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselSizeCategoryUI.jaxx
index f15862b..6aef844 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselSizeCategoryUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselSizeCategoryUI.jaxx
@@ -20,25 +20,22 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='VesselSizeCategoryDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI
+ superGenericType='VesselSizeCategoryDto, VesselSizeCategoryUI'>
<style source="ReferenceEntity.jcss"/>
- <style source="I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.VesselSizeCategoryDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.VesselSizeCategoryDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<VesselSizeCategoryUIModel id='model'/>
@@ -65,12 +62,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,8 +73,7 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
@@ -92,8 +86,7 @@
<JLabel id='gaugeLabelLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <JTextField id='gaugeLabel'
- onKeyReleased='getBean().setGaugeLabel(gaugeLabel.getText())'/>
+ <JTextField id='gaugeLabel' onKeyReleased='getBean().setGaugeLabel(gaugeLabel.getText())'/>
</cell>
</row>
@@ -103,8 +96,7 @@
<JLabel id='capacityLabelLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <JTextField id='capacityLabel'
- onKeyReleased='getBean().setCapacityLabel(capacityLabel.getText())'/>
+ <JTextField id='capacityLabel' onKeyReleased='getBean().setCapacityLabel(capacityLabel.getText())'/>
</cell>
</row>
</Table>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselSizeCategoryUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselSizeCategoryUIModel.java
index 1b6570e..c43260b 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselSizeCategoryUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselSizeCategoryUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
* #L%
*/
-import fr.ird.observe.services.dto.referential.VesselSizeCategoryDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.VesselSizeCategoryDto;
/**
* Created on 9/27/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselTypeUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselTypeUI.jaxx
index f045afd..389649f 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselTypeUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselTypeUI.jaxx
@@ -20,25 +20,20 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='VesselTypeDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI superGenericType='VesselTypeDto, VesselTypeUI'>
<style source="ReferenceEntity.jcss"/>
- <style source="I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.VesselTypeDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
- <BeanValidator id='validator' autoField='true'
- beanClass='fr.ird.observe.services.dto.referential.VesselTypeDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ <BeanValidator id='validator' autoField='true' beanClass='fr.ird.observe.services.dto.referential.VesselTypeDto'
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<VesselTypeUIModel id='model'/>
@@ -65,12 +60,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,8 +71,7 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
@@ -151,4 +143,4 @@
</cell>
</row>
</Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselTypeUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselTypeUIModel.java
index d8a6ee1..cf38b3a 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselTypeUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselTypeUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
* #L%
*/
-import fr.ird.observe.services.dto.referential.VesselTypeDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.VesselTypeDto;
/**
* Created on 9/27/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselUI.jaxx
index 34f72f3..2e578a1 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselUI.jaxx
@@ -20,20 +20,18 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='VesselDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='VesselDto, VesselUI'>
<style source="ReferenceEntity.jcss"/>
- <style source="I18nReferenceEntity.jcss"/>
+ <style source="../ContentI18nReferenceUI.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.ReferentialReference
fr.ird.observe.services.dto.referential.VesselDto
fr.ird.observe.services.dto.referential.VesselSizeCategoryDto
fr.ird.observe.services.dto.referential.CountryDto
fr.ird.observe.services.dto.referential.VesselTypeDto
fr.ird.observe.services.dto.referential.ShipOwnerDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
jaxx.runtime.swing.editor.NumberEditor
jaxx.runtime.swing.editor.bean.BeanComboBox
@@ -41,12 +39,12 @@
org.jdesktop.swingx.JXDatePicker
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
- <BeanValidator id='validator' autoField='true' context='ui-create'
- beanClass='fr.ird.observe.services.dto.referential.VesselDto' errorTableModel='{getErrorTableModel()}'/>
+ <BeanValidator id='validator' autoField='true' context='ui-create' errorTableModel='{getErrorTableModel()}'
+ beanClass='fr.ird.observe.services.dto.referential.VesselDto'/>
<!-- model -->
<VesselUIModel id='model'/>
@@ -94,10 +92,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' constraints='BorderLayout.WEST'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -108,7 +106,9 @@
<JLabel id='vesselTypeLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <BeanComboBox id='vesselType' constructorParams='this' genericType='ReferentialReference<VesselTypeDto>' _entityClass='VesselTypeDto.class'/>
+ <BeanComboBox id='vesselType' constructorParams='this'
+ genericType='ReferentialReference<VesselTypeDto>'
+ _entityClass='VesselTypeDto.class'/>
</cell>
</row>
@@ -118,7 +118,9 @@
<JLabel id='vesselSizeCategoryLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <BeanComboBox id='vesselSizeCategory' constructorParams='this' genericType='ReferentialReference<VesselSizeCategoryDto>' _entityClass='VesselSizeCategoryDto.class'/>
+ <BeanComboBox id='vesselSizeCategory' constructorParams='this'
+ genericType='ReferentialReference<VesselSizeCategoryDto>'
+ _entityClass='VesselSizeCategoryDto.class'/>
</cell>
</row>
@@ -128,7 +130,8 @@
<JLabel id='flagCountryLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <BeanComboBox id='flagCountry' constructorParams='this' genericType='ReferentialReference<CountryDto>' _entityClass='CountryDto.class'/>
+ <BeanComboBox id='flagCountry' constructorParams='this'
+ genericType='ReferentialReference<CountryDto>' _entityClass='CountryDto.class'/>
</cell>
</row>
@@ -331,7 +334,8 @@
<JLabel id='radioCallSignIdLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <JTextField id='radioCallSignId' onKeyReleased='getBean().setRadioCallSignId(radioCallSignId.getText())'/>
+ <JTextField id='radioCallSignId'
+ onKeyReleased='getBean().setRadioCallSignId(radioCallSignId.getText())'/>
</cell>
</row>
@@ -351,7 +355,9 @@
<JLabel id='shipOwnerLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <BeanComboBox id='shipOwner' constructorParams='this' genericType='ReferentialReference<ShipOwnerDto>' _entityClass='ShipOwnerDto.class'/>
+ <BeanComboBox id='shipOwner' constructorParams='this'
+ genericType='ReferentialReference<ShipOwnerDto>'
+ _entityClass='ShipOwnerDto.class'/>
</cell>
</row>
</Table>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselUI.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselUI.jcss
index 25f573e..6a91ab7 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselUI.jcss
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselUI.jcss
@@ -30,10 +30,6 @@
icon:{getHandler().getErrorIconIfFalse(model.isOtherTabValid())};
}
-#editI18nTable2 {
- border:{new TitledBorder(t("observe.common.libelles"))};
-}
-
#codeStatusLabel {
font-style:"italic";
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselUIHandler.java
index e09a56a..4b9aaa6 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/VesselUIHandler.java
@@ -22,10 +22,9 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
* #L%
*/
+import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIHandler;
import fr.ird.observe.services.dto.referential.ReferentialReference;
import fr.ird.observe.services.dto.referential.VesselDto;
-import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI;
-import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIHandler;
import jaxx.runtime.validator.swing.SwingValidatorMessage;
import jaxx.runtime.validator.swing.SwingValidatorMessageTableModel;
import org.nuiton.validator.NuitonValidatorScope;
@@ -40,12 +39,12 @@ import java.util.Set;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.11
*/
-public class VesselUIHandler extends ContentReferenceUIHandler<VesselDto> {
+public class VesselUIHandler extends ContentReferenceUIHandler<VesselDto, VesselUI> {
// Compute valid state of tab from the error table
protected final TableModelListener computeTabValidStateListener;
- public VesselUIHandler(ContentReferenceUI<VesselDto> ui) {
+ public VesselUIHandler(VesselUI ui) {
super(ui);
computeTabValidStateListener = e -> {
@@ -75,7 +74,7 @@ public class VesselUIHandler extends ContentReferenceUIHandler<VesselDto> {
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
computeTabValidState(errorTableModel);
- ((VesselUI) getUi()).getTabPane().setSelectedIndex(0);
+ getUi().getTabPane().setSelectedIndex(0);
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/WeightMeasureTypeUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/WeightMeasureTypeUI.jaxx
index 856a689..070cc93 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/WeightMeasureTypeUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/WeightMeasureTypeUI.jaxx
@@ -19,26 +19,22 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='WeightMeasureTypeDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='WeightMeasureTypeDto, WeightMeasureTypeUI'>
<style source="ReferenceEntity.jcss"/>
- <style source="I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.WeightMeasureTypeDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.WeightMeasureTypeDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<WeightMeasureTypeUIModel id='model'/>
@@ -65,12 +61,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' constraints='BorderLayout.WEST'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +72,9 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/WeightMeasureTypeUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/WeightMeasureTypeUIModel.java
index c086bee..fb10fd3 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/WeightMeasureTypeUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/WeightMeasureTypeUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl;
* #L%
*/
-import fr.ird.observe.services.dto.referential.WeightMeasureTypeDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.WeightMeasureTypeDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/BaitHaulingStatusUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/BaitHaulingStatusUI.jaxx
index bb5d9d8..0b9b779 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/BaitHaulingStatusUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/BaitHaulingStatusUI.jaxx
@@ -17,26 +17,22 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='BaitHaulingStatusDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='BaitHaulingStatusDto, BaitHaulingStatusUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.longline.BaitHaulingStatusDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.longline.BaitHaulingStatusDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<BaitHaulingStatusUIModel id='model'/>
@@ -63,12 +59,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -76,76 +70,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/BaitHaulingStatusUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/BaitHaulingStatusUIModel.java
index f55b8d4..6278c1c 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/BaitHaulingStatusUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/BaitHaulingStatusUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.longline;
* #L%
*/
-import fr.ird.observe.services.dto.referential.longline.BaitHaulingStatusDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.longline.BaitHaulingStatusDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/BaitSettingStatusUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/BaitSettingStatusUI.jaxx
index 9dbca8f..48df2fa 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/BaitSettingStatusUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/BaitSettingStatusUI.jaxx
@@ -19,26 +19,22 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='BaitSettingStatusDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='BaitSettingStatusDto, BaitSettingStatusUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.longline.BaitSettingStatusDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.longline.BaitSettingStatusDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<BaitSettingStatusUIModel id='model'/>
@@ -54,7 +50,7 @@
<JLabel id='uriLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <JTextField id='uri' onKeyReleased='getBean().setUri(uri.getText())'/>
+ <JTextField id='uri'/>
</cell>
</row>
@@ -65,12 +61,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +72,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/BaitSettingStatusUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/BaitSettingStatusUIModel.java
index 8bdfadf..003f410 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/BaitSettingStatusUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/BaitSettingStatusUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.longline;
* #L%
*/
-import fr.ird.observe.services.dto.referential.longline.BaitSettingStatusDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.longline.BaitSettingStatusDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/BaitTypeUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/BaitTypeUI.jaxx
index 78e0e64..1e5d5fd 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/BaitTypeUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/BaitTypeUI.jaxx
@@ -19,26 +19,21 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='BaitTypeDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI superGenericType='BaitTypeDto, BaitTypeUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.longline.BaitTypeDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.longline.BaitTypeDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<BaitTypeUIModel id='model'/>
@@ -65,12 +60,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +71,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/BaitTypeUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/BaitTypeUIModel.java
index 1c908ab..ff3e2c6 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/BaitTypeUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/BaitTypeUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.longline;
* #L%
*/
-import fr.ird.observe.services.dto.referential.longline.BaitTypeDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.longline.BaitTypeDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/CatchFateLonglineUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/CatchFateLonglineUI.jaxx
index 6b6743f..199438b 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/CatchFateLonglineUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/CatchFateLonglineUI.jaxx
@@ -19,26 +19,22 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='CatchFateLonglineDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='CatchFateLonglineDto, CatchFateLonglineUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.longline.CatchFateLonglineDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.longline.CatchFateLonglineDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<CatchFateLonglineUIModel id='model'/>
@@ -65,12 +61,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +72,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/CatchFateLonglineUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/CatchFateLonglineUIModel.java
index 4409231..ee2b09a 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/CatchFateLonglineUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/CatchFateLonglineUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.longline;
* #L%
*/
-import fr.ird.observe.services.dto.referential.longline.CatchFateLonglineDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.longline.CatchFateLonglineDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/EncounterTypeUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/EncounterTypeUI.jaxx
index 00bd34f..46ca0b6 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/EncounterTypeUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/EncounterTypeUI.jaxx
@@ -19,26 +19,22 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='EncounterTypeDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='EncounterTypeDto, EncounterTypeUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.longline.EncounterTypeDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.longline.EncounterTypeDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<EncounterTypeUIModel id='model'/>
@@ -65,12 +61,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +72,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/EncounterTypeUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/EncounterTypeUIModel.java
index e7156fe..e95c0c0 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/EncounterTypeUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/EncounterTypeUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.longline;
* #L%
*/
-import fr.ird.observe.services.dto.referential.longline.EncounterTypeDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.longline.EncounterTypeDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HealthnessUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HealthnessUI.jaxx
index 43ecd3f..332eba0 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HealthnessUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HealthnessUI.jaxx
@@ -19,26 +19,21 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='HealthnessDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI superGenericType='HealthnessDto, HealthnessUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.longline.HealthnessDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.longline.HealthnessDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<HealthnessUIModel id='model'/>
@@ -65,12 +60,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +71,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HealthnessUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HealthnessUIModel.java
index 1a0b826..b3778ef 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HealthnessUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HealthnessUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.longline;
* #L%
*/
-import fr.ird.observe.services.dto.referential.longline.HealthnessDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.longline.HealthnessDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HookPositionUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HookPositionUI.jaxx
index 5eac718..15aed6d 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HookPositionUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HookPositionUI.jaxx
@@ -19,26 +19,22 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='HookPositionDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='HookPositionDto, HookPositionUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.longline.HookPositionDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.longline.HookPositionDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<HookPositionUIModel id='model'/>
@@ -65,12 +61,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +72,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HookPositionUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HookPositionUIModel.java
index ed68a57..e35b3e1 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HookPositionUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HookPositionUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.longline;
* #L%
*/
-import fr.ird.observe.services.dto.referential.longline.HookPositionDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.longline.HookPositionDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HookSizeUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HookSizeUI.jaxx
index 473f19a..dccabc5 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HookSizeUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HookSizeUI.jaxx
@@ -19,26 +19,21 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='HookSizeDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI superGenericType='HookSizeDto, HookSizeUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.longline.HookSizeDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.longline.HookSizeDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<HookSizeUIModel id='model'/>
@@ -65,12 +60,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +71,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HookSizeUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HookSizeUIModel.java
index 4347f23..9307c2b 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HookSizeUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HookSizeUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.longline;
* #L%
*/
-import fr.ird.observe.services.dto.referential.longline.HookSizeDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.longline.HookSizeDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HookTypeUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HookTypeUI.jaxx
index 65eee0a..4e91df0 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HookTypeUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HookTypeUI.jaxx
@@ -19,26 +19,21 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='HookTypeDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI superGenericType='HookTypeDto, HookTypeUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.longline.HookTypeDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.longline.HookTypeDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<HookTypeUIModel id='model'/>
@@ -54,7 +49,7 @@
<JLabel id='uriLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <JTextField id='uri' onKeyReleased='getBean().setUri(uri.getText())'/>
+ <JTextField id='uri'/>
</cell>
</row>
@@ -65,12 +60,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +71,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HookTypeUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HookTypeUIModel.java
index e6a4dc2..a06e8a0 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HookTypeUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/HookTypeUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.longline;
* #L%
*/
-import fr.ird.observe.services.dto.referential.longline.HookTypeDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.longline.HookTypeDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/ItemHorizontalPositionUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/ItemHorizontalPositionUI.jaxx
index 1c7adf8..4929a1a 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/ItemHorizontalPositionUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/ItemHorizontalPositionUI.jaxx
@@ -19,26 +19,22 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='ItemHorizontalPositionDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='ItemHorizontalPositionDto, ItemHorizontalPositionUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.longline.ItemHorizontalPositionDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.longline.ItemHorizontalPositionDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<ItemHorizontalPositionUIModel id='model'/>
@@ -65,12 +61,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +72,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/ItemHorizontalPositionUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/ItemHorizontalPositionUIModel.java
index 72ae8c0..693411e 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/ItemHorizontalPositionUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/ItemHorizontalPositionUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.longline;
* #L%
*/
-import fr.ird.observe.services.dto.referential.longline.ItemHorizontalPositionDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.longline.ItemHorizontalPositionDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/ItemVerticalPositionUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/ItemVerticalPositionUI.jaxx
index a8fddc1..3abd920 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/ItemVerticalPositionUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/ItemVerticalPositionUI.jaxx
@@ -19,26 +19,22 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='ItemVerticalPositionDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='ItemVerticalPositionDto, ItemVerticalPositionUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.longline.ItemVerticalPositionDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.longline.ItemVerticalPositionDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<ItemVerticalPositionUIModel id='model'/>
@@ -65,12 +61,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +72,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/ItemVerticalPositionUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/ItemVerticalPositionUIModel.java
index 4f884fb..a0bda66 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/ItemVerticalPositionUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/ItemVerticalPositionUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.longline;
* #L%
*/
-import fr.ird.observe.services.dto.referential.longline.ItemVerticalPositionDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.longline.ItemVerticalPositionDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/LightsticksColorUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/LightsticksColorUI.jaxx
index 1d88979..933ec4c 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/LightsticksColorUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/LightsticksColorUI.jaxx
@@ -19,26 +19,22 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='LightsticksColorDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='LightsticksColorDto, LightsticksColorUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.longline.LightsticksColorDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.longline.LightsticksColorDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<LightsticksColorUIModel id='model'/>
@@ -65,12 +61,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +72,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/LightsticksColorUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/LightsticksColorUIModel.java
index 1f06a5e..15cdb34 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/LightsticksColorUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/LightsticksColorUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.longline;
* #L%
*/
-import fr.ird.observe.services.dto.referential.longline.LightsticksColorDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.longline.LightsticksColorDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/LightsticksTypeUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/LightsticksTypeUI.jaxx
index 99291e0..d01bda7 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/LightsticksTypeUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/LightsticksTypeUI.jaxx
@@ -19,26 +19,22 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='LightsticksTypeDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='LightsticksTypeDto, LightsticksTypeUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.longline.LightsticksTypeDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.longline.LightsticksTypeDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<LightsticksTypeUIModel id='model'/>
@@ -65,12 +61,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +72,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/LightsticksTypeUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/LightsticksTypeUIModel.java
index bb9081c..865d234 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/LightsticksTypeUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/LightsticksTypeUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.longline;
* #L%
*/
-import fr.ird.observe.services.dto.referential.longline.LightsticksTypeDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.longline.LightsticksTypeDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/LineTypeUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/LineTypeUI.jaxx
index 262c476..d35c383 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/LineTypeUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/LineTypeUI.jaxx
@@ -19,26 +19,21 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='LineTypeDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI superGenericType='LineTypeDto, LineTypeUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.longline.LineTypeDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.longline.LineTypeDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<LineTypeUIModel id='model'/>
@@ -65,12 +60,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +71,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/LineTypeUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/LineTypeUIModel.java
index 48d52a3..066861f 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/LineTypeUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/LineTypeUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.longline;
* #L%
*/
-import fr.ird.observe.services.dto.referential.longline.LineTypeDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.longline.LineTypeDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/MaturityStatusUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/MaturityStatusUI.jaxx
index f2c2b77..5801c90 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/MaturityStatusUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/MaturityStatusUI.jaxx
@@ -19,26 +19,22 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='MaturityStatusDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='MaturityStatusDto, MaturityStatusUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.longline.MaturityStatusDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.longline.MaturityStatusDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<MaturityStatusUIModel id='model'/>
@@ -65,12 +61,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -84,8 +78,7 @@
<JPanel id='lowerValueUpperValuePanel' layout='{new GridLayout()}'>
<JTextField id='lowerValue' constraints='BorderLayout.WEST'
onKeyReleased='getBean().setLowerValue(lowerValue.getText())'/>
- <JTextField id='upperValue'
- onKeyReleased='getBean().setUpperValue(upperValue.getText())'/>
+ <JTextField id='upperValue' onKeyReleased='getBean().setUpperValue(upperValue.getText())'/>
</JPanel>
</cell>
@@ -94,76 +87,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/MaturityStatusUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/MaturityStatusUIModel.java
index 07b6001..2079f84 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/MaturityStatusUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/MaturityStatusUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.longline;
* #L%
*/
-import fr.ird.observe.services.dto.referential.longline.MaturityStatusDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.longline.MaturityStatusDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/MitigationTypeUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/MitigationTypeUI.jaxx
index 6003981..7cdb3ac 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/MitigationTypeUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/MitigationTypeUI.jaxx
@@ -19,26 +19,22 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='MitigationTypeDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='MitigationTypeDto, MitigationTypeUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.longline.MitigationTypeDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.longline.MitigationTypeDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<MitigationTypeUIModel id='model'/>
@@ -65,12 +61,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +72,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/MitigationTypeUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/MitigationTypeUIModel.java
index 5b4de40..e56e4e1 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/MitigationTypeUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/MitigationTypeUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.longline;
* #L%
*/
-import fr.ird.observe.services.dto.referential.longline.MitigationTypeDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.longline.MitigationTypeDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SensorBrandUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SensorBrandUI.jaxx
index 7905fb7..3f59ad0 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SensorBrandUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SensorBrandUI.jaxx
@@ -19,26 +19,21 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='SensorBrandDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='SensorBrandDto, SensorBrandUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.longline.SensorBrandDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.longline.SensorBrandDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<SensorBrandUIModel id='model'/>
@@ -65,12 +60,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -89,8 +82,7 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SensorBrandUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SensorBrandUIModel.java
index 9d8eb62..c678936 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SensorBrandUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SensorBrandUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.longline;
* #L%
*/
-import fr.ird.observe.services.dto.referential.longline.SensorBrandDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.longline.SensorBrandDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SensorDataFormatUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SensorDataFormatUI.jaxx
index b224407..474c1a0 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SensorDataFormatUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SensorDataFormatUI.jaxx
@@ -19,26 +19,22 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='SensorDataFormatDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='SensorDataFormatDto, SensorDataFormatUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.longline.SensorDataFormatDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.longline.SensorDataFormatDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<SensorDataFormatUIModel id='model'/>
@@ -65,12 +61,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +72,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SensorDataFormatUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SensorDataFormatUIModel.java
index 5808676..46507c1 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SensorDataFormatUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SensorDataFormatUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.longline;
* #L%
*/
-import fr.ird.observe.services.dto.referential.longline.SensorDataFormatDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.longline.SensorDataFormatDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SensorTypeUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SensorTypeUI.jaxx
index d78ad39..9ae58a3 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SensorTypeUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SensorTypeUI.jaxx
@@ -19,26 +19,21 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='SensorTypeDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI superGenericType='SensorTypeDto, SensorTypeUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.longline.SensorTypeDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.longline.SensorTypeDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<SensorTypeUIModel id='model'/>
@@ -65,12 +60,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +71,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SensorTypeUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SensorTypeUIModel.java
index fe323ee..becce40 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SensorTypeUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SensorTypeUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.longline;
* #L%
*/
-import fr.ird.observe.services.dto.referential.longline.SensorTypeDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.longline.SensorTypeDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SettingShapeUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SettingShapeUI.jaxx
index 1daf410..a626e70 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SettingShapeUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SettingShapeUI.jaxx
@@ -19,26 +19,22 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='SettingShapeDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='SettingShapeDto, SettingShapeUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.longline.SettingShapeDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.longline.SettingShapeDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<SettingShapeUIModel id='model'/>
@@ -65,12 +61,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +72,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SettingShapeUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SettingShapeUIModel.java
index 82d853c..007dcd3 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SettingShapeUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/SettingShapeUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.longline;
* #L%
*/
-import fr.ird.observe.services.dto.referential.longline.SettingShapeDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.longline.SettingShapeDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/StomacFullnessUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/StomacFullnessUI.jaxx
index be305a1..4f30fd2 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/StomacFullnessUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/StomacFullnessUI.jaxx
@@ -19,26 +19,22 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='StomacFullnessDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='StomacFullnessDto, StomacFullnessUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.longline.StomacFullnessDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.longline.StomacFullnessDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<StomacFullnessUIModel id='model'/>
@@ -65,12 +61,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +72,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/StomacFullnessUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/StomacFullnessUIModel.java
index ceacb38..f1dc559 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/StomacFullnessUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/StomacFullnessUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.longline;
* #L%
*/
-import fr.ird.observe.services.dto.referential.longline.StomacFullnessDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.longline.StomacFullnessDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/TripTypeUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/TripTypeUI.jaxx
index d875087..f67287e 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/TripTypeUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/TripTypeUI.jaxx
@@ -19,26 +19,21 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='TripTypeDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI superGenericType='TripTypeDto, TripTypeUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.longline.TripTypeDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.longline.TripTypeDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<TripTypeUIModel id='model'/>
@@ -65,12 +60,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +71,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/TripTypeUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/TripTypeUIModel.java
index d4bf281..caca218 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/TripTypeUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/TripTypeUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.longline;
* #L%
*/
-import fr.ird.observe.services.dto.referential.longline.TripTypeDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.longline.TripTypeDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/VesselActivityLonglineUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/VesselActivityLonglineUI.jaxx
index 3a121bf..a9c170d 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/VesselActivityLonglineUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/VesselActivityLonglineUI.jaxx
@@ -19,26 +19,22 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='VesselActivityLonglineDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='VesselActivityLonglineDto, VesselActivityLonglineUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.longline.VesselActivityLonglineDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.longline.VesselActivityLonglineDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<VesselActivityLonglineUIModel id='model'/>
@@ -65,12 +61,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +72,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/VesselActivityLonglineUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/VesselActivityLonglineUIModel.java
index f6205d3..d723cfb 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/VesselActivityLonglineUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/longline/VesselActivityLonglineUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.longline;
* #L%
*/
-import fr.ird.observe.services.dto.referential.longline.VesselActivityLonglineDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.longline.VesselActivityLonglineDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/DetectionModeUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/DetectionModeUI.jaxx
index 048f97c..8850249 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/DetectionModeUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/DetectionModeUI.jaxx
@@ -20,26 +20,22 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='DetectionModeDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='DetectionModeDto, DetectionModeUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.seine.DetectionModeDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.seine.DetectionModeDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<DetectionModeUIModel id='model'/>
@@ -66,12 +62,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -79,76 +73,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/DetectionModeUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/DetectionModeUIModel.java
index fbfe989..114305f 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/DetectionModeUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/DetectionModeUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.seine;
* #L%
*/
-import fr.ird.observe.services.dto.referential.seine.DetectionModeDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.seine.DetectionModeDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObjectFateUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObjectFateUI.jaxx
index cf3b142..80206ad 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObjectFateUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObjectFateUI.jaxx
@@ -20,25 +20,21 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='ObjectFateDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI superGenericType='ObjectFateDto, ObjectFateUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.seine.ObjectFateDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.seine.ObjectFateDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<ObjectFateUIModel id='model'/>
@@ -65,12 +61,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +72,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObjectFateUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObjectFateUIModel.java
index bcb9953..e09610b 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObjectFateUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObjectFateUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.seine;
* #L%
*/
-import fr.ird.observe.services.dto.referential.seine.ObjectFateDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.seine.ObjectFateDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObjectOperationUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObjectOperationUI.jaxx
index 1567268..e5c5689 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObjectOperationUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObjectOperationUI.jaxx
@@ -20,25 +20,22 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='ObjectOperationDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='ObjectOperationDto, ObjectOperationUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.seine.ObjectOperationDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.seine.ObjectOperationDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<ObjectOperationUIModel id='model'/>
@@ -55,7 +52,7 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JTextField id='uri'
- onKeyReleased='getBean().setUri(uri.getText())'/>
+ />
</cell>
</row>
@@ -66,12 +63,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -79,76 +74,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObjectOperationUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObjectOperationUIModel.java
index a3bf544..b1d2a39 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObjectOperationUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObjectOperationUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.seine;
* #L%
*/
-import fr.ird.observe.services.dto.referential.seine.ObjectOperationDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.seine.ObjectOperationDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObjectTypeUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObjectTypeUI.jaxx
index ee88b98..269f1d7 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObjectTypeUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObjectTypeUI.jaxx
@@ -20,25 +20,21 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='ObjectTypeDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI superGenericType='ObjectTypeDto, ObjectTypeUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.seine.ObjectTypeDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.seine.ObjectTypeDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<ObjectTypeUIModel id='model'/>
@@ -65,12 +61,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,77 +72,12 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObjectTypeUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObjectTypeUIModel.java
index 5bd023f..899115d 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObjectTypeUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObjectTypeUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.seine;
* #L%
*/
-import fr.ird.observe.services.dto.referential.seine.ObjectTypeDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.seine.ObjectTypeDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObservedSystemUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObservedSystemUI.jaxx
index b688c79..2538fb2 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObservedSystemUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObservedSystemUI.jaxx
@@ -20,26 +20,23 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='ObservedSystemDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='ObservedSystemDto, ObservedSystemUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.constants.seine.SchoolType
fr.ird.observe.services.dto.referential.seine.ObservedSystemDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.seine.ObservedSystemDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<fr.ird.observe.application.swing.ui.content.ref.impl.seine.ObservedSystemUIModel id='model'/>
@@ -66,12 +63,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -82,8 +77,7 @@
<JLabel id='schoolTypeLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <EnumEditor id='schoolType' constructorParams='SchoolType.class'
- genericType='SchoolType'
+ <EnumEditor id='schoolType' constructorParams='SchoolType.class' genericType='SchoolType'
onItemStateChanged='getBean().setSchoolType((SchoolType)schoolType.getSelectedItem())'/>
</cell>
</row>
@@ -91,76 +85,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObservedSystemUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObservedSystemUIModel.java
index adeb613..f6642d5 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObservedSystemUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ObservedSystemUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.seine;
* #L%
*/
-import fr.ird.observe.services.dto.referential.seine.ObservedSystemDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.seine.ObservedSystemDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ReasonForDiscardUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ReasonForDiscardUI.jaxx
index 1011c99..c9be5d6 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ReasonForDiscardUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ReasonForDiscardUI.jaxx
@@ -20,25 +20,22 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='ReasonForDiscardDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='ReasonForDiscardDto, ReasonForDiscardUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.seine.ReasonForDiscardDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.seine.ReasonForDiscardDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<ReasonForDiscardUIModel id='model'/>
@@ -55,7 +52,7 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JTextField id='uri'
- onKeyReleased='getBean().setUri(uri.getText())'/>
+ />
</cell>
</row>
@@ -66,12 +63,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -79,76 +74,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ReasonForDiscardUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ReasonForDiscardUIModel.java
index 61eac01..619e2b5 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ReasonForDiscardUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ReasonForDiscardUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.seine;
* #L%
*/
-import fr.ird.observe.services.dto.referential.seine.ReasonForDiscardDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.seine.ReasonForDiscardDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ReasonForNoFishingUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ReasonForNoFishingUI.jaxx
index e5daf7b..1712d93 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ReasonForNoFishingUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ReasonForNoFishingUI.jaxx
@@ -20,26 +20,22 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='ReasonForNoFishingDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='ReasonForNoFishingDto, ReasonForNoFishingUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.seine.ReasonForNoFishingDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
- <BeanValidator id='validator'
- autoField='true'
+ <BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.seine.ReasonForNoFishingDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<ReasonForNoFishingUIModel id='model'/>
@@ -55,7 +51,7 @@
<JLabel id='uriLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <JTextField id='uri' onKeyReleased='getBean().setUri(uri.getText())'/>
+ <JTextField id='uri'/>
</cell>
</row>
@@ -66,12 +62,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -79,76 +73,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ReasonForNoFishingUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ReasonForNoFishingUIModel.java
index c400ccc..66413ad 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ReasonForNoFishingUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ReasonForNoFishingUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.seine;
* #L%
*/
-import fr.ird.observe.services.dto.referential.seine.ReasonForNoFishingDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.seine.ReasonForNoFishingDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ReasonForNullSetUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ReasonForNullSetUI.jaxx
index 0fd5072..9aad190 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ReasonForNullSetUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ReasonForNullSetUI.jaxx
@@ -20,25 +20,22 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='ReasonForNullSetDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='ReasonForNullSetDto, ReasonForNullSetUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.seine.ReasonForNullSetDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.seine.ReasonForNullSetDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<ReasonForNullSetUIModel id='model'/>
@@ -65,12 +62,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +73,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ReasonForNullSetUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ReasonForNullSetUIModel.java
index 3164469..5101423 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ReasonForNullSetUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/ReasonForNullSetUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.seine;
* #L%
*/
-import fr.ird.observe.services.dto.referential.seine.ReasonForNullSetDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.seine.ReasonForNullSetDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/SpeciesFateUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/SpeciesFateUI.jaxx
index 2e99322..55b594b 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/SpeciesFateUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/SpeciesFateUI.jaxx
@@ -20,19 +20,17 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='SpeciesFateDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='SpeciesFateDto, SpeciesFateUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.seine.SpeciesFateDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
fr.ird.observe.application.swing.ui.util.BooleanEditor
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
@@ -64,10 +62,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST' onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER' constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' constraints='BorderLayout.WEST'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -91,62 +89,6 @@
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1' onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2' onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3' onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4' onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5' onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6' onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7' onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8' onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/SpeciesStatusUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/SpeciesStatusUI.jaxx
index c74045a..6c2c906 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/SpeciesStatusUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/SpeciesStatusUI.jaxx
@@ -20,25 +20,22 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='SpeciesStatusDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='SpeciesStatusDto, SpeciesStatusUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.seine.SpeciesStatusDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.seine.SpeciesStatusDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<SpeciesStatusUIModel id='model'/>
@@ -65,12 +62,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +73,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/SpeciesStatusUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/SpeciesStatusUIModel.java
index f4bef7f..4ec416b 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/SpeciesStatusUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/SpeciesStatusUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.seine;
* #L%
*/
-import fr.ird.observe.services.dto.referential.seine.SpeciesStatusDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.seine.SpeciesStatusDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/SurroundingActivityUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/SurroundingActivityUI.jaxx
index 68f391a..b481dce 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/SurroundingActivityUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/SurroundingActivityUI.jaxx
@@ -20,25 +20,22 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='SurroundingActivityDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='SurroundingActivityDto, SurroundingActivityUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.seine.SurroundingActivityDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.seine.SurroundingActivityDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<SurroundingActivityUIModel id='model'/>
@@ -65,12 +62,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,76 +73,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/SurroundingActivityUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/SurroundingActivityUIModel.java
index 6d8f795..ba53d38 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/SurroundingActivityUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/SurroundingActivityUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.seine;
* #L%
*/
-import fr.ird.observe.services.dto.referential.seine.SurroundingActivityDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.seine.SurroundingActivityDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/TransmittingBuoyOperationUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/TransmittingBuoyOperationUI.jaxx
index 1515d82..fd9eb37 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/TransmittingBuoyOperationUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/TransmittingBuoyOperationUI.jaxx
@@ -20,25 +20,22 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='TransmittingBuoyOperationDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='TransmittingBuoyOperationDto, TransmittingBuoyOperationUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.seine.TransmittingBuoyOperationDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.seine.TransmittingBuoyOperationDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<fr.ird.observe.application.swing.ui.content.ref.impl.seine.TransmittingBuoyOperationUIModel id='model'/>
@@ -55,7 +52,7 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JTextField id='uri'
- onKeyReleased='getBean().setUri(uri.getText())'/>
+ />
</cell>
</row>
@@ -66,12 +63,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -79,76 +74,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/TransmittingBuoyOperationUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/TransmittingBuoyOperationUIModel.java
index cef733e..f051946 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/TransmittingBuoyOperationUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/TransmittingBuoyOperationUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.seine;
* #L%
*/
-import fr.ird.observe.services.dto.referential.seine.TransmittingBuoyOperationDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.seine.TransmittingBuoyOperationDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/TransmittingBuoyTypeUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/TransmittingBuoyTypeUI.jaxx
index 15c8e81..258229f 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/TransmittingBuoyTypeUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/TransmittingBuoyTypeUI.jaxx
@@ -20,25 +20,22 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='TransmittingBuoyTypeDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='TransmittingBuoyTypeDto, TransmittingBuoyTypeUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.seine.TransmittingBuoyTypeDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.seine.TransmittingBuoyTypeDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<TransmittingBuoyTypeUIModel id='model'/>
@@ -65,12 +62,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -78,77 +73,11 @@
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
+ <Table id='editI18nTable'/>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/TransmittingBuoyTypeUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/TransmittingBuoyTypeUIModel.java
index 72235f1..ecda282 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/TransmittingBuoyTypeUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/TransmittingBuoyTypeUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.seine;
* #L%
*/
-import fr.ird.observe.services.dto.referential.seine.TransmittingBuoyTypeDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.seine.TransmittingBuoyTypeDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/VesselActivitySeineUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/VesselActivitySeineUI.jaxx
index 4001742..ec6cb22 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/VesselActivitySeineUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/VesselActivitySeineUI.jaxx
@@ -20,18 +20,16 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='VesselActivitySeineDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='VesselActivitySeineDto, VesselActivitySeineUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.seine.VesselActivitySeineDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
@@ -52,7 +50,7 @@
<JLabel id='uriLabel' styleClass='unique'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <JTextField id='uri' styleClass='unique' onKeyReleased='getBean().setUri(uri.getText())'/>
+ <JTextField id='uri' styleClass='unique'/>
</cell>
</row>
@@ -63,10 +61,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST' onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER' constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' constraints='BorderLayout.WEST'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -85,62 +83,6 @@
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1' onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2' onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3' onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4' onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5' onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6' onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7' onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8' onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/VesselActivitySeineUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/VesselActivitySeineUIModel.java
index 7739bcb..15f4c07 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/VesselActivitySeineUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/VesselActivitySeineUIModel.java
@@ -22,9 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.seine;
* #L%
*/
-import fr.ird.observe.services.dto.referential.seine.VesselActivitySeineDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
-import fr.ird.observe.services.dto.referential.seine.WeightCategoryDto;
+import fr.ird.observe.services.dto.referential.seine.VesselActivitySeineDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/WeightCategoryUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/WeightCategoryUI.jaxx
index 73459af..934b014 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/WeightCategoryUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/WeightCategoryUI.jaxx
@@ -20,18 +20,16 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='WeightCategoryDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI
+ superGenericType='WeightCategoryDto, WeightCategoryUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.ReferentialReference
fr.ird.observe.services.dto.referential.seine.WeightCategoryDto
fr.ird.observe.services.dto.referential.SpeciesDto
fr.ird.observe.application.swing.ui.UIHelper
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
jaxx.runtime.swing.editor.bean.BeanComboBox
@@ -40,14 +38,13 @@
javax.swing.table.TableCellRenderer
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.seine.WeightCategoryDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<WeightCategoryUIModel id='model'/>
@@ -99,12 +96,10 @@ public void decorateUniqueKeyTable(JTable table,
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -112,76 +107,11 @@ public void decorateUniqueKeyTable(JTable table,
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+ <Table id='editI18nTable'/>
+
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/WeightCategoryUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/WeightCategoryUIModel.java
index f4ef697..13c32e4 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/WeightCategoryUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/WeightCategoryUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.seine;
* #L%
*/
-import fr.ird.observe.services.dto.referential.seine.WeightCategoryDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.seine.WeightCategoryDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/WindUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/WindUI.jaxx
index 354a26b..75b3b24 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/WindUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/WindUI.jaxx
@@ -20,25 +20,21 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI superGenericType='WindDto'>
+<fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI superGenericType='WindDto, WindUI'>
<style source="../ReferenceEntity.jcss"/>
- <style source="../I18nReferenceEntity.jcss"/>
<import>
- fr.ird.observe.services.dto.constants.ReferenceStatus
fr.ird.observe.services.dto.referential.seine.WindDto
- fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.nuiton.i18n.I18n.n
+ fr.ird.observe.services.dto.constants.ReferenceStatus
</import>
<!-- validator -->
<BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.referential.seine.WindDto'
- context='ui-create'
- errorTableModel='{getErrorTableModel()}'/>
+ context='ui-create' errorTableModel='{getErrorTableModel()}'/>
<!-- model -->
<WindUIModel id='model'/>
@@ -65,12 +61,10 @@
</cell>
<cell anchor='east' weightx="1" fill="both">
<JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
- <JTextField id='code' constraints='BorderLayout.WEST'
- onKeyReleased='getBean().setCode(code.getText())'/>
- <EnumEditor id='status' constraints='BorderLayout.CENTER'
- constructorParams='ReferenceStatus.class'
- genericType='ReferenceStatus'
- onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'/>
+ <JTextField id='code' onKeyReleased='getBean().setCode(code.getText())'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
</JPanel>
</cell>
</row>
@@ -81,8 +75,7 @@
<JLabel id='speedRangeLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <JTextField id='speedRange'
- onKeyReleased='getBean().setSpeedRange(speedRange.getText())'/>
+ <JTextField id='speedRange' onKeyReleased='getBean().setSpeedRange(speedRange.getText())'/>
</cell>
</row>
@@ -92,85 +85,18 @@
<JLabel id='waveHeightLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <JTextField id='waveHeight'
- onKeyReleased='getBean().setWaveHeight(waveHeight.getText())'/>
+ <JTextField id='waveHeight' onKeyReleased='getBean().setWaveHeight(waveHeight.getText())'/>
</cell>
</row>
<!-- needComment -->
<row>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <JCheckBox id='needComment'
- onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
</cell>
</row>
</Table>
- <Table id='editI18nTable'>
- <row>
- <cell anchor="west">
- <JLabel id='label1Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label1'
- onKeyReleased='getBean().setLabel1(label1.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label2Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label2'
- onKeyReleased='getBean().setLabel2(label2.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label3Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label3'
- onKeyReleased='getBean().setLabel3(label3.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label4Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label4'
- onKeyReleased='getBean().setLabel4(label4.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label5Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label5'
- onKeyReleased='getBean().setLabel5(label5.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label6Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label6'
- onKeyReleased='getBean().setLabel6(label6.getText())'/>
- </cell>
- </row>
- <row>
- <cell anchor="west">
- <JLabel id='label7Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label7'
- onKeyReleased='getBean().setLabel7(label7.getText())'/>
- </cell>
- <cell anchor="west">
- <JLabel id='label8Label'/>
- </cell>
- <cell anchor='east' weightx="1" fill="both">
- <JTextField id='label8'
- onKeyReleased='getBean().setLabel8(label8.getText())'/>
- </cell>
- </row>
- </Table>
+ <Table id='editI18nTable'/>
-</fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUI>
+</fr.ird.observe.application.swing.ui.content.ref.ContentI18nReferenceUI>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/WindUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/WindUIModel.java
index a637ce5..e021968 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/WindUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ref/impl/seine/WindUIModel.java
@@ -22,8 +22,8 @@ package fr.ird.observe.application.swing.ui.content.ref.impl.seine;
* #L%
*/
-import fr.ird.observe.services.dto.referential.seine.WindDto;
import fr.ird.observe.application.swing.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.services.dto.referential.seine.WindDto;
/**
* Created on 9/28/14.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUI.jaxx
index 58e3cdd..1a201e0 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUI.jaxx
@@ -22,7 +22,7 @@
<fr.ird.observe.application.swing.ui.content.ContentUI
abstract='true'
- superGenericType='E' implements="fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI<E, D, U>"
+ superGenericType='E, U' implements="fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI<E, D, U>"
genericType='E extends IdDto, D extends IdDto, U extends ContentTableUI<E, D, U>'>
<import>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIHandler.java
index 86c660f..84eb829 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIHandler.java
@@ -44,7 +44,6 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.validator.NuitonValidatorScope;
-import javax.swing.JComponent;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
@@ -54,8 +53,6 @@ import javax.swing.SwingUtilities;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.TableModelEvent;
import javax.swing.table.DefaultTableCellRenderer;
-import java.awt.Component;
-import java.awt.FocusTraversalPolicy;
import java.awt.Rectangle;
import java.beans.PropertyChangeListener;
import java.io.Serializable;
@@ -71,7 +68,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.4
*/
-public abstract class ContentTableUIHandler<E extends IdDto, D extends IdDto, U extends ContentTableUI<E, D, U>> extends ContentUIHandler<E> {
+public abstract class ContentTableUIHandler<E extends IdDto, D extends IdDto, U extends ContentTableUI<E, D, U>> extends ContentUIHandler<E, U> {
/** Logger */
private static final Log log = LogFactory.getLog(ContentTableUIHandler.class);
@@ -135,11 +132,6 @@ public abstract class ContentTableUIHandler<E extends IdDto, D extends IdDto, U
return (ContentTableUIModel<E, D>) super.getModel();
}
- @Override
- public U getUi() {
- return (U) super.getUi();
- }
-
public final D getTableEditBean() {
return getModel().getTableEditBean();
}
@@ -220,8 +212,6 @@ public abstract class ContentTableUIHandler<E extends IdDto, D extends IdDto, U
protected abstract void loadEditBean(String beanId);
- protected abstract FocusTraversalPolicy createFocusTraversalPolicy(U ui);
-
@Override
public void initUI() {
@@ -229,31 +219,6 @@ public abstract class ContentTableUIHandler<E extends IdDto, D extends IdDto, U
uiInitializer.initUI();
getModel().addPropertyChangeListener(ContentUIModel.PROPERTY_FORM, evt -> updateUiWithReferenceSetsFromModel());
- ((JComponent) ui).setFocusCycleRoot(true);
- ((JComponent) ui).setFocusTraversalPolicy(createFocusTraversalPolicy(getUi()));
- }
-
-
- protected Component getDefaultLastComponent(U ui, Component optionalComponent) {
- if (ui.getSave().isEnabled()) {
- return ui.getSave();
- }
- if (ui.getReset().isEnabled()) {
- return ui.getReset();
- }
- if (optionalComponent != null) {
- return optionalComponent;
- }
- if (ui.getDeleteEntry().isVisible() && ui.getDeleteEntry().isEnabled()) {
- return ui.getDeleteEntry();
- }
- if (ui.getSaveNewEntry().isVisible() && ui.getSaveNewEntry().isEnabled()) {
- return ui.getSaveNewEntry();
- }
- if (ui.getResetNewEntry().isVisible() && ui.getResetNewEntry().isEnabled()) {
- return ui.getResetNewEntry();
- }
- return ui.getResetEntry();
}
@Override
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ObserveContentTableUI.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ObserveContentTableUI.java
index 951482a..dd87e0d 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ObserveContentTableUI.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ObserveContentTableUI.java
@@ -22,12 +22,14 @@ package fr.ird.observe.application.swing.ui.content.table;
* #L%
*/
-import fr.ird.observe.services.dto.IdDto;
import fr.ird.observe.application.swing.ui.content.ObserveContentUI;
+import fr.ird.observe.services.dto.IdDto;
import jaxx.runtime.swing.BlockingLayerUI;
import jaxx.runtime.validator.swing.SwingValidator;
-import javax.swing.*;
+import javax.swing.JComponent;
+import javax.swing.JTable;
+import javax.swing.ListSelectionModel;
/**
* Created on 10/5/14.
@@ -35,7 +37,7 @@ import javax.swing.*;
* @author Tony Chemit - chemit(a)codelutin.com
* @since XXX
*/
-public interface ObserveContentTableUI<E extends IdDto, D extends IdDto, U extends ContentTableUI<E,D, U>> extends ObserveContentUI<E> {
+public interface ObserveContentTableUI<E extends IdDto, D extends IdDto, U extends ContentTableUI<E, D, U>> extends ObserveContentUI<E, U> {
ContentTableUIHandler<E, D, U> getHandler();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BaitsCompositionUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BaitsCompositionUIHandler.java
index 13377c4..644a4d1 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BaitsCompositionUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BaitsCompositionUIHandler.java
@@ -23,20 +23,18 @@ package fr.ird.observe.application.swing.ui.content.table.impl.longline;
*/
import fr.ird.observe.application.swing.db.constants.DataContextType;
+import fr.ird.observe.application.swing.ui.UIHelper;
+import fr.ird.observe.application.swing.ui.content.table.ContentTableUIHandler;
import fr.ird.observe.services.dto.longline.BaitsCompositionDto;
import fr.ird.observe.services.dto.longline.SetLonglineGlobalCompositionDto;
import fr.ird.observe.services.dto.referential.longline.BaitSettingStatusDto;
import fr.ird.observe.services.dto.referential.longline.BaitTypeDto;
-import fr.ird.observe.application.swing.ui.UIHelper;
-import fr.ird.observe.application.swing.ui.content.table.ContentTableUIHandler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
-import java.awt.FocusTraversalPolicy;
-
import static org.nuiton.i18n.I18n.n;
/**
@@ -55,11 +53,6 @@ public class BaitsCompositionUIHandler extends ContentTableUIHandler<SetLongline
}
@Override
- protected FocusTraversalPolicy createFocusTraversalPolicy(BaitsCompositionUI ui) {
- return null;
- }
-
- @Override
protected void onSelectedRowChanged(int editingRow, BaitsCompositionDto bean, boolean create) {
if (getTableModel().isEditable()) {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BranchlinesCompositionUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BranchlinesCompositionUIHandler.java
index a0d947c..852d0a1 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BranchlinesCompositionUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BranchlinesCompositionUIHandler.java
@@ -23,20 +23,18 @@ package fr.ird.observe.application.swing.ui.content.table.impl.longline;
*/
import fr.ird.observe.application.swing.db.constants.DataContextType;
+import fr.ird.observe.application.swing.ui.UIHelper;
+import fr.ird.observe.application.swing.ui.content.table.ContentTableUIHandler;
import fr.ird.observe.services.dto.longline.BranchlinesCompositionDto;
import fr.ird.observe.services.dto.longline.SetLonglineGlobalCompositionDto;
import fr.ird.observe.services.dto.referential.longline.HookSizeDto;
import fr.ird.observe.services.dto.referential.longline.HookTypeDto;
-import fr.ird.observe.application.swing.ui.UIHelper;
-import fr.ird.observe.application.swing.ui.content.table.ContentTableUIHandler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
-import java.awt.FocusTraversalPolicy;
-
import static org.nuiton.i18n.I18n.n;
/**
@@ -55,11 +53,6 @@ public class BranchlinesCompositionUIHandler extends ContentTableUIHandler<SetLo
}
@Override
- protected FocusTraversalPolicy createFocusTraversalPolicy(BranchlinesCompositionUI ui) {
- return null;
- }
-
- @Override
protected void onSelectedRowChanged(int editingRow, BranchlinesCompositionDto bean, boolean create) {
if (getTableModel().isEditable()) {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/CatchLonglineUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/CatchLonglineUIHandler.java
index 2ed9f6d..3146d7a 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/CatchLonglineUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/CatchLonglineUIHandler.java
@@ -76,12 +76,8 @@ import javax.swing.JOptionPane;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
import javax.swing.JTable;
-import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.event.TableModelListener;
import javax.swing.table.DefaultTableCellRenderer;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.FocusTraversalPolicy;
import java.beans.PropertyChangeListener;
import java.util.Calendar;
import java.util.Collection;
@@ -177,84 +173,6 @@ public class CatchLonglineUIHandler extends ContentTableUIHandler<SetLonglineCat
}
@Override
- protected FocusTraversalPolicy createFocusTraversalPolicy(CatchLonglineUI ui) {
- return new LayoutFocusTraversalPolicy() {
-
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- if (getTableModel().isCreate()) {
- if (aComponent.equals(ui.getAcquisitionModeIndividual())) {
- return getLastComponent(aContainer);
- }
- } else {
- if (aComponent.equals(ui.getSection().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- }
-
- case 1:
- if (aComponent.equals(ui.getDepredated())) {
- return getLastComponent(aContainer);
- }
- case 2:
- if (aComponent.equals(ui.getStomacFullness().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- case 5:
- if (aComponent.equals(ui.getDepthRecorder())) {
- return getLastComponent(aContainer);
- }
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getFirstComponent(Container aContainer) {
- int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- if (getTableModel().isCreate()) {
- return ui.getAcquisitionModeIndividual();
- } else {
- return ui.getSection();
- }
- case 1:
- return ui.getDepredated();
- case 2:
- return ui.getStomacFullness();
- case 5:
- return ui.getDepthRecorder();
- }
- return super.getFirstComponent(aContainer);
- }
-
- @Override
- public Component getLastComponent(Container aContainer) {
- if (ui.getSave().isEnabled()) {
- return ui.getSave();
- }
- if (ui.getReset().isEnabled()) {
- return ui.getReset();
- }
- if (ui.getDeleteEntry().isEnabled()) {
- return ui.getDeleteEntry();
- }
- if (ui.getSaveNewEntry().isEnabled()) {
- return ui.getSaveNewEntry();
- }
- if (ui.getResetEntry().isEnabled()) {
- return ui.getResetEntry();
- }
-
- return super.getLastComponent(aContainer);
- }
- };
- }
-
- @Override
public void openUI() {
if (log.isInfoEnabled()) {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/EncounterUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/EncounterUIHandler.java
index 59063c5..76f9700 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/EncounterUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/EncounterUIHandler.java
@@ -43,11 +43,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.swing.JTable;
-import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.table.DefaultTableCellRenderer;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.FocusTraversalPolicy;
import java.util.Collection;
import java.util.LinkedList;
import java.util.Set;
@@ -80,36 +76,6 @@ public class EncounterUIHandler extends ContentTableUIHandler<ActivityLonglineEn
}
@Override
- protected FocusTraversalPolicy createFocusTraversalPolicy(EncounterUI ui) {
- return new LayoutFocusTraversalPolicy() {
-
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- if (aComponent.equals(ui.getEncounterType().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getFirstComponent(Container aContainer) {
- return ui.getEncounterType();
- }
-
- @Override
- public Component getLastComponent(Container aContainer) {
- if (ui.getSave().isEnabled()) {
- return ui.getSave();
- }
- if (ui.getReset().isEnabled()) {
- return ui.getReset();
- }
- return ui.getComment2();
- }
- };
- }
-
- @Override
protected void initTableUI(DefaultTableCellRenderer renderer) {
JTable table = getUi().getTable();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/FloatlinesCompositionUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/FloatlinesCompositionUIHandler.java
index c402d38..56b3624 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/FloatlinesCompositionUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/FloatlinesCompositionUIHandler.java
@@ -23,19 +23,17 @@ package fr.ird.observe.application.swing.ui.content.table.impl.longline;
*/
import fr.ird.observe.application.swing.db.constants.DataContextType;
+import fr.ird.observe.application.swing.ui.UIHelper;
+import fr.ird.observe.application.swing.ui.content.table.ContentTableUIHandler;
import fr.ird.observe.services.dto.longline.FloatlinesCompositionDto;
import fr.ird.observe.services.dto.longline.SetLonglineGlobalCompositionDto;
import fr.ird.observe.services.dto.referential.longline.LineTypeDto;
-import fr.ird.observe.application.swing.ui.UIHelper;
-import fr.ird.observe.application.swing.ui.content.table.ContentTableUIHandler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
-import java.awt.FocusTraversalPolicy;
-
import static org.nuiton.i18n.I18n.n;
/**
@@ -54,11 +52,6 @@ public class FloatlinesCompositionUIHandler extends ContentTableUIHandler<SetLon
}
@Override
- protected FocusTraversalPolicy createFocusTraversalPolicy(FloatlinesCompositionUI ui) {
- return null;
- }
-
- @Override
protected void onSelectedRowChanged(int editingRow, FloatlinesCompositionDto bean, boolean create) {
if (getTableModel().isEditable()) {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/GearUseFeaturesLonglineUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/GearUseFeaturesLonglineUIHandler.java
index 13a708d..13b9f91 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/GearUseFeaturesLonglineUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/GearUseFeaturesLonglineUIHandler.java
@@ -57,12 +57,8 @@ import org.nuiton.validator.NuitonValidatorScope;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JTable;
-import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.event.TableModelListener;
import javax.swing.table.DefaultTableCellRenderer;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.FocusTraversalPolicy;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.beans.PropertyChangeListener;
@@ -104,40 +100,6 @@ public class GearUseFeaturesLonglineUIHandler extends ContentTableUIHandler<Trip
}
@Override
- protected FocusTraversalPolicy createFocusTraversalPolicy(GearUseFeaturesLonglineUI ui) {
-
- return new LayoutFocusTraversalPolicy() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- int selectedIndex = ui.getGearUseFeaturesTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- if (aComponent.equals(ui.getGear().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getFirstComponent(Container aContainer) {
- int selectedIndex = ui.getGearUseFeaturesTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- return ui.getGear();
- }
- return super.getFirstComponent(aContainer);
- }
-
- @Override
- public Component getLastComponent(Container aContainer) {
- return getDefaultLastComponent(ui, null);
- }
- };
-
- }
-
- @Override
public GearUseFeaturesLonglineUIModel getModel() {
return (GearUseFeaturesLonglineUIModel) super.getModel();
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/HooksCompositionUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/HooksCompositionUIHandler.java
index e3e2c88..266d1e8 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/HooksCompositionUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/HooksCompositionUIHandler.java
@@ -55,11 +55,6 @@ public class HooksCompositionUIHandler extends ContentTableUIHandler<SetLongline
}
@Override
- protected FocusTraversalPolicy createFocusTraversalPolicy(HooksCompositionUI ui) {
- return null;
- }
-
- @Override
protected void onSelectedRowChanged(int editingRow, HooksCompositionDto bean, boolean create) {
if (getTableModel().isEditable()) {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/SensorUsedUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/SensorUsedUIHandler.java
index b1bd29b..a3cdf99 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/SensorUsedUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/SensorUsedUIHandler.java
@@ -232,36 +232,6 @@ public class SensorUsedUIHandler extends ContentTableUIHandler<ActivityLonglineS
ActivityLonglineSensorUsedHelper.copyActivityLonglineSensorUsedDto(form.getObject(), getBean());
}
- @Override
- protected FocusTraversalPolicy createFocusTraversalPolicy(SensorUsedUI ui) {
- return new LayoutFocusTraversalPolicy() {
-
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- if (aComponent.equals(ui.getSensorType().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getFirstComponent(Container aContainer) {
- return ui.getSensorType();
- }
-
- @Override
- public Component getLastComponent(Container aContainer) {
- if (ui.getSave().isEnabled()) {
- return ui.getSave();
- }
- if (ui.getReset().isEnabled()) {
- return ui.getReset();
- }
- return ui.getComment2();
- }
- };
- }
-
protected ActivityLongLineSensorUsedService getActivityLonglineSensorUsedService() {
return ObserveSwingApplicationContext.get().getMainDataSourceServicesProvider().newActivityLongLineSensorUsedService();
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/TdrUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/TdrUIHandler.java
index 1617795..b0fa06a 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/TdrUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/TdrUIHandler.java
@@ -54,12 +54,9 @@ import org.nuiton.validator.NuitonValidatorScope;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JTable;
-import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.event.TableModelListener;
import javax.swing.table.DefaultTableCellRenderer;
import java.awt.Component;
-import java.awt.Container;
-import java.awt.FocusTraversalPolicy;
import java.beans.PropertyChangeListener;
import java.io.File;
import java.io.IOException;
@@ -208,79 +205,6 @@ public class TdrUIHandler extends ContentTableUIHandler<SetLonglineTdrDto, TdrDt
}
@Override
- protected FocusTraversalPolicy createFocusTraversalPolicy(TdrUI ui) {
- return new LayoutFocusTraversalPolicy() {
-
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- int selectedIndex = ui.getEditTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- if (aComponent.equals(ui.getHomeId())) {
- return getLastComponent(aContainer);
- }
- case 1:
- if (aComponent.equals(ui.getSection().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- case 2:
- if (aComponent.equals(ui.getEnableTimestamp())) {
- return getLastComponent(aContainer);
- }
- case 3:
- if (aComponent.equals(ui.getFishingStartDepth())) {
- return getLastComponent(aContainer);
- }
- case 4:
- if (aComponent.equals(ui.getSpecies().getUniverseList())) {
- return getLastComponent(aContainer);
- }
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getFirstComponent(Container aContainer) {
- int selectedIndex = ui.getEditTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- return ui.getHomeId();
- case 1:
- return ui.getSection();
- case 2:
- return ui.getEnableTimestamp();
- case 3:
- return ui.getFishingStartDepth();
- case 4:
- return ui.getSpecies().getUniverseList();
- }
- return super.getFirstComponent(aContainer);
- }
-
- @Override
- public Component getLastComponent(Container aContainer) {
- if (ui.getSave().isEnabled()) {
- return ui.getSave();
- }
- if (ui.getReset().isEnabled()) {
- return ui.getReset();
- }
- if (ui.getDeleteEntry().isEnabled()) {
- return ui.getDeleteEntry();
- }
- if (ui.getSaveNewEntry().isEnabled()) {
- return ui.getSaveNewEntry();
- }
- if (ui.getResetEntry().isEnabled()) {
- return ui.getResetEntry();
- }
-
- return super.getLastComponent(aContainer);
- }
- };
- }
-
- @Override
public void openUI() {
if (log.isInfoEnabled()) {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/GearUseFeaturesSeineUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/GearUseFeaturesSeineUIHandler.java
index 932488b..06f1bda 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/GearUseFeaturesSeineUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/GearUseFeaturesSeineUIHandler.java
@@ -45,8 +45,8 @@ import fr.ird.observe.services.dto.seine.GearUseFeaturesSeineDto;
import fr.ird.observe.services.dto.seine.TripSeineDto;
import fr.ird.observe.services.dto.seine.TripSeineGearUseDto;
import fr.ird.observe.services.dto.seine.TripSeineGearUseHelper;
-import fr.ird.observe.services.service.referential.ReferentialService;
import fr.ird.observe.services.service.data.seine.TripSeineGearUseService;
+import fr.ird.observe.services.service.referential.ReferentialService;
import jaxx.runtime.SwingUtil;
import jaxx.runtime.validator.swing.SwingValidatorMessage;
import jaxx.runtime.validator.swing.SwingValidatorMessageTableModel;
@@ -57,12 +57,8 @@ import org.nuiton.validator.NuitonValidatorScope;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JTable;
-import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.event.TableModelListener;
import javax.swing.table.DefaultTableCellRenderer;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.FocusTraversalPolicy;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.beans.PropertyChangeListener;
@@ -104,56 +100,6 @@ public class GearUseFeaturesSeineUIHandler extends ContentTableUIHandler<TripSei
}
@Override
- protected FocusTraversalPolicy createFocusTraversalPolicy(GearUseFeaturesSeineUI ui) {
- return new LayoutFocusTraversalPolicy() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- int selectedIndex = ui.getGearUseFeaturesTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- if (aComponent.equals(ui.getGear().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getFirstComponent(Container aContainer) {
- int selectedIndex = ui.getGearUseFeaturesTabPane().getSelectedIndex();
- switch (selectedIndex) {
- case 0:
- return ui.getGear();
- }
- return super.getFirstComponent(aContainer);
- }
-
- @Override
- public Component getLastComponent(Container aContainer) {
- if (ui.getSave().isEnabled()) {
- return ui.getSave();
- }
- if (ui.getReset().isEnabled()) {
- return ui.getReset();
- }
- if (ui.getDeleteEntry().isVisible() && ui.getDeleteEntry().isEnabled()) {
- return ui.getDeleteEntry();
- }
- if (ui.getSaveNewEntry().isVisible() && ui.getSaveNewEntry().isEnabled()) {
- return ui.getSaveNewEntry();
- }
- if (ui.getResetNewEntry().isVisible() && ui.getResetNewEntry().isEnabled()) {
- return ui.getResetNewEntry();
- }
- if (ui.getResetEntry().isEnabled()) {
- return ui.getResetEntry();
- }
- return super.getLastComponent(aContainer);
- }
- };
- }
-
- @Override
public GearUseFeaturesSeineUIModel getModel() {
return (GearUseFeaturesSeineUIModel) super.getModel();
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetCatchUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetCatchUIHandler.java
index ee42d6e..4968380 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetCatchUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetCatchUIHandler.java
@@ -51,11 +51,7 @@ import org.apache.commons.logging.LogFactory;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JTable;
-import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.table.DefaultTableCellRenderer;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.FocusTraversalPolicy;
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.Collection;
@@ -131,29 +127,6 @@ public class NonTargetCatchUIHandler extends ContentTableUIHandler<SetSeineNonTa
};
}
- @Override
- protected FocusTraversalPolicy createFocusTraversalPolicy(NonTargetCatchUI ui) {
- return new LayoutFocusTraversalPolicy() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- if (aComponent.equals(ui.getSpecies().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getFirstComponent(Container aContainer) {
- return ui.getSpecies();
- }
-
- @Override
- public Component getLastComponent(Container aContainer) {
- return getDefaultLastComponent(ui, null);
- }
- };
- }
-
public String getCatchWeightDataTip(NonTargetCatchComputedValueSource computed) {
String result;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetSampleUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetSampleUIHandler.java
index aa464d0..efb230b 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetSampleUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetSampleUIHandler.java
@@ -46,11 +46,7 @@ import org.nuiton.validator.NuitonValidatorScope;
import javax.swing.JComponent;
import javax.swing.JTable;
-import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.table.DefaultTableCellRenderer;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.FocusTraversalPolicy;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
@@ -74,36 +70,6 @@ public class NonTargetSampleUIHandler extends AbstractSampleUIHandler<NonTargetS
}
@Override
- protected FocusTraversalPolicy createFocusTraversalPolicy(NonTargetSampleUI ui) {
- return new LayoutFocusTraversalPolicy() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- if (aComponent.equals(ui.getAcquisitionModeEffectif())) {
- return getLastComponent(aContainer);
- }
- if (aComponent.equals(ui.getSizeMeasureType().getCombobox().getEditor().getEditorComponent()) && !ui.getAcquisitionModeEffectif().isEnabled()) {
- return super.getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getFirstComponent(Container aContainer) {
- if (ui.getAcquisitionModeEffectif().isEnabled()) {
- return ui.getAcquisitionModeEffectif();
- }
- return ui.getSizeMeasureType();
- }
-
- @Override
- public Component getLastComponent(Container aContainer) {
- return getDefaultLastComponent(ui, ui.getComment2());
- }
- };
-
- }
-
- @Override
public void resetIsWeightComputed() {
getTableEditBean().setIsWeightComputed(false);
getUi().getWeight().grabFocus();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectObservedSpeciesUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectObservedSpeciesUIHandler.java
index da0e421..611678b 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectObservedSpeciesUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectObservedSpeciesUIHandler.java
@@ -23,6 +23,8 @@ package fr.ird.observe.application.swing.ui.content.table.impl.seine;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
import fr.ird.observe.application.swing.db.constants.DataContextType;
+import fr.ird.observe.application.swing.ui.UIHelper;
+import fr.ird.observe.application.swing.ui.content.table.ContentTableUIHandler;
import fr.ird.observe.services.dto.Form;
import fr.ird.observe.services.dto.referential.ReferentialDto;
import fr.ird.observe.services.dto.referential.ReferentialReference;
@@ -35,19 +37,13 @@ import fr.ird.observe.services.dto.seine.FloatingObjectObservedSpeciesDto;
import fr.ird.observe.services.dto.seine.FloatingObjectObservedSpeciesHelper;
import fr.ird.observe.services.dto.seine.ObjectObservedSpeciesDto;
import fr.ird.observe.services.dto.seine.ObjectSchoolEstimateDto;
-import fr.ird.observe.services.service.referential.ReferentialService;
import fr.ird.observe.services.service.data.seine.ObjectObservedSpeciesService;
-import fr.ird.observe.application.swing.ui.UIHelper;
-import fr.ird.observe.application.swing.ui.content.table.ContentTableUIHandler;
+import fr.ird.observe.services.service.referential.ReferentialService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.swing.JTable;
-import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.table.DefaultTableCellRenderer;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.FocusTraversalPolicy;
import java.util.Collection;
import java.util.LinkedList;
import java.util.Set;
@@ -68,29 +64,6 @@ public class ObjectObservedSpeciesUIHandler extends ContentTableUIHandler<Floati
}
@Override
- protected FocusTraversalPolicy createFocusTraversalPolicy(ObjectObservedSpeciesUI ui) {
- return new LayoutFocusTraversalPolicy() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- if (aComponent.equals(ui.getSpecies().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getFirstComponent(Container aContainer) {
- return ui.getSpecies();
- }
-
- @Override
- public Component getLastComponent(Container aContainer) {
- return getDefaultLastComponent(ui, ui.getComment2());
- }
- };
- }
-
- @Override
protected String getEditBeanIdToLoad() {
return getDataContext().getSelectedFloatingObjectId();
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectSchoolEstimateUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectSchoolEstimateUIHandler.java
index 272ac1d..9a52183 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectSchoolEstimateUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectSchoolEstimateUIHandler.java
@@ -23,6 +23,8 @@ package fr.ird.observe.application.swing.ui.content.table.impl.seine;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
import fr.ird.observe.application.swing.db.constants.DataContextType;
+import fr.ird.observe.application.swing.ui.UIHelper;
+import fr.ird.observe.application.swing.ui.content.table.ContentTableUIHandler;
import fr.ird.observe.services.dto.Form;
import fr.ird.observe.services.dto.referential.ReferentialDto;
import fr.ird.observe.services.dto.referential.ReferentialReference;
@@ -33,19 +35,13 @@ import fr.ird.observe.services.dto.result.SaveResultDto;
import fr.ird.observe.services.dto.seine.FloatingObjectSchoolEstimateDto;
import fr.ird.observe.services.dto.seine.FloatingObjectSchoolEstimateHelper;
import fr.ird.observe.services.dto.seine.ObjectSchoolEstimateDto;
-import fr.ird.observe.services.service.referential.ReferentialService;
import fr.ird.observe.services.service.data.seine.ObjectSchoolEstimateService;
-import fr.ird.observe.application.swing.ui.UIHelper;
-import fr.ird.observe.application.swing.ui.content.table.ContentTableUIHandler;
+import fr.ird.observe.services.service.referential.ReferentialService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.swing.JTable;
-import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.table.DefaultTableCellRenderer;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.FocusTraversalPolicy;
import java.util.Collection;
import java.util.LinkedList;
import java.util.Set;
@@ -67,29 +63,6 @@ public class ObjectSchoolEstimateUIHandler extends ContentTableUIHandler<Floatin
}
@Override
- protected FocusTraversalPolicy createFocusTraversalPolicy(ObjectSchoolEstimateUI ui) {
- return new LayoutFocusTraversalPolicy() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- if (aComponent.equals(ui.getSpecies().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getFirstComponent(Container aContainer) {
- return ui.getSpecies();
- }
-
- @Override
- public Component getLastComponent(Container aContainer) {
- return getDefaultLastComponent(ui, ui.getComment2());
- }
- };
- }
-
- @Override
protected void onSelectedRowChanged(int editingRow, ObjectSchoolEstimateDto bean, boolean create) {
if (getTableModel().isEditable()) {
if (log.isDebugEnabled()) {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/SchoolEstimateUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/SchoolEstimateUIHandler.java
index a663687..62b0afe 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/SchoolEstimateUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/SchoolEstimateUIHandler.java
@@ -43,11 +43,7 @@ import org.apache.commons.logging.LogFactory;
import javax.swing.JComponent;
import javax.swing.JTable;
-import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.table.DefaultTableCellRenderer;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.FocusTraversalPolicy;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
@@ -71,35 +67,6 @@ public class SchoolEstimateUIHandler extends ContentTableUIHandler<SetSeineSchoo
}
@Override
- protected FocusTraversalPolicy createFocusTraversalPolicy(SchoolEstimateUI ui) {
- return new LayoutFocusTraversalPolicy() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- if (aComponent.equals(ui.getSpecies().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- if (aComponent.equals(ui.getTotalWeight().getTextField()) && !ui.getSpecies().isEnabled()) {
- return getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getFirstComponent(Container aContainer) {
- if (ui.getSpecies().isEnabled()) {
- return ui.getSpecies();
- }
- return ui.getTotalWeight();
- }
-
- @Override
- public Component getLastComponent(Container aContainer) {
- return getDefaultLastComponent(ui, ui.getComment2());
- }
- };
- }
-
- @Override
protected String getEditBeanIdToLoad() {
return getDataContext().getSelectedSetId();
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetCatchUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetCatchUIHandler.java
index d722d51..33a17bb 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetCatchUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetCatchUIHandler.java
@@ -51,11 +51,7 @@ import org.nuiton.decorator.Decorator;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JTable;
-import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.table.DefaultTableCellRenderer;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.FocusTraversalPolicy;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
@@ -79,35 +75,6 @@ public class TargetCatchUIHandler extends ContentTableUIHandler<SetSeineTargetCa
}
@Override
- protected FocusTraversalPolicy createFocusTraversalPolicy(TargetCatchUI ui) {
- return new LayoutFocusTraversalPolicy() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- if (aComponent.equals(ui.getSpecies().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- if (aComponent.equals(ui.getCatchWeight().getTextField()) && !ui.getSpecies().isEnabled()) {
- return super.getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getFirstComponent(Container aContainer) {
- if (ui.getSpecies().isEnabled()) {
- return ui.getSpecies();
- }
- return ui.getCatchWeight();
- }
-
- @Override
- public Component getLastComponent(Container aContainer) {
- return getDefaultLastComponent(ui, ui.getTargetCatchCompositionEstimatedByObserver());
- }
- };
- }
-
- @Override
public void initUI() {
super.initUI();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetDiscardCatchUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetDiscardCatchUIHandler.java
index d9bceb4..a8469c7 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetDiscardCatchUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetDiscardCatchUIHandler.java
@@ -52,11 +52,7 @@ import org.nuiton.decorator.Decorator;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JTable;
-import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.table.DefaultTableCellRenderer;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.FocusTraversalPolicy;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -82,35 +78,6 @@ public class TargetDiscardCatchUIHandler extends ContentTableUIHandler<SetSeineT
}
@Override
- protected FocusTraversalPolicy createFocusTraversalPolicy(TargetDiscardCatchUI ui) {
- return new LayoutFocusTraversalPolicy() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- if (aComponent.equals(ui.getSpecies().getCombobox().getEditor().getEditorComponent())) {
- return getLastComponent(aContainer);
- }
- if (aComponent.equals(ui.getCatchWeight().getTextField()) && !ui.getSpecies().isEnabled()) {
- return super.getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getFirstComponent(Container aContainer) {
- if (ui.getSpecies().isEnabled()) {
- return ui.getSpecies();
- }
- return ui.getCatchWeight();
- }
-
- @Override
- public Component getLastComponent(Container aContainer) {
- return getDefaultLastComponent(ui, ui.getTargetDiscardCatchCompositionEstimatedByObserver());
- }
- };
- }
-
- @Override
public void initUI() {
super.initUI();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetSampleUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetSampleUIHandler.java
index 20ff998..8525acb 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetSampleUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetSampleUIHandler.java
@@ -45,11 +45,7 @@ import org.nuiton.validator.NuitonValidatorScope;
import javax.swing.JComponent;
import javax.swing.JTable;
-import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.table.DefaultTableCellRenderer;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.FocusTraversalPolicy;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
@@ -82,35 +78,6 @@ public class TargetSampleUIHandler extends AbstractSampleUIHandler<TargetSampleD
}
@Override
- protected FocusTraversalPolicy createFocusTraversalPolicy(TargetSampleUI ui) {
- return new LayoutFocusTraversalPolicy() {
- @Override
- public Component getComponentBefore(Container aContainer, Component aComponent) {
- if (aComponent.equals(ui.getAcquisitionModeEffectif())) {
- return getLastComponent(aContainer);
- }
- if (aComponent.equals(ui.getSizeMeasureType().getCombobox().getEditor().getEditorComponent()) && !ui.getAcquisitionModeEffectif().isEnabled()) {
- return super.getLastComponent(aContainer);
- }
- return super.getComponentBefore(aContainer, aComponent);
- }
-
- @Override
- public Component getFirstComponent(Container aContainer) {
- if (ui.getAcquisitionModeEffectif().isEnabled()) {
- return ui.getAcquisitionModeEffectif();
- }
- return ui.getSizeMeasureType();
- }
-
- @Override
- public Component getLastComponent(Container aContainer) {
- return getDefaultLastComponent(ui, ui.getComment2());
- }
- };
- }
-
- @Override
public void resetIsWeightComputed() {
getTableEditBean().setIsWeightComputed(false);
getUi().getWeight().grabFocus();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/tree/ObserveNavigationTreeShowPopupAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/tree/ObserveNavigationTreeShowPopupAction.java
index 8a39c71..3c4b1a5 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/tree/ObserveNavigationTreeShowPopupAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/tree/ObserveNavigationTreeShowPopupAction.java
@@ -251,7 +251,7 @@ public class ObserveNavigationTreeShowPopupAction {
ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get();
DataContext dataContext = applicationContext.getDataContext();
- ContentUI<?> selectedContentUI = applicationContext.getContentUIManager().getSelectedContentUI();
+ ContentUI<?, ?> selectedContentUI = applicationContext.getContentUIManager().getSelectedContentUI();
ObserveOpenDataManager openDataManager = applicationContext.getOpenDataManager();
boolean closeActionEnabled = false;
--
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm(a)codelutin.com>.
1
0
06/32: Gestion du focus sur les écrans d'édition (reste juste le référentiel à faire)
by codelutin.com scm 25 Nov '16
by codelutin.com scm 25 Nov '16
25 Nov '16
This is an automated email from the git hooks/post-receive script.
New commit to branch develop in repository observe.
See https://gitlab.nuiton.org/codelutin/observe.git
commit f3617cd007ac56a3e56de13cf8eb7ebc00e668a4
Author: Tony CHEMIT <chemit(a)codelutin.com>
Date: Tue Nov 8 20:20:34 2016 +0100
Gestion du focus sur les écrans d'édition (reste juste le référentiel à faire)
---
.../ui/actions/shared/CloseAndCreateUIAction.java | 16 +-
.../swing/ui/actions/shared/CloseOpenUIAction.java | 199 ++++++++++++---------
.../swing/ui/actions/shared/ReOpenUIAction.java | 23 ++-
.../swing/ui/content/ContentUIInitializer.java | 3 +
.../LonglineDetailCompositionUIHandler.java | 67 ++++++-
.../impl/longline/SetLonglineUIHandler.java | 39 ++++
...ngObjectTransmittingBuoyOperationUIHandler.java | 48 ++++-
.../impl/seine/FloatingObjectUIHandler.java | 48 ++++-
.../ui/content/impl/seine/SetSeineUIHandler.java | 63 ++++++-
.../swing/ui/content/list/ContentListUI.jaxx | 21 ++-
.../swing/ui/content/list/ContentListUI.jcss | 7 +
.../ui/content/list/ContentListUIHandler.java | 66 ++++++-
.../list/impl/longline/ActivityLonglinesUI.jaxx | 8 +-
.../impl/longline/ActivityLonglinesUIHandler.java | 11 +-
.../list/impl/longline/TripLonglinesUI.jaxx | 7 +-
.../list/impl/longline/TripLonglinesUIHandler.java | 13 +-
.../content/list/impl/seine/ActivitySeinesUI.jaxx | 8 +-
.../list/impl/seine/ActivitySeinesUIHandler.java | 8 +-
.../swing/ui/content/list/impl/seine/RoutesUI.jaxx | 8 +-
.../content/list/impl/seine/RoutesUIHandler.java | 8 +-
.../ui/content/list/impl/seine/TripSeinesUI.jaxx | 8 +-
.../list/impl/seine/TripSeinesUIHandler.java | 11 +-
.../swing/ui/content/open/ContentOpenableUI.jaxx | 12 +-
.../ui/content/open/ContentOpenableUIHandler.java | 39 ++--
.../open/impl/longline/ActivityLonglineUI.jaxx | 16 +-
.../impl/longline/ActivityLonglineUIHandler.java | 37 +++-
.../content/open/impl/longline/TripLonglineUI.jaxx | 47 +++--
.../open/impl/longline/TripLonglineUIHandler.java | 43 ++++-
.../content/open/impl/seine/ActivitySeineUI.jaxx | 5 +-
.../open/impl/seine/ActivitySeineUIHandler.java | 62 ++++++-
.../swing/ui/content/open/impl/seine/RouteUI.jaxx | 16 +-
.../ui/content/open/impl/seine/RouteUIHandler.java | 84 ++++-----
.../ui/content/open/impl/seine/TripSeineUI.jaxx | 27 +--
.../open/impl/seine/TripSeineUIHandler.java | 52 ++++--
.../swing/ui/content/table/ContentTableModel.java | 7 +-
.../swing/ui/content/table/ContentTableUI.jaxx | 6 +-
.../ui/content/table/ContentTableUIHandler.java | 155 +++++-----------
.../content/table/ContentTableUIInitializer.java | 4 +-
.../ui/content/table/ContentTableUIModel.java | 6 +-
.../ui/content/table/ObserveContentTableUI.java | 4 +-
.../table/impl/longline/BaitsCompositionUI.jaxx | 19 +-
.../impl/longline/BaitsCompositionUIHandler.java | 8 +-
.../impl/longline/BaitsCompositionUIModel.java | 20 +--
.../impl/longline/BranchlinesCompositionUI.jaxx | 19 +-
.../longline/BranchlinesCompositionUIHandler.java | 8 +-
.../longline/BranchlinesCompositionUIModel.java | 20 +--
.../impl/longline/CatchLonglineTableModel.java | 3 +-
.../table/impl/longline/CatchLonglineUI.jaxx | 59 ++++--
.../impl/longline/CatchLonglineUIHandler.java | 97 ++++++++--
.../table/impl/longline/CatchLonglineUIModel.java | 58 +++---
.../content/table/impl/longline/EncounterUI.jaxx | 14 +-
.../table/impl/longline/EncounterUIHandler.java | 47 ++++-
.../table/impl/longline/EncounterUIModel.java | 12 +-
.../impl/longline/FloatlinesCompositionUI.jaxx | 16 +-
.../longline/FloatlinesCompositionUIHandler.java | 8 +-
.../longline/FloatlinesCompositionUIModel.java | 17 +-
.../GearUseFeaturesLonglineTableModel.java | 8 +-
.../impl/longline/GearUseFeaturesLonglineUI.jaxx | 25 ++-
.../longline/GearUseFeaturesLonglineUIHandler.java | 41 ++++-
.../longline/GearUseFeaturesLonglineUIModel.java | 10 +-
.../table/impl/longline/HooksCompositionUI.jaxx | 20 +--
.../impl/longline/HooksCompositionUIHandler.java | 8 +-
.../impl/longline/HooksCompositionUIModel.java | 19 +-
.../content/table/impl/longline/SensorUsedUI.jaxx | 18 +-
.../table/impl/longline/SensorUsedUIHandler.java | 40 ++++-
.../table/impl/longline/SensorUsedUIModel.java | 23 +--
.../ui/content/table/impl/longline/TdrUI.jaxx | 27 +--
.../content/table/impl/longline/TdrUIHandler.java | 83 ++++++++-
.../ui/content/table/impl/longline/TdrUIModel.java | 5 +-
.../table/impl/seine/AbstractSampleUIHandler.java | 6 +-
.../impl/seine/GearUseFeaturesSeineTableModel.java | 8 +-
.../table/impl/seine/GearUseFeaturesSeineUI.jaxx | 25 ++-
.../impl/seine/GearUseFeaturesSeineUIHandler.java | 55 +++++-
.../impl/seine/GearUseFeaturesSeineUIModel.java | 24 +--
.../content/table/impl/seine/NonTargetCatchUI.jaxx | 45 ++---
.../table/impl/seine/NonTargetCatchUIHandler.java | 28 ++-
.../table/impl/seine/NonTargetCatchUIModel.java | 12 +-
.../table/impl/seine/NonTargetSampleUI.jaxx | 15 +-
.../table/impl/seine/NonTargetSampleUIHandler.java | 35 +++-
.../table/impl/seine/NonTargetSampleUIModel.java | 23 +--
.../table/impl/seine/ObjectObservedSpeciesUI.jaxx | 31 ++--
.../impl/seine/ObjectObservedSpeciesUIHandler.java | 28 ++-
.../impl/seine/ObjectObservedSpeciesUIModel.java | 13 +-
.../table/impl/seine/ObjectSchoolEstimateUI.jaxx | 31 ++--
.../impl/seine/ObjectSchoolEstimateUIHandler.java | 28 ++-
.../impl/seine/ObjectSchoolEstimateUIModel.java | 13 +-
.../content/table/impl/seine/SchoolEstimateUI.jaxx | 24 +--
.../table/impl/seine/SchoolEstimateUIHandler.java | 42 ++++-
.../table/impl/seine/SchoolEstimateUIModel.java | 19 +-
.../ui/content/table/impl/seine/TargetCatchUI.jaxx | 27 ++-
.../table/impl/seine/TargetCatchUIHandler.java | 40 ++++-
.../table/impl/seine/TargetCatchUIModel.java | 27 +--
.../table/impl/seine/TargetDiscardCatchUI.jaxx | 33 ++--
.../impl/seine/TargetDiscardCatchUIHandler.java | 34 +++-
.../impl/seine/TargetDiscardCatchUIModel.java | 27 +--
.../table/impl/seine/TargetSampleCaptureUI.jaxx | 7 +-
.../table/impl/seine/TargetSampleRejeteUI.jaxx | 7 +-
.../content/table/impl/seine/TargetSampleUI.jaxx | 17 +-
.../table/impl/seine/TargetSampleUIHandler.java | 37 +++-
.../table/impl/seine/TargetSampleUIModel.java | 4 +-
100 files changed, 1867 insertions(+), 962 deletions(-)
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseAndCreateUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseAndCreateUIAction.java
index 96a3ce0..d2e1807 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseAndCreateUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseAndCreateUIAction.java
@@ -22,8 +22,6 @@
package fr.ird.observe.application.swing.ui.actions.shared;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
-import fr.ird.observe.services.dto.longline.ActivityLonglineDto;
-import fr.ird.observe.services.dto.seine.ActivitySeineDto;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.content.list.impl.longline.ActivityLonglinesUI;
@@ -32,6 +30,8 @@ import fr.ird.observe.application.swing.ui.content.open.ContentOpenableUI;
import fr.ird.observe.application.swing.ui.content.open.impl.longline.ActivityLonglineUI;
import fr.ird.observe.application.swing.ui.content.open.impl.seine.ActivitySeineUI;
import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper;
+import fr.ird.observe.services.dto.longline.ActivityLonglineDto;
+import fr.ird.observe.services.dto.seine.ActivitySeineDto;
import javax.swing.JComponent;
import javax.swing.JTree;
@@ -70,12 +70,10 @@ public class CloseAndCreateUIAction extends AbstractUIAction {
ContentUI<?> ui = (ContentUI<?>)
c.getClientProperty("ui");
if (ui == null) {
- throw new IllegalStateException(
- "could not find client property " +
- "ui on component" + c);
+ throw new IllegalStateException("could not find client property ui on component" + c);
}
if (ui instanceof ContentOpenableUI) {
- ((ContentOpenableUI<?>) ui).closeAndCreateData();
+ ((ContentOpenableUI<?, ?>) ui).closeAndCreateData();
return;
}
@@ -86,11 +84,7 @@ public class CloseAndCreateUIAction extends AbstractUIAction {
JTree tree = getMainUI().getNavigation();
ObserveTreeHelper treeHelper = getMainUI().getTreeHelper();
- boolean wasCollapsed = isOpenActivityNodeCollapsed(
- tree,
- treeHelper,
- getMainUI().getDataContext()
- );
+ boolean wasCollapsed = isOpenActivityNodeCollapsed(tree, treeHelper, getMainUI().getDataContext());
// selection du noeud de l'activity ouverte
treeHelper.selectOpenNode(ActivitySeineDto.class);
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseOpenUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseOpenUIAction.java
index 8e68887..79d443f 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseOpenUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/CloseOpenUIAction.java
@@ -22,22 +22,19 @@
package fr.ird.observe.application.swing.ui.actions.shared;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
-import fr.ird.observe.services.dto.longline.ActivityLonglineDto;
-import fr.ird.observe.services.dto.seine.ActivitySeineDto;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.content.list.impl.longline.ActivityLonglinesUI;
+import fr.ird.observe.application.swing.ui.content.list.impl.longline.TripLonglinesUI;
import fr.ird.observe.application.swing.ui.content.list.impl.seine.ActivitySeinesUI;
+import fr.ird.observe.application.swing.ui.content.list.impl.seine.RoutesUI;
+import fr.ird.observe.application.swing.ui.content.list.impl.seine.TripSeinesUI;
import fr.ird.observe.application.swing.ui.content.open.ContentOpenableUI;
-import fr.ird.observe.application.swing.ui.content.open.impl.longline.ActivityLonglineUI;
-import fr.ird.observe.application.swing.ui.content.open.impl.seine.ActivitySeineUI;
-import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper;
+import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import javax.swing.JComponent;
-import javax.swing.JTree;
import javax.swing.SwingUtilities;
-import javax.swing.tree.TreePath;
import java.awt.event.ActionEvent;
import static org.nuiton.i18n.I18n.n;
@@ -68,104 +65,144 @@ public class CloseOpenUIAction extends AbstractUIAction {
SwingUtilities.invokeLater(() -> {
JComponent c = (JComponent) e.getSource();
- ContentUI<?> ui = (ContentUI<?>)
- c.getClientProperty("ui");
+ ContentUI<?> ui = (ContentUI<?>) c.getClientProperty("ui");
if (ui == null) {
- throw new IllegalStateException(
- "could not find client property " +
- "ui on component" + c);
+ throw new IllegalStateException("could not find client property ui on component" + c);
}
if (ui instanceof ContentOpenableUI) {
- ((ContentOpenableUI<?>) ui).closeData();
+ ((ContentOpenableUI<?, ?>) ui).closeData();
return;
}
- if (ui instanceof ActivitySeinesUI) {
-
- // cas particulier pour l'écran des activités
-
- JTree tree = getMainUI().getNavigation();
- ObserveTreeHelper treeHelper = getMainUI().getTreeHelper();
-
- // recuperation du noeud courant (activitys)
- ObserveNode node = treeHelper.getSelectedNode();
-
- boolean wasCollapsed = isOpenActivityNodeCollapsed(
- tree,
- treeHelper,
- getMainUI().getDataContext()
- );
-
- // selection du noeud de l'activity ouverte
- treeHelper.selectOpenNode(ActivitySeineDto.class);
-
- // on conserve le path de l'activity
- TreePath path = tree.getSelectionPath();
-
- // recuperation de l'écran associé
- ActivitySeineUI selectedUI = (ActivitySeineUI)
- ObserveSwingApplicationContext.get().getContentUIManager().getSelectedContentUI();
-
- // fermeture de l'activity
- selectedUI.closeData();
-
- if (wasCollapsed) {
-
- // on ferme le noeud de l'activity (qui a ete ouvert
- // lors de la selection de celle-ci)
- tree.collapsePath(path);
- }
-
- // retour sur le noeud des activitys
- treeHelper.selectNode(node);
+ ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get();
+ if (ui instanceof TripSeinesUI) {
+ String higherOpenId = applicationContext.getDataContext().getOpenTripSeineId();
+ closeData(applicationContext, ui, higherOpenId);
+ return;
+ }
+ if (ui instanceof RoutesUI) {
+ String higherOpenId = applicationContext.getDataContext().getOpenRouteId();
+ closeData(applicationContext, ui, higherOpenId);
+ return;
+ }
+ if (ui instanceof ActivitySeinesUI) {
+ String higherOpenId = applicationContext.getDataContext().getOpenActivitySeineId();
+ closeData(applicationContext, ui, higherOpenId);
return;
}
+ if (ui instanceof TripLonglinesUI) {
+ String higherOpenId = applicationContext.getDataContext().getOpenTripLonglineId();
+ closeData(applicationContext, ui, higherOpenId);
+ return;
+ }
if (ui instanceof ActivityLonglinesUI) {
+ String higherOpenId = applicationContext.getDataContext().getOpenActivityLonglineId();
+ closeData(applicationContext, ui, higherOpenId);
+ return;
+ }
- // cas particulier pour l'écran des activités
-
- JTree tree = getMainUI().getNavigation();
- ObserveTreeHelper treeHelper = getMainUI().getTreeHelper();
+// if (ui instanceof ActivitySeinesUI) {
+//
+// // cas particulier pour l'écran des activités
+//
+// JTree tree = getMainUI().getNavigation();
+// ObserveTreeHelper treeHelper = getMainUI().getTreeHelper();
+//
+// // recuperation du noeud courant (activitys)
+// ObserveNode node = treeHelper.getSelectedNode();
+//
+// boolean wasCollapsed = isOpenActivityNodeCollapsed(tree, treeHelper, getMainUI().getDataContext());
+//
+// // selection du noeud de l'activity ouverte
+// treeHelper.selectOpenNode(ActivitySeineDto.class);
+//
+// // on conserve le path de l'activity
+// TreePath path = tree.getSelectionPath();
+//
+// // recuperation de l'écran associé
+// ActivitySeineUI selectedUI = (ActivitySeineUI)
+// applicationContext.getContentUIManager().getSelectedContentUI();
+//
+// // fermeture de l'activity
+// selectedUI.closeData();
+//
+// if (wasCollapsed) {
+//
+// // on ferme le noeud de l'activity (qui a ete ouvert
+// // lors de la selection de celle-ci)
+// tree.collapsePath(path);
+// }
+//
+// // retour sur le noeud des activitys
+// treeHelper.selectNode(node);
+//
+// return;
+// }
+//
+// if (ui instanceof ActivityLonglinesUI) {
+//
+// // cas particulier pour l'écran des activités
+//
+// JTree tree = getMainUI().getNavigation();
+// ObserveTreeHelper treeHelper = getMainUI().getTreeHelper();
+//
+// // recuperation du noeud courant (activitys)
+// ObserveNode node = treeHelper.getSelectedNode();
+//
+// boolean wasCollapsed = isOpenActivityNodeCollapsed(tree, treeHelper, getMainUI().getDataContext());
+//
+// // selection du noeud de l'activity ouverte
+// treeHelper.selectOpenNode(ActivityLonglineDto.class);
+//
+// // on conserve le path de l'activité
+// TreePath path = tree.getSelectionPath();
+//
+// // recuperation de l'écran associé
+// ActivityLonglineUI selectedUI = (ActivityLonglineUI)
+// applicationContext.getContentUIManager().getSelectedContentUI();
+//
+// // fermeture de l'activité
+// selectedUI.closeData();
+//
+// if (wasCollapsed) {
+//
+// // on ferme le noeud de l'activité (qui a ete ouvert lors de la selection de celle-ci)
+// tree.collapsePath(path);
+// }
+//
+// // retour sur le noeud des activités
+// treeHelper.selectNode(node);
+//
+// return;
+// }
- // recuperation du noeud courant (activitys)
- ObserveNode node = treeHelper.getSelectedNode();
+ throw new IllegalStateException("Can not come here!");
+ });
- boolean wasCollapsed = isOpenActivityNodeCollapsed(
- tree,
- treeHelper,
- getMainUI().getDataContext()
- );
+ }
- // selection du noeud de l'activity ouverte
- treeHelper.selectOpenNode(ActivityLonglineDto.class);
+ private void closeData(ObserveSwingApplicationContext applicationContext, ContentUI<?> ui, String id) {
- // on conserve le path de l'activity
- TreePath path = tree.getSelectionPath();
+ ObserveTreeHelper treeHelper = ui.getTreeHelper();
+ ObserveNode selectedNode = treeHelper.getSelectedNode();
- // recuperation de l'écran associé
- ActivityLonglineUI selectedUI = (ActivityLonglineUI)
- ObserveSwingApplicationContext.get().getContentUIManager().getSelectedContentUI();
+ ObserveNode node = treeHelper.findNode(selectedNode, id);
- // fermeture de l'activity
- selectedUI.closeData();
+ treeHelper.selectNode(node);
- if (wasCollapsed) {
+ ContentOpenableUI selectedUI = (ContentOpenableUI) applicationContext.getContentUIManager().getSelectedContentUI();
- // on ferme le noeud de l'activity (qui a ete ouvert
- // lors de la selection de celle-ci)
- tree.collapsePath(path);
- }
+ // on demande la fermeture de la donnée
+ selectedUI.closeData();
- // retour sur le noeud des activitys
- treeHelper.selectNode(node);
+ SwingUtilities.invokeLater(() -> {
- return;
- }
+ // retour sur le noeud parent
+ treeHelper.selectNode(selectedNode);
- throw new IllegalStateException("Can not come here!");
});
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ReOpenUIAction.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ReOpenUIAction.java
index a5935c8..7f5aa95 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ReOpenUIAction.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/ReOpenUIAction.java
@@ -22,13 +22,13 @@
package fr.ird.observe.application.swing.ui.actions.shared;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
-import fr.ird.observe.services.dto.DataReference;
import fr.ird.observe.application.swing.ui.ObserveMainUI;
import fr.ird.observe.application.swing.ui.content.ContentUI;
import fr.ird.observe.application.swing.ui.content.list.ContentListUI;
import fr.ird.observe.application.swing.ui.content.open.ContentOpenableUI;
-import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper;
+import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
+import fr.ird.observe.services.dto.DataReference;
import javax.swing.JComponent;
import javax.swing.SwingUtilities;
@@ -62,23 +62,20 @@ public class ReOpenUIAction extends AbstractUIAction {
public void actionPerformed(final ActionEvent e) {
SwingUtilities.invokeLater(() -> {
JComponent c = (JComponent) e.getSource();
- ContentUI<?> ui = (ContentUI<?>)
- c.getClientProperty("ui");
+ ContentUI<?> ui = (ContentUI<?>) c.getClientProperty("ui");
if (ui == null) {
- throw new IllegalStateException(
- "could not find client property ui " +
- "on component" + c);
+ throw new IllegalStateException("could not find client property ui on component" + c);
}
- ContentOpenableUI<?> openUI;
+ ContentOpenableUI<?, ?> openUI;
- if (ui instanceof ContentOpenableUI<?>) {
+ if (ui instanceof ContentOpenableUI<?, ?>) {
- openUI = (ContentOpenableUI<?>) ui;
- } else if (ui instanceof ContentListUI<?, ?>) {
+ openUI = (ContentOpenableUI<?, ?>) ui;
+ } else if (ui instanceof ContentListUI<?, ?, ?>) {
- DataReference<?> selectedData = ((ContentListUI<?, ?>) ui).getSelectedData();
+ DataReference<?> selectedData = ((ContentListUI<?, ?, ?>) ui).getSelectedData();
String id = selectedData.getId();
@@ -88,7 +85,7 @@ public class ReOpenUIAction extends AbstractUIAction {
treeHelper.selectNode(node);
- openUI = (ContentOpenableUI<?>)
+ openUI = (ContentOpenableUI<?, ?>)
ObserveSwingApplicationContext.get().getContentUIManager().getSelectedContentUI();
} else {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java
index c2cee31..3cc59b2 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java
@@ -434,6 +434,8 @@ public class ContentUIInitializer<E extends IdDto, UI extends ObserveContentUI<E
protected void init(FilterableDoubleList beanList) {
beanList.setI18nPrefix("observe.common.");
+ beanList.getAddButton().setFocusable(false);
+ beanList.getRemoveButton().setFocusable(false);
if (log.isInfoEnabled()) {
log.info("init list for " + beanList.getBeanType());
@@ -467,6 +469,7 @@ public class ContentUIInitializer<E extends IdDto, UI extends ObserveContentUI<E
log.debug("init date time editor " + editor.getName());
}
editor.init();
+ editor.getSliderHidor().setFocusable(false);
if (isAutoSelectOnFocus(editor)) {
addAutoSelectOnFocus((JSpinner.DateEditor) editor.getHourEditor().getEditor());
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineDetailCompositionUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineDetailCompositionUIHandler.java
index d4f6dfa..d7d03d7 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineDetailCompositionUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/LonglineDetailCompositionUIHandler.java
@@ -27,6 +27,12 @@ import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
import fr.ird.observe.application.swing.db.DataContext;
import fr.ird.observe.application.swing.db.ObserveSwingDataSource;
import fr.ird.observe.application.swing.db.constants.DataContextType;
+import fr.ird.observe.application.swing.ui.ObserveMainUI;
+import fr.ird.observe.application.swing.ui.UIHelper;
+import fr.ird.observe.application.swing.ui.content.ContentMode;
+import fr.ird.observe.application.swing.ui.content.ContentUIHandler;
+import fr.ird.observe.application.swing.ui.content.ContentUIModel;
+import fr.ird.observe.application.swing.ui.util.JVetoableTabbedPane;
import fr.ird.observe.services.dto.Form;
import fr.ird.observe.services.dto.longline.ActivityLonglineDto;
import fr.ird.observe.services.dto.longline.BasketDto;
@@ -39,12 +45,6 @@ import fr.ird.observe.services.dto.longline.SetLonglineDetailCompositionDto;
import fr.ird.observe.services.dto.longline.SetLonglineDetailCompositionHelper;
import fr.ird.observe.services.dto.result.SaveResultDto;
import fr.ird.observe.services.service.data.longline.SetLonglineDetailCompositionService;
-import fr.ird.observe.application.swing.ui.ObserveMainUI;
-import fr.ird.observe.application.swing.ui.UIHelper;
-import fr.ird.observe.application.swing.ui.content.ContentMode;
-import fr.ird.observe.application.swing.ui.content.ContentUIHandler;
-import fr.ird.observe.application.swing.ui.content.ContentUIModel;
-import fr.ird.observe.application.swing.ui.util.JVetoableTabbedPane;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -53,8 +53,11 @@ import org.nuiton.validator.NuitonValidatorScope;
import javax.swing.JComboBox;
import javax.swing.JOptionPane;
+import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.event.ChangeListener;
import javax.swing.event.TableModelListener;
+import java.awt.Component;
+import java.awt.Container;
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.LinkedHashSet;
@@ -329,6 +332,54 @@ public class LonglineDetailCompositionUIHandler extends ContentUIHandler<SetLong
tabPane.setChangeSelectedIndex(tabbedPaneWillChanged);
tabPane.addChangeListener(tabbedPaneChanged);
+ getUi().setFocusCycleRoot(true);
+ getUi().setFocusTraversalPolicy(new LayoutFocusTraversalPolicy() {
+
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ int selectedIndex = getUi().getFishingOperationTabPane().getSelectedIndex();
+ if (selectedIndex == 2) {
+ if (aComponent.equals(getUi().getBranchlineDetailUI().getTopType().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ if (aComponent.equals(getUi().getBranchlineDetailUI().getHookType().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ int selectedIndex = getUi().getFishingOperationTabPane().getSelectedIndex();
+ if (selectedIndex == 2) {
+ int subSelectedIndex = getUi().getBranchlineDetailUI().getFishingOperationTabPane().getSelectedIndex();
+ switch (subSelectedIndex) {
+ case 0:
+ return getUi().getBranchlineDetailUI().getTopType();
+ case 1:
+ return getUi().getBranchlineDetailUI().getHookType();
+ }
+ }
+ return super.getFirstComponent(aContainer);
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+
+ if (getUi().getSave().isEnabled()) {
+ return getUi().getSave();
+ }
+ if (getUi().getReset().isEnabled()) {
+ return getUi().getReset();
+ }
+ int selectedIndex = getUi().getFishingOperationTabPane().getSelectedIndex();
+ if (selectedIndex == 2) {
+ getUi().getBranchlineDetailUI().getComment2();
+ }
+ return super.getLastComponent(aContainer);
+ }
+ });
}
@Override
@@ -564,8 +615,8 @@ public class LonglineDetailCompositionUIHandler extends ContentUIHandler<SetLong
sectionsTableModel.setData(sections);
List<SectionDto> sectionHelper = sections.stream()
- .map(SectionWithTemplate::getDelegate)
- .collect(Collectors.toList());
+ .map(SectionWithTemplate::getDelegate)
+ .collect(Collectors.toList());
getBean().addAllSection(sectionHelper);
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/SetLonglineUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/SetLonglineUIHandler.java
index 71569ed..02c0a18 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/SetLonglineUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/longline/SetLonglineUIHandler.java
@@ -49,7 +49,10 @@ import org.nuiton.jaxx.widgets.gis.CoordinateFormat;
import org.nuiton.jaxx.widgets.gis.absolute.CoordinatesEditorModel;
import org.nuiton.validator.NuitonValidatorScope;
+import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.event.TableModelListener;
+import java.awt.Component;
+import java.awt.Container;
import java.beans.PropertyChangeListener;
import java.util.HashSet;
import java.util.Set;
@@ -152,6 +155,42 @@ public class SetLonglineUIHandler extends ContentUIHandler<SetLonglineDto> {
getUi().getHaulingStartCoordinates().getModel().addPropertyChangeListener(CoordinatesEditorModel.PROPERTY_FORMAT, onCoordinateFormatChangedListener);
getUi().getHaulingEndCoordinates().getModel().addPropertyChangeListener(CoordinatesEditorModel.PROPERTY_FORMAT, onCoordinateFormatChangedListener);
+ getUi().setFocusCycleRoot(true);
+ getUi().setFocusTraversalPolicy(new LayoutFocusTraversalPolicy() {
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ int selectedIndex = getUi().getFishingOperationTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ return getUi().getHomeId();
+ case 1:
+ return getUi().getSettingShape();
+ case 2:
+ return getUi().getHaulingDirectionSameAsSetting();
+ }
+ return super.getFirstComponent(aContainer);
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ return getUi().getDelete();
+ }
+
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ if (aComponent.equals(getUi().getHomeId())) {
+ return getLastComponent(aContainer);
+ }
+ if (aComponent.equals(getUi().getHaulingDirectionSameAsSetting())) {
+ return getLastComponent(aContainer);
+ }
+ if (aComponent.equals(getUi().getSettingShape().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+ });
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectTransmittingBuoyOperationUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectTransmittingBuoyOperationUIHandler.java
index ad7d3b8..8e4a2c3 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectTransmittingBuoyOperationUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectTransmittingBuoyOperationUIHandler.java
@@ -47,7 +47,10 @@ import org.apache.commons.logging.LogFactory;
import org.nuiton.validator.NuitonValidatorScope;
import javax.swing.JPanel;
+import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.SwingUtilities;
+import java.awt.Component;
+import java.awt.Container;
import java.awt.GridLayout;
import java.util.ArrayList;
import java.util.Collection;
@@ -102,6 +105,41 @@ public class FloatingObjectTransmittingBuoyOperationUIHandler extends ContentUIH
}
@Override
+ public void initUI() {
+ super.initUI();
+
+ FloatingObjectTransmittingBuoyOperationUI ui = getUi();
+
+ ui.setFocusCycleRoot(true);
+ ui.setFocusTraversalPolicy(new LayoutFocusTraversalPolicy() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+
+ if (aComponent.equals(ui.getTypeOperation())) {
+ return getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ return ui.getTypeOperation();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ if (ui.getSave().isEnabled()) {
+ return ui.getSave();
+ }
+ if (ui.getReset().isEnabled()) {
+ return ui.getReset();
+ }
+ return ui.getComment2();
+ }
+ });
+ }
+
+ @Override
public void openUI() {
super.openUI();
@@ -170,7 +208,7 @@ public class FloatingObjectTransmittingBuoyOperationUIHandler extends ContentUIH
FloatingObjectTransmittingBuoyOperationUI.BINDING_COUNTRY1_SELECTED_ITEM,
FloatingObjectTransmittingBuoyOperationUI.BINDING_COUNTRY2_SELECTED_ITEM,
FloatingObjectTransmittingBuoyOperationUI.BINDING_TYPE_OPERATION_SELECTED_ITEM
- );
+ );
FloatingObjectTransmittingBuoyOperationUI ui = getUi();
@@ -332,7 +370,7 @@ public class FloatingObjectTransmittingBuoyOperationUIHandler extends ContentUIH
if (log.isDebugEnabled()) {
log.debug("Reuse an empty balise lue for objectOperation " +
- transmittingBuoyOperation.getPropertyValue(TransmittingBuoyOperationDto.PROPERTY_LABEL1));
+ transmittingBuoyOperation.getPropertyValue(TransmittingBuoyOperationDto.PROPERTY_LABEL1));
}
if (isBalisePose(transmittingBuoyOperation)) {
@@ -357,7 +395,7 @@ public class FloatingObjectTransmittingBuoyOperationUIHandler extends ContentUIH
}
protected ReferentialReference<TransmittingBuoyOperationDto> getObjectOperation(List<ReferentialReference<TransmittingBuoyOperationDto>> objectOperations,
- String codeOperation) {
+ String codeOperation) {
ReferentialReference<TransmittingBuoyOperationDto> objectOperation = null;
for (ReferentialReference<TransmittingBuoyOperationDto> op : objectOperations) {
if (codeOperation.equals(op.getPropertyValue(TransmittingBuoyOperationDto.PROPERTY_CODE))) {
@@ -368,13 +406,13 @@ public class FloatingObjectTransmittingBuoyOperationUIHandler extends ContentUIH
if (objectOperation == null) {
throw new IllegalArgumentException(
"could not find a " +
- TransmittingBuoyOperationDto.class + " with code " + codeOperation);
+ TransmittingBuoyOperationDto.class + " with code " + codeOperation);
}
return objectOperation;
}
protected TransmittingBuoyOperationService getTransmittingBuoyOperationService() {
- return ObserveSwingApplicationContext.get().getMainDataSourceServicesProvider().newTransmittingBuoyOperationService();
+ return ObserveSwingApplicationContext.get().getMainDataSourceServicesProvider().newTransmittingBuoyOperationService();
}
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectUIHandler.java
index b219958..582a5b4 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/FloatingObjectUIHandler.java
@@ -25,6 +25,11 @@ import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
import fr.ird.observe.application.swing.db.DataContext;
import fr.ird.observe.application.swing.db.ObserveSwingDataSource;
import fr.ird.observe.application.swing.db.constants.DataContextType;
+import fr.ird.observe.application.swing.ui.content.ContentMode;
+import fr.ird.observe.application.swing.ui.content.ContentUIHandler;
+import fr.ird.observe.application.swing.ui.content.ContentUIModel;
+import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper;
+import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import fr.ird.observe.services.dto.DataReference;
import fr.ird.observe.services.dto.Form;
import fr.ird.observe.services.dto.result.SaveResultDto;
@@ -32,15 +37,14 @@ import fr.ird.observe.services.dto.seine.ActivitySeineDto;
import fr.ird.observe.services.dto.seine.FloatingObjectDto;
import fr.ird.observe.services.dto.seine.FloatingObjectHelper;
import fr.ird.observe.services.service.data.seine.FloatingObjectService;
-import fr.ird.observe.application.swing.ui.content.ContentMode;
-import fr.ird.observe.application.swing.ui.content.ContentUIHandler;
-import fr.ird.observe.application.swing.ui.content.ContentUIModel;
-import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
-import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.validator.NuitonValidatorScope;
+import javax.swing.LayoutFocusTraversalPolicy;
+import java.awt.Component;
+import java.awt.Container;
+
import static org.nuiton.i18n.I18n.t;
/**
@@ -96,6 +100,40 @@ public class FloatingObjectUIHandler extends ContentUIHandler<FloatingObjectDto>
}
@Override
+ public void initUI() {
+ super.initUI();
+
+ FloatingObjectUI ui = getUi();
+
+ ui.setFocusCycleRoot(true);
+ ui.setFocusTraversalPolicy(new LayoutFocusTraversalPolicy() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ if (aComponent.equals(ui.getObjectOperation().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ return ui.getObjectOperation();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ if (ui.getDelete().isVisible() && ui.getDelete().isEnabled()) {
+ return ui.getDelete();
+ }
+ if (ui.getSave().isEnabled()) {
+ return ui.getSave();
+ }
+ return ui.getReset();
+ }
+ });
+ }
+
+ @Override
public void openUI() {
super.openUI();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/SetSeineUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/SetSeineUIHandler.java
index 4a1e41c..3b2a5a6 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/SetSeineUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/impl/seine/SetSeineUIHandler.java
@@ -21,6 +21,7 @@
*/
package fr.ird.observe.application.swing.ui.content.impl.seine;
+import fr.ird.observe.application.swing.I18nEnumHelper;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
import fr.ird.observe.application.swing.db.DataContext;
import fr.ird.observe.application.swing.db.ObserveSwingDataSource;
@@ -28,9 +29,8 @@ import fr.ird.observe.application.swing.db.constants.DataContextType;
import fr.ird.observe.application.swing.ui.content.ContentMode;
import fr.ird.observe.application.swing.ui.content.ContentUIHandler;
import fr.ird.observe.application.swing.ui.content.ContentUIModel;
-import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper;
-import fr.ird.observe.application.swing.I18nEnumHelper;
+import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import fr.ird.observe.services.dto.DataReference;
import fr.ird.observe.services.dto.Form;
import fr.ird.observe.services.dto.constants.seine.SchoolType;
@@ -50,7 +50,12 @@ import org.apache.commons.logging.LogFactory;
import org.nuiton.util.DateUtil;
import org.nuiton.validator.NuitonValidatorScope;
+import javax.swing.JComponent;
+import javax.swing.JSpinner;
+import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.event.TableModelListener;
+import java.awt.Component;
+import java.awt.Container;
import java.beans.PropertyChangeListener;
import java.util.Date;
import java.util.HashSet;
@@ -136,15 +141,59 @@ public class SetSeineUIHandler extends ContentUIHandler<SetSeineDto> {
super.initUI();
+ SetSeineUI ui = getUi();
+
// To be sure always remove listener (could prevent some leaks)
- getUi().getErrorTableModel().removeTableModelListener(computeTabValidStateListener);
+ ui.getErrorTableModel().removeTableModelListener(computeTabValidStateListener);
// listen messages to see if required to add
- getUi().getErrorTableModel().addTableModelListener(computeTabValidStateListener);
+ ui.getErrorTableModel().addTableModelListener(computeTabValidStateListener);
+
+ ui.getStartTime().getSliderHidor().addPropertyChangeListener(HidorButton.PROPERTY_TARGET_VISIBLE, onToogleTimeEditorSliderChangedListener);
+ ui.getEndPursingTimeStamp().getSliderHidor().addPropertyChangeListener(HidorButton.PROPERTY_TARGET_VISIBLE, onToogleTimeEditorSliderChangedListener);
+ ui.getEndSetTimeStamp().getSliderHidor().addPropertyChangeListener(HidorButton.PROPERTY_TARGET_VISIBLE, onToogleTimeEditorSliderChangedListener);
+
+ ui.setFocusCycleRoot(true);
+ ui.setFocusTraversalPolicy(new LayoutFocusTraversalPolicy() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ if (aComponent.getParent().equals(ui.getStartTime().getHourEditor().getEditor())) {
+ return getLastComponent(aContainer);
+ }
+ case 1:
+ if (aComponent.equals(ui.getSchoolThickness().getTextField())) {
+ return getLastComponent(aContainer);
+ }
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
- getUi().getStartTime().getSliderHidor().addPropertyChangeListener(HidorButton.PROPERTY_TARGET_VISIBLE, onToogleTimeEditorSliderChangedListener);
- getUi().getEndPursingTimeStamp().getSliderHidor().addPropertyChangeListener(HidorButton.PROPERTY_TARGET_VISIBLE, onToogleTimeEditorSliderChangedListener);
- getUi().getEndSetTimeStamp().getSliderHidor().addPropertyChangeListener(HidorButton.PROPERTY_TARGET_VISIBLE, onToogleTimeEditorSliderChangedListener);
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ JComponent editor = ui.getStartTime().getHourEditor().getEditor();
+ return ((JSpinner.DateEditor) editor).getTextField();
+ case 1:
+ return ui.getSchoolThickness();
+ }
+ return super.getFirstComponent(aContainer);
+ }
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ if (ui.getDelete().isVisible() && ui.getDelete().isEnabled()) {
+ return ui.getDelete();
+ }
+ if (ui.getSave().isEnabled()) {
+ return ui.getSave();
+ }
+ return ui.getReset();
+ }
+ });
}
@Override
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUI.jaxx
index e2bd28b..b40b058 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUI.jaxx
@@ -21,11 +21,11 @@
-->
<fr.ird.observe.application.swing.ui.content.ContentUI
- abstract='true'
- superGenericType='E'
- genericType='E extends IdDto, C extends DataDto'>
+ abstract='true' superGenericType='E'
+ genericType='E extends IdDto, C extends DataDto, U extends ContentListUI<E,C, U>'>
<import>
+ fr.ird.observe.application.swing.ui.actions.shared.CloseOpenUIAction
fr.ird.observe.application.swing.ui.actions.shared.ReOpenUIAction
fr.ird.observe.application.swing.ui.actions.shared.SelectNodeUIAction
@@ -50,11 +50,10 @@
<ContentListUIModel id='model' genericType='E, C'/>
- <ListSelectionModel id='listSelectionModel'
- initializer='new DefaultListSelectionModel()'
+ <ListSelectionModel id='listSelectionModel' initializer='new DefaultListSelectionModel()'
onValueChanged='if (!event.getValueIsAdjusting()) getModel().setSelectedDatas(getSelectedDatas());'/>
- <ContentListUIHandler id='handler' genericType='E, C'/>
+ <ContentListUIHandler id='handler' genericType='E, C, U'/>
<script><![CDATA[
@@ -70,13 +69,12 @@ public final List<DataReference<C>> getSelectedDatas() {
<JPanel id='body'>
- <JScrollPane id='listPane' constraints='BorderLayout.CENTER'
- onFocusGained='list.requestFocus()'
+ <JScrollPane id='listPane' constraints='BorderLayout.CENTER' onFocusGained='list.requestFocus()'
columnHeaderView='{listHeader}'>
<JList id='list' onMouseClicked='getHandler().onDataSelected(event)'/>
- <BeanListHeader id='listHeader' genericType='DataReference< C >' _entityClass="getModel().getChildType()"/>
+ <BeanListHeader id='listHeader' genericType='DataReference< C >'/>
</JScrollPane>
@@ -93,6 +91,11 @@ public final List<DataReference<C>> getSelectedDatas() {
<JButton id='reopenChild'/>
</cell>
</row>
+ <row>
+ <cell fill='both' columns="3">
+ <JButton id='closeChild'/>
+ </cell>
+ </row>
<row weighty="1" weightx="1" fill="both">
<cell>
<JButton id='gotoOpenChild'/>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUI.jcss b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUI.jcss
index ab4721e..1ea4dae 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUI.jcss
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUI.jcss
@@ -32,6 +32,7 @@
_listNoLoad: true;
beanType:{(Class)DataReference.class};
_doInit:{getModel().getChildType()};
+ _entityClass:{getModel().getChildType()};
showReset:true;
list:{list};
data:{getHandler().updateList(listHeader, model.getData())};
@@ -60,6 +61,12 @@
_observeAction:{ReOpenUIAction.ACTION_NAME};
}
+#closeChild {
+ visible:{!model.isEmpty() && !model.isCanReopen()};
+ enabled:{getHandler().isCanCloseChild()};
+ _observeAction:{CloseOpenUIAction.ACTION_NAME};
+}
+
#createChild {
actionIcon:"add";
visible:{model.isCreatingMode()};
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUIHandler.java
index 9aca004..a2efb7f 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/ContentListUIHandler.java
@@ -23,7 +23,6 @@ package fr.ird.observe.application.swing.ui.content.list;
import fr.ird.observe.application.swing.db.ObserveSwingDataSource;
import fr.ird.observe.application.swing.db.constants.DataContextType;
-import fr.ird.observe.application.swing.ui.UIHelper;
import fr.ird.observe.application.swing.ui.actions.shared.SelectNodeUIAction;
import fr.ird.observe.application.swing.ui.content.ContentMode;
import fr.ird.observe.application.swing.ui.content.ContentUIHandler;
@@ -41,14 +40,20 @@ import org.apache.commons.logging.LogFactory;
import javax.swing.DefaultListCellRenderer;
import javax.swing.Icon;
import javax.swing.JButton;
+import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JList;
+import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.ListCellRenderer;
import javax.swing.SwingUtilities;
import java.awt.Color;
import java.awt.Component;
+import java.awt.Container;
import java.awt.event.MouseEvent;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
+import java.util.Optional;
import static org.nuiton.i18n.I18n.t;
@@ -56,12 +61,12 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.5
*/
-public abstract class ContentListUIHandler<E extends IdDto, C extends DataDto> extends ContentUIHandler<E> {
+public abstract class ContentListUIHandler<E extends IdDto, C extends DataDto, U extends ContentListUI<E, C, U>> extends ContentUIHandler<E> {
/** Logger */
private static final Log log = LogFactory.getLog(ContentListUIHandler.class);
- public ContentListUIHandler(ContentListUI<E, C> ui,
+ public ContentListUIHandler(U ui,
DataContextType parentType,
DataContextType type) {
super(ui, parentType, type);
@@ -76,14 +81,16 @@ public abstract class ContentListUIHandler<E extends IdDto, C extends DataDto> e
*/
protected abstract List<DataReference<C>> getChilds(String parentId);
+ public abstract boolean isCanCloseChild();
+
@Override
protected boolean computeCanWrite(ObserveSwingDataSource source) {
return source.canWriteData();
}
@Override
- public ContentListUI<E, C> getUi() {
- return (ContentListUI<E, C>) super.getUi();
+ public U getUi() {
+ return (U) super.getUi();
}
@Override
@@ -103,6 +110,53 @@ public abstract class ContentListUIHandler<E extends IdDto, C extends DataDto> e
ListCellRenderer renderer2 = new EntityListCellRenderer(renderer, treeHelper);
getUi().getList().setCellRenderer(renderer2);
+ getUi().setFocusCycleRoot(true);
+ getUi().setFocusTraversalPolicy(new LayoutFocusTraversalPolicy() {
+
+ private List<JComponent> actions;
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ return getUi().getList();
+ }
+
+ public List<JComponent> getActions() {
+ if (actions == null) {
+
+ actions = new ArrayList<>();
+ actions.add(getUi().getGotoSelectedChild());
+ actions.add(getUi().getReopenChild());
+ actions.add(getUi().getCloseChild());
+ actions.add(getUi().getGotoOpenChild());
+ actions.add(getUi().getGotoOpenChild2());
+ actions.add(getUi().getCreateChild());
+ for (Component component : getUi().getExtraActions().getComponents()) {
+ if (component instanceof JButton) {
+ actions.add((JComponent) component);
+ }
+ }
+ actions.add(getUi().getMoveSelectedChildren());
+
+ }
+ List<JComponent> result = new ArrayList<>(actions);
+ Collections.reverse(result);
+ return result;
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ Optional<JComponent> optional = getActions().stream().filter(a -> a.isEnabled() && a.isVisible()).findFirst();
+ return optional.isPresent() ? optional.get() : super.getLastComponent(aContainer);
+ }
+
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ if (aComponent.equals(getUi().getList())) {
+ return getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+ });
}
@Override
@@ -162,6 +216,7 @@ public abstract class ContentListUIHandler<E extends IdDto, C extends DataDto> e
// getUi().getGotoOpenChild().setEnabled(false);
});
+ getUi().getCloseChild().setEnabled(isCanCloseChild());
// finalize openUI with specified code
finalizeOpenUI();
}
@@ -216,6 +271,7 @@ public abstract class ContentListUIHandler<E extends IdDto, C extends DataDto> e
// rien par default
}
+
/**
* Un renderer de liste d'entité qui reprendre la cosmétique de l'arbre
* de navigation.
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/ActivityLonglinesUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/ActivityLonglinesUI.jaxx
index 2a09f19..89140dc 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/ActivityLonglinesUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/ActivityLonglinesUI.jaxx
@@ -20,9 +20,10 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.list.ContentListUI superGenericType='TripLonglineDto, ActivityLonglineDto'
- contentTitle='{n("observe.storage.activityLonglines.title")}' listText='{n("observe.common.activities.list")}'
- emptyListMessage='{n("observe.message.no.activity.for.trip")}'>
+<fr.ird.observe.application.swing.ui.content.list.ContentListUI
+ superGenericType='TripLonglineDto, ActivityLonglineDto, ActivityLonglinesUI'
+ contentTitle='{n("observe.storage.activityLonglines.title")}' listText='{n("observe.common.activities.list")}'
+ emptyListMessage='{n("observe.message.no.activity.for.trip")}'>
<import>
fr.ird.observe.services.dto.longline.ActivityLonglineDto
@@ -49,6 +50,7 @@
<!-- override generic actions -->
<JButton id='gotoSelectedChild'/>
<JButton id='reopenChild'/>
+ <JButton id='closeChild'/>
<JButton id='gotoOpenChild' styleClass='gotoOpenActivity'/>
<JButton id='gotoOpenChild2' styleClass='gotoOpenActivity2'/>
<JButton id='createChild'/>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/ActivityLonglinesUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/ActivityLonglinesUIHandler.java
index 650c3e5..799d23a 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/ActivityLonglinesUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/ActivityLonglinesUIHandler.java
@@ -25,13 +25,13 @@ package fr.ird.observe.application.swing.ui.content.list.impl.longline;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
import fr.ird.observe.application.swing.db.DataContext;
import fr.ird.observe.application.swing.db.constants.DataContextType;
+import fr.ird.observe.application.swing.ui.content.ContentMode;
+import fr.ird.observe.application.swing.ui.content.list.ContentListUIHandler;
import fr.ird.observe.services.dto.DataReference;
import fr.ird.observe.services.dto.DataReferenceSet;
import fr.ird.observe.services.dto.longline.ActivityLonglineDto;
import fr.ird.observe.services.dto.longline.TripLonglineDto;
import fr.ird.observe.services.service.data.longline.ActivityLonglineService;
-import fr.ird.observe.application.swing.ui.content.ContentMode;
-import fr.ird.observe.application.swing.ui.content.list.ContentListUIHandler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -46,7 +46,7 @@ import static org.nuiton.i18n.I18n.n;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.7
*/
-public class ActivityLonglinesUIHandler extends ContentListUIHandler<TripLonglineDto, ActivityLonglineDto> {
+public class ActivityLonglinesUIHandler extends ContentListUIHandler<TripLonglineDto, ActivityLonglineDto, ActivityLonglinesUI> {
/** Logger */
private static final Log log = LogFactory.getLog(ActivityLonglinesUIHandler.class);
@@ -56,6 +56,11 @@ public class ActivityLonglinesUIHandler extends ContentListUIHandler<TripLonglin
}
@Override
+ public boolean isCanCloseChild() {
+ return true;
+ }
+
+ @Override
protected ContentMode getContentMode(DataContext dataContext) {
String openTripLonglineId = dataContext.getOpenTripId();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/TripLonglinesUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/TripLonglinesUI.jaxx
index 82a5eb8..4bfe978 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/TripLonglinesUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/TripLonglinesUI.jaxx
@@ -19,9 +19,9 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.list.ContentListUI superGenericType='ProgramDto, TripLonglineDto'
- listText='{n("observe.common.trips.list")}'
- emptyListMessage='{n("observe.message.no.trip.for.program")}'>
+<fr.ird.observe.application.swing.ui.content.list.ContentListUI
+ superGenericType='ProgramDto, TripLonglineDto, TripLonglinesUI'
+ listText='{n("observe.common.trips.list")}' emptyListMessage='{n("observe.message.no.trip.for.program")}'>
<import>
fr.ird.observe.services.dto.longline.ActivityLonglineDto
@@ -47,6 +47,7 @@
<!-- override generic actions -->
<JButton id='gotoSelectedChild'/>
<JButton id='reopenChild'/>
+ <JButton id='closeChild'/>
<JButton id='gotoOpenChild' styleClass='gotoOpenTrip'/>
<JButton id='gotoOpenChild2' styleClass='gotoOpenTrip2'/>
<JButton id='createChild'/>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/TripLonglinesUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/TripLonglinesUIHandler.java
index f3899d5..e9472b8 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/TripLonglinesUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/longline/TripLonglinesUIHandler.java
@@ -25,14 +25,14 @@ package fr.ird.observe.application.swing.ui.content.list.impl.longline;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
import fr.ird.observe.application.swing.db.DataContext;
import fr.ird.observe.application.swing.db.constants.DataContextType;
+import fr.ird.observe.application.swing.ui.content.ContentMode;
+import fr.ird.observe.application.swing.ui.content.list.ContentListUIHandler;
import fr.ird.observe.services.dto.DataReference;
import fr.ird.observe.services.dto.DataReferenceSet;
import fr.ird.observe.services.dto.longline.TripLonglineDto;
import fr.ird.observe.services.dto.referential.ProgramDto;
import fr.ird.observe.services.dto.referential.ReferentialReference;
import fr.ird.observe.services.service.data.longline.TripLonglineService;
-import fr.ird.observe.application.swing.ui.content.ContentMode;
-import fr.ird.observe.application.swing.ui.content.list.ContentListUIHandler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -47,7 +47,7 @@ import static org.nuiton.i18n.I18n.n;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.7
*/
-public class TripLonglinesUIHandler extends ContentListUIHandler<ProgramDto, TripLonglineDto> {
+public class TripLonglinesUIHandler extends ContentListUIHandler<ProgramDto, TripLonglineDto, TripLonglinesUI> {
/** Logger */
static private final Log log = LogFactory.getLog(TripLonglinesUIHandler.class);
@@ -89,6 +89,11 @@ public class TripLonglinesUIHandler extends ContentListUIHandler<ProgramDto, Tri
}
@Override
+ public boolean isCanCloseChild() {
+ return !getModel().isCanReopen() && !ObserveSwingApplicationContext.get().getDataContext().isOpenActivityLongline();
+ }
+
+ @Override
protected void finalizeOpenUI() {
Class referenceType = ProgramDto.class;
ReferentialReference<ProgramDto> programRef = getDataSource().getReferentialReference(referenceType, getSelectedParentId());
@@ -100,7 +105,7 @@ public class TripLonglinesUIHandler extends ContentListUIHandler<ProgramDto, Tri
protected List<DataReference<TripLonglineDto>> getChilds(String parentId) {
TripLonglineService service = ObserveSwingApplicationContext.get().getMainDataSourceServicesProvider().newTripLonglineService();
- DataReferenceSet<TripLonglineDto> tripLonglineByProgram = service.getTripLonglineByProgram( parentId);
+ DataReferenceSet<TripLonglineDto> tripLonglineByProgram = service.getTripLonglineByProgram(parentId);
if (log.isDebugEnabled()) {
log.debug("Will use " + tripLonglineByProgram.sizeReference() + " trips.");
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/ActivitySeinesUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/ActivitySeinesUI.jaxx
index 5d67433..0a453d7 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/ActivitySeinesUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/ActivitySeinesUI.jaxx
@@ -20,9 +20,10 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.list.ContentListUI superGenericType='RouteDto, ActivitySeineDto'
- contentTitle='{n("observe.storage.activitySeines.title")}' listText='{n("observe.common.activities.list")}'
- emptyListMessage='{n("observe.message.no.activity.for.route")}'>
+<fr.ird.observe.application.swing.ui.content.list.ContentListUI
+ superGenericType='RouteDto, ActivitySeineDto, ActivitySeinesUI'
+ contentTitle='{n("observe.storage.activitySeines.title")}' listText='{n("observe.common.activities.list")}'
+ emptyListMessage='{n("observe.message.no.activity.for.route")}'>
<import>
fr.ird.observe.services.dto.seine.ActivitySeineDto
@@ -49,6 +50,7 @@
<!-- override generic actions -->
<JButton id='gotoSelectedChild'/>
<JButton id='reopenChild'/>
+ <JButton id='closeChild'/>
<JButton id='gotoOpenChild' styleClass='gotoOpenActivity'/>
<JButton id='gotoOpenChild2' styleClass='gotoOpenActivity2'/>
<JButton id='createChild'/>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/ActivitySeinesUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/ActivitySeinesUIHandler.java
index e20e302..8e13d88 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/ActivitySeinesUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/ActivitySeinesUIHandler.java
@@ -24,6 +24,7 @@ package fr.ird.observe.application.swing.ui.content.list.impl.seine;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
import fr.ird.observe.application.swing.db.DataContext;
import fr.ird.observe.application.swing.db.constants.DataContextType;
+import fr.ird.observe.application.swing.ui.content.open.impl.seine.ActivitySeineUI;
import fr.ird.observe.services.dto.DataReference;
import fr.ird.observe.services.dto.DataReferenceSet;
import fr.ird.observe.services.dto.seine.ActivitySeineDto;
@@ -43,7 +44,7 @@ import static org.nuiton.i18n.I18n.n;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.0
*/
-public class ActivitySeinesUIHandler extends ContentListUIHandler<RouteDto, ActivitySeineDto> {
+public class ActivitySeinesUIHandler extends ContentListUIHandler<RouteDto, ActivitySeineDto, ActivitySeinesUI> {
/** Logger */
private static final Log log = LogFactory.getLog(ActivitySeinesUIHandler.class);
@@ -53,6 +54,11 @@ public class ActivitySeinesUIHandler extends ContentListUIHandler<RouteDto, Acti
}
@Override
+ public boolean isCanCloseChild() {
+ return true;
+ }
+
+ @Override
protected ContentMode getContentMode(DataContext dataContext) {
String openRouteId = dataContext.getOpenRouteId();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/RoutesUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/RoutesUI.jaxx
index f722954..bdc29a5 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/RoutesUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/RoutesUI.jaxx
@@ -20,9 +20,10 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.list.ContentListUI superGenericType='TripSeineDto, RouteDto'
- contentTitle='{n("observe.content.routes.title")}' listText='{n("observe.common.routes.list")}'
- emptyListMessage='{n("observe.message.no.route.for.maree")}'>
+<fr.ird.observe.application.swing.ui.content.list.ContentListUI superGenericType='TripSeineDto, RouteDto, RoutesUI'
+ contentTitle='{n("observe.content.routes.title")}'
+ listText='{n("observe.common.routes.list")}'
+ emptyListMessage='{n("observe.message.no.route.for.maree")}'>
<import>
fr.ird.observe.services.dto.seine.ActivitySeineDto
@@ -48,6 +49,7 @@
<!-- override generic actions -->
<JButton id='gotoSelectedChild'/>
<JButton id='reopenChild'/>
+ <JButton id='closeChild'/>
<JButton id='gotoOpenChild' styleClass='gotoOpenRoute'/>
<JButton id='gotoOpenChild2' styleClass='gotoOpenRoute2'/>
<JButton id='createChild'/>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/RoutesUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/RoutesUIHandler.java
index f17564b..ce25730 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/RoutesUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/RoutesUIHandler.java
@@ -43,7 +43,7 @@ import static org.nuiton.i18n.I18n.n;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.0
*/
-public class RoutesUIHandler extends ContentListUIHandler<TripSeineDto, RouteDto> {
+public class RoutesUIHandler extends ContentListUIHandler<TripSeineDto, RouteDto, RoutesUI> {
/** Logger */
private static final Log log = LogFactory.getLog(RoutesUIHandler.class);
@@ -52,6 +52,12 @@ public class RoutesUIHandler extends ContentListUIHandler<TripSeineDto, RouteDto
super(ui, DataContextType.TripSeine, DataContextType.Route);
}
+
+ @Override
+ public boolean isCanCloseChild() {
+ return !getModel().isCanReopen() && !ObserveSwingApplicationContext.get().getDataContext().isOpenActivitySeine();
+ }
+
@Override
protected ContentMode getContentMode(DataContext dataContext) {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/TripSeinesUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/TripSeinesUI.jaxx
index bb84e3c..4701fef 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/TripSeinesUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/TripSeinesUI.jaxx
@@ -19,10 +19,9 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<fr.ird.observe.application.swing.ui.content.list.ContentListUI
- superGenericType='ProgramDto, TripSeineDto'
- listText='{n("observe.common.trips.list")}'
- emptyListMessage='{n("observe.message.no.trip.for.program")}'>
+<fr.ird.observe.application.swing.ui.content.list.ContentListUI listText='{n("observe.common.trips.list")}'
+ superGenericType='ProgramDto, TripSeineDto, TripSeinesUI'
+ emptyListMessage='{n("observe.message.no.trip.for.program")}'>
<import>
fr.ird.observe.services.dto.seine.ActivitySeineDto
@@ -49,6 +48,7 @@
<!-- override generic actions -->
<JButton id='gotoSelectedChild'/>
<JButton id='reopenChild'/>
+ <JButton id='closeChild'/>
<JButton id='gotoOpenChild' styleClass='gotoOpenTrip'/>
<JButton id='gotoOpenChild2' styleClass='gotoOpenTrip2'/>
<JButton id='createChild'/>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/TripSeinesUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/TripSeinesUIHandler.java
index 044424b..0840ef3 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/TripSeinesUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/list/impl/seine/TripSeinesUIHandler.java
@@ -24,14 +24,14 @@ package fr.ird.observe.application.swing.ui.content.list.impl.seine;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
import fr.ird.observe.application.swing.db.DataContext;
import fr.ird.observe.application.swing.db.constants.DataContextType;
+import fr.ird.observe.application.swing.ui.content.ContentMode;
+import fr.ird.observe.application.swing.ui.content.list.ContentListUIHandler;
import fr.ird.observe.services.dto.DataReference;
import fr.ird.observe.services.dto.DataReferenceSet;
import fr.ird.observe.services.dto.referential.ProgramDto;
import fr.ird.observe.services.dto.referential.ReferentialReference;
import fr.ird.observe.services.dto.seine.TripSeineDto;
import fr.ird.observe.services.service.data.seine.TripSeineService;
-import fr.ird.observe.application.swing.ui.content.ContentMode;
-import fr.ird.observe.application.swing.ui.content.list.ContentListUIHandler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -44,7 +44,7 @@ import static org.nuiton.i18n.I18n.n;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.0
*/
-public class TripSeinesUIHandler extends ContentListUIHandler<ProgramDto, TripSeineDto> {
+public class TripSeinesUIHandler extends ContentListUIHandler<ProgramDto, TripSeineDto, TripSeinesUI> {
/** Logger */
static private final Log log = LogFactory.getLog(TripSeinesUIHandler.class);
@@ -94,6 +94,11 @@ public class TripSeinesUIHandler extends ContentListUIHandler<ProgramDto, TripSe
}
@Override
+ public boolean isCanCloseChild() {
+ return !getModel().isCanReopen() && !ObserveSwingApplicationContext.get().getDataContext().isOpenRoute();
+ }
+
+ @Override
protected List<DataReference<TripSeineDto>> getChilds(String parentId) {
TripSeineService service = ObserveSwingApplicationContext.get().getMainDataSourceServicesProvider().newTripSeineService();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUI.jaxx
index 1b434e4..ba5ebcd 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUI.jaxx
@@ -21,13 +21,10 @@
-->
<fr.ird.observe.application.swing.ui.content.ContentUI
- abstract='true'
- superGenericType='E'
- genericType='E extends IdDto'
- >
+ abstract='true' superGenericType='E'
+ genericType='E extends IdDto, U extends ContentOpenableUI<E, U>'>
<import>
- fr.ird.observe.services.dto.AbstractObserveDto
fr.ird.observe.services.dto.IdDto
fr.ird.observe.application.swing.ui.actions.shared.CancelCreateUIAction
@@ -43,11 +40,10 @@
</import>
<!-- handler -->
- <ContentOpenableUIHandler id='handler' genericType='E'/>
+ <ContentOpenableUIHandler id='handler' genericType='E, U'/>
<!-- model -->
- <ContentOpenableUIModel id='model' genericType='E'
- enabled='{!model.isReadingMode()}'/>
+ <ContentOpenableUIModel id='model' genericType='E' enabled='{!model.isReadingMode()}'/>
<script><![CDATA[
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUIHandler.java
index c608156..491671c 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/ContentOpenableUIHandler.java
@@ -39,13 +39,16 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.validator.NuitonValidatorScope;
+import javax.swing.JComponent;
+import java.awt.FocusTraversalPolicy;
+
import static org.nuiton.i18n.I18n.t;
/**
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.0
*/
-public abstract class ContentOpenableUIHandler<E extends IdDto> extends ContentUIHandler<E> {
+public abstract class ContentOpenableUIHandler<E extends IdDto, U extends ContentOpenableUI<E, U>> extends ContentUIHandler<E> {
protected static final String POSITION_OPENABLE = "positionOpenable";
@@ -54,7 +57,7 @@ public abstract class ContentOpenableUIHandler<E extends IdDto> extends ContentU
protected final String closeMessage;
- public ContentOpenableUIHandler(ContentOpenableUI<E> ui,
+ public ContentOpenableUIHandler(U ui,
DataContextType parentType,
DataContextType type,
String closeMessage) {
@@ -64,9 +67,19 @@ public abstract class ContentOpenableUIHandler<E extends IdDto> extends ContentU
protected abstract boolean obtainCanReopen(boolean create);
+
+ public void initUI() {
+
+ super.initUI();
+ ((JComponent) ui).setFocusCycleRoot(true);
+ ((JComponent) ui).setFocusTraversalPolicy(createFocusTraversalPolicy(getUi()));
+ }
+
+ protected abstract FocusTraversalPolicy createFocusTraversalPolicy(U ui);
+
@Override
- public ContentOpenableUI<E> getUi() {
- return (ContentOpenableUI<E>) super.getUi();
+ public U getUi() {
+ return (U) super.getUi();
}
@Override
@@ -97,7 +110,7 @@ public abstract class ContentOpenableUIHandler<E extends IdDto> extends ContentU
public final void afterOpenData() {
- ContentOpenableUI<E> ui = getUi();
+ U ui = getUi();
// On charge les ensembles de références utilisées dans les combobox
updateUiWithReferenceSetsFromModel();
@@ -133,7 +146,7 @@ public abstract class ContentOpenableUIHandler<E extends IdDto> extends ContentU
public final void afterCloseData() {
- ContentOpenableUI<E> ui = getUi();
+ U ui = getUi();
ContentOpenableUIModel<E> model = getModel();
@@ -148,12 +161,6 @@ public abstract class ContentOpenableUIHandler<E extends IdDto> extends ContentU
getTypeI18nKey(bean.getClass()), t(closeMessage));
ObserveTreeHelper treeHelper = getTreeHelper(ui);
-// ObserveNode selectedNode = treeHelper.getSelectedNode();
-// if (bean instanceof Trip) {
-// // le program peut change d'etat open
-// selectedNode = selectedNode.getParent();
-// }
-// treeHelper.refreshNode(selectedNode, true);
treeHelper.reloadSelectedNode(bean instanceof TripSeineDto || bean instanceof TripLonglineDto, true);
updateActions();
}
@@ -163,7 +170,7 @@ public abstract class ContentOpenableUIHandler<E extends IdDto> extends ContentU
super.afterSave(refresh);
- ContentOpenableUI<E> ui = getUi();
+ U ui = getUi();
int position = ui.getContextValue(Integer.class, POSITION_OPENABLE);
ObserveTreeHelper treeHelper = getTreeHelper(ui);
@@ -214,10 +221,7 @@ public abstract class ContentOpenableUIHandler<E extends IdDto> extends ContentU
}
// on repaint le noeud et ses enfants
-// treeHelper.refreshNode(node, true);
treeHelper.reloadSelectedNode(false, true);
-
-// treeHelper.refreshNode(node, false);
}
}
@@ -275,9 +279,6 @@ public abstract class ContentOpenableUIHandler<E extends IdDto> extends ContentU
protected final void finalizeOpenUI(ContentMode mode, boolean create) {
-// // utilisation du mode requis
-// setContentMode(mode);
-
boolean historicalData = false;
ContentOpenableUIModel<E> model = getUi().getModel();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/ActivityLonglineUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/ActivityLonglineUI.jaxx
index a914f39..03c3ef9 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/ActivityLonglineUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/ActivityLonglineUI.jaxx
@@ -20,8 +20,9 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.open.ContentOpenableUI superGenericType='ActivityLonglineDto'
- contentTitle='{n("observe.storage.activityLongline.title")}'>
+<fr.ird.observe.application.swing.ui.content.open.ContentOpenableUI
+ superGenericType='ActivityLonglineDto, ActivityLonglineUI'
+ contentTitle='{n("observe.storage.activityLongline.title")}'>
<style source="../../../Common.jcss"/>
@@ -42,8 +43,6 @@
java.awt.Dimension
- javax.swing.SwingConstants
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
static org.nuiton.i18n.I18n.n
</import>
@@ -94,7 +93,8 @@
<JLabel id='vesselActivityLonglineLabel'/>
</cell>
<cell anchor='east' fill="both">
- <BeanComboBox id='vesselActivityLongline' genericType='ReferentialReference<VesselActivityLonglineDto>' _entityClass='VesselActivityLonglineDto.class' constructorParams='this'/>
+ <BeanComboBox id='vesselActivityLongline' genericType='ReferentialReference<VesselActivityLonglineDto>'
+ _entityClass='VesselActivityLonglineDto.class' constructorParams='this'/>
</cell>
</row>
@@ -103,7 +103,8 @@
<JLabel id='fpaZoneLabel'/>
</cell>
<cell anchor='east' fill="both">
- <BeanComboBox id='fpaZone' genericType='ReferentialReference<FpaZoneDto>' _entityClass='FpaZoneDto.class' constructorParams='this'/>
+ <BeanComboBox id='fpaZone' genericType='ReferentialReference<FpaZoneDto>'
+ _entityClass='FpaZoneDto.class' constructorParams='this'/>
</cell>
</row>
@@ -138,8 +139,7 @@
<Table id='extraActions' fill="both" weightx="1" insets='2' visible='{model.isUpdatingMode()}'>
<row>
<cell weightx="0.5" fill="both">
- <JButton id='addSet'
- onActionPerformed='getHandler().addChild(SetLonglineDto.class)'/>
+ <JButton id='addSet' onActionPerformed='getHandler().addChild(SetLonglineDto.class)'/>
</cell>
</row>
</Table>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/ActivityLonglineUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/ActivityLonglineUIHandler.java
index 17682ad..b0fbc96 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/ActivityLonglineUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/ActivityLonglineUIHandler.java
@@ -40,7 +40,11 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.validator.NuitonValidatorScope;
+import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.SwingUtilities;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.FocusTraversalPolicy;
import static org.nuiton.i18n.I18n.n;
import static org.nuiton.i18n.I18n.t;
@@ -51,7 +55,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.7
*/
-class ActivityLonglineUIHandler extends ContentOpenableUIHandler<ActivityLonglineDto> {
+class ActivityLonglineUIHandler extends ContentOpenableUIHandler<ActivityLonglineDto, ActivityLonglineUI> {
/** Logger */
private static final Log log = LogFactory.getLog(ActivityLonglineUIHandler.class);
@@ -72,8 +76,35 @@ class ActivityLonglineUIHandler extends ContentOpenableUIHandler<ActivityLonglin
}
@Override
- public ActivityLonglineUI getUi() {
- return (ActivityLonglineUI) super.getUi();
+ protected FocusTraversalPolicy createFocusTraversalPolicy(ActivityLonglineUI ui) {
+ return new LayoutFocusTraversalPolicy() {
+
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ if (aComponent.equals(ui.getTimeStamp().getDayDateEditor().getEditor())) {
+ if (ui.getCloseAndCreate().isEnabled()) {
+ return ui.getCloseAndCreate();
+ }
+ return ui.getDelete();
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getComponentAfter(Container aContainer, Component aComponent) {
+ if (!ui.getCloseAndCreate().isEnabled() && aComponent.equals(ui.getDelete())) {
+
+ // retour au début
+ return ui.getTimeStamp().getDayDateEditor().getEditor();
+ }
+ if (aComponent.equals(ui.getCloseAndCreate())) {
+
+ // retour au début
+ return ui.getTimeStamp().getDayDateEditor().getEditor();
+ }
+ return super.getComponentAfter(aContainer, aComponent);
+ }
+ };
}
@Override
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/TripLonglineUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/TripLonglineUI.jaxx
index 26be957..5b71a2f 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/TripLonglineUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/TripLonglineUI.jaxx
@@ -20,21 +20,18 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.open.ContentOpenableUI superGenericType='TripLonglineDto'
- contentTitle='{n("observe.content.tripLongline.title")}'>
+<fr.ird.observe.application.swing.ui.content.open.ContentOpenableUI superGenericType='TripLonglineDto, TripLonglineUI'
+ contentTitle='{n("observe.content.tripLongline.title")}'>
<style source="../../../Common.jcss"/>
<import>
fr.ird.observe.services.dto.CommentableDto
fr.ird.observe.services.dto.longline.TripLonglineDto
- fr.ird.observe.services.dto.longline.ActivityLonglineDto
fr.ird.observe.services.dto.longline.TripLonglineActivityDto
fr.ird.observe.services.dto.referential.ReferentialReference
fr.ird.observe.services.dto.referential.HarbourDto
- fr.ird.observe.services.dto.referential.PersonHelper
fr.ird.observe.services.dto.referential.VesselDto
- fr.ird.observe.services.dto.referential.VesselHelper
fr.ird.observe.services.dto.referential.PersonDto
fr.ird.observe.services.dto.referential.OceanDto
fr.ird.observe.services.dto.referential.longline.TripTypeDto
@@ -47,11 +44,8 @@
jaxx.runtime.swing.editor.bean.BeanComboBox
java.awt.Dimension
- java.beans.PropertyChangeEvent
- java.beans.PropertyChangeListener
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
- static org.apache.commons.lang3.StringUtils.isEmpty
static org.nuiton.i18n.I18n.n
</import>
@@ -65,11 +59,8 @@
<TripLonglineDto id='bean'/>
<!-- validator -->
- <BeanValidator id='validator'
- beanClass='fr.ird.observe.services.dto.longline.TripLonglineDto'
- errorTableModel='{getErrorTableModel()}'
- autoField='true'
- context='ui-update'>
+ <BeanValidator id='validator' beanClass='fr.ird.observe.services.dto.longline.TripLonglineDto'
+ errorTableModel='{getErrorTableModel()}' autoField='true' context='ui-update'>
<field name='activityLongline' component='{actionDown}'/>
</BeanValidator>
@@ -94,7 +85,8 @@ protected boolean canEditOcean(java.util.LinkedHashSet<TripLonglineActivityDto>
<JLabel id='tripTypeLabel'/>
</cell>
<cell anchor='east'>
- <BeanComboBox id='tripType' constructorParams='this' genericType='ReferentialReference<TripTypeDto>' _entityClass='TripTypeDto.class'/>
+ <BeanComboBox id='tripType' constructorParams='this' genericType='ReferentialReference<TripTypeDto>'
+ _entityClass='TripTypeDto.class'/>
</cell>
</row>
@@ -104,7 +96,8 @@ protected boolean canEditOcean(java.util.LinkedHashSet<TripLonglineActivityDto>
<JLabel id='captainLabel'/>
</cell>
<cell anchor='east'>
- <BeanComboBox id='captain' constructorParams='this' genericType='ReferentialReference<PersonDto>' _entityClass='PersonDto.class'/>
+ <BeanComboBox id='captain' constructorParams='this' genericType='ReferentialReference<PersonDto>'
+ _entityClass='PersonDto.class'/>
</cell>
</row>
@@ -114,7 +107,8 @@ protected boolean canEditOcean(java.util.LinkedHashSet<TripLonglineActivityDto>
<JLabel id='observerLabel'/>
</cell>
<cell anchor='east'>
- <BeanComboBox id='observer' constructorParams='this' genericType='ReferentialReference<PersonDto>' _entityClass='PersonDto.class'/>
+ <BeanComboBox id='observer' constructorParams='this' genericType='ReferentialReference<PersonDto>'
+ _entityClass='PersonDto.class'/>
</cell>
</row>
@@ -124,7 +118,8 @@ protected boolean canEditOcean(java.util.LinkedHashSet<TripLonglineActivityDto>
<JLabel id='dataEntryOperatorLabel'/>
</cell>
<cell anchor='east'>
- <BeanComboBox id='dataEntryOperator' constructorParams='this' genericType='ReferentialReference<PersonDto>' _entityClass='PersonDto.class'/>
+ <BeanComboBox id='dataEntryOperator' constructorParams='this'
+ genericType='ReferentialReference<PersonDto>' _entityClass='PersonDto.class'/>
</cell>
</row>
@@ -134,7 +129,8 @@ protected boolean canEditOcean(java.util.LinkedHashSet<TripLonglineActivityDto>
<JLabel id='vesselLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <BeanComboBox id='vessel' constructorParams='this' genericType='ReferentialReference<VesselDto>' _entityClass='VesselDto.class'/>
+ <BeanComboBox id='vessel' constructorParams='this' genericType='ReferentialReference<VesselDto>'
+ _entityClass='VesselDto.class'/>
</cell>
</row>
@@ -144,7 +140,8 @@ protected boolean canEditOcean(java.util.LinkedHashSet<TripLonglineActivityDto>
<JLabel id='oceanLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <BeanComboBox id='ocean' genericType='ReferentialReference<OceanDto>' _entityClass='OceanDto.class' constructorParams='this'/>
+ <BeanComboBox id='ocean' genericType='ReferentialReference<OceanDto>' _entityClass='OceanDto.class'
+ constructorParams='this'/>
</cell>
</row>
@@ -154,7 +151,8 @@ protected boolean canEditOcean(java.util.LinkedHashSet<TripLonglineActivityDto>
<JLabel id='departureHarbourLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <BeanComboBox id='departureHarbour' genericType='ReferentialReference<HarbourDto>' _entityClass='HarbourDto.class' constructorParams='this'/>
+ <BeanComboBox id='departureHarbour' genericType='ReferentialReference<HarbourDto>'
+ _entityClass='HarbourDto.class' constructorParams='this'/>
</cell>
</row>
@@ -164,7 +162,8 @@ protected boolean canEditOcean(java.util.LinkedHashSet<TripLonglineActivityDto>
<JLabel id='landingHarbourLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <BeanComboBox id='landingHarbour' genericType='ReferentialReference<HarbourDto>' _entityClass='HarbourDto.class' constructorParams='this'/>
+ <BeanComboBox id='landingHarbour' genericType='ReferentialReference<HarbourDto>'
+ _entityClass='HarbourDto.class' constructorParams='this'/>
</cell>
</row>
@@ -217,10 +216,8 @@ protected boolean canEditOcean(java.util.LinkedHashSet<TripLonglineActivityDto>
<!-- comment -->
<row>
<cell columns='2' fill='both' weighty="1">
- <JScrollPane id='comment'
- onFocusGained='comment2.requestFocus()'>
- <JTextArea id='comment2'
- onKeyReleased='getModel().getBean().setComment(comment2.getText())'/>
+ <JScrollPane id='comment' onFocusGained='comment2.requestFocus()'>
+ <JTextArea id='comment2' onKeyReleased='getModel().getBean().setComment(comment2.getText())'/>
</JScrollPane>
</cell>
</row>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/TripLonglineUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/TripLonglineUIHandler.java
index 3c0a539..1ea6413 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/TripLonglineUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/longline/TripLonglineUIHandler.java
@@ -45,7 +45,11 @@ import org.apache.commons.logging.LogFactory;
import org.nuiton.util.DateUtil;
import javax.swing.JTabbedPane;
+import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.SwingUtilities;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.FocusTraversalPolicy;
import java.util.Collection;
import java.util.Date;
import java.util.LinkedList;
@@ -60,7 +64,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.7
*/
-class TripLonglineUIHandler extends ContentOpenableUIHandler<TripLonglineDto> {
+class TripLonglineUIHandler extends ContentOpenableUIHandler<TripLonglineDto,TripLonglineUI> {
/** Logger */
static private final Log log = LogFactory.getLog(TripLonglineUIHandler.class);
@@ -74,9 +78,42 @@ class TripLonglineUIHandler extends ContentOpenableUIHandler<TripLonglineDto> {
n("observe.content.tripLongline.message.not.open"));
}
+// @Override
+// public TripLonglineUI getUi() {
+// return (TripLonglineUI) super.getUi();
+// }
+
+
@Override
- public TripLonglineUI getUi() {
- return (TripLonglineUI) super.getUi();
+ protected FocusTraversalPolicy createFocusTraversalPolicy(TripLonglineUI ui) {
+ return new LayoutFocusTraversalPolicy() {
+
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ if (aComponent.equals(ui.getTripType().getCombobox().getEditor().getEditorComponent())) {
+ if (ui.getCloseAndCreate().isEnabled()) {
+ return ui.getCloseAndCreate();
+ }
+ return ui.getDelete();
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getComponentAfter(Container aContainer, Component aComponent) {
+ if (!ui.getCloseAndCreate().isEnabled() && aComponent.equals(ui.getDelete())) {
+
+ // retour au début
+ return ui.getTripType();
+ }
+ if (aComponent.equals(ui.getCloseAndCreate())) {
+
+ // retour au début
+ return ui.getTripType();
+ }
+ return super.getComponentAfter(aContainer, aComponent);
+ }
+ };
}
@Override
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/ActivitySeineUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/ActivitySeineUI.jaxx
index f7adb30..290eeef 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/ActivitySeineUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/ActivitySeineUI.jaxx
@@ -20,7 +20,7 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.open.ContentOpenableUI superGenericType='ActivitySeineDto'
+<fr.ird.observe.application.swing.ui.content.open.ContentOpenableUI superGenericType='ActivitySeineDto, ActivitySeineUI'
contentTitle='{n("observe.storage.activitySeine.title")}'>
<style source="../../../Common.jcss"/>
@@ -43,7 +43,6 @@
jaxx.runtime.swing.editor.NumberEditor
jaxx.runtime.swing.editor.bean.BeanComboBox
- jaxx.runtime.swing.CardLayout2Ext
org.nuiton.jaxx.widgets.datetime.TimeEditor
org.nuiton.jaxx.widgets.gis.absolute.CoordinatesEditor
@@ -52,8 +51,6 @@
java.awt.Dimension
java.util.Collection
- javax.swing.SwingConstants
-
static fr.ird.observe.application.swing.ui.UIHelper.getStringValue
static org.nuiton.i18n.I18n.n
</import>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/ActivitySeineUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/ActivitySeineUIHandler.java
index db40d22..de4ee78 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/ActivitySeineUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/ActivitySeineUIHandler.java
@@ -43,8 +43,14 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.validator.NuitonValidatorScope;
+import javax.swing.JComponent;
+import javax.swing.JSpinner;
+import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.SwingUtilities;
import javax.swing.event.TableModelListener;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.FocusTraversalPolicy;
import java.util.HashSet;
import java.util.Set;
@@ -55,7 +61,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.0
*/
-class ActivitySeineUIHandler extends ContentOpenableUIHandler<ActivitySeineDto> {
+class ActivitySeineUIHandler extends ContentOpenableUIHandler<ActivitySeineDto, ActivitySeineUI> {
/** Logger */
private static final Log log = LogFactory.getLog(ActivitySeineUIHandler.class);
@@ -77,8 +83,58 @@ class ActivitySeineUIHandler extends ContentOpenableUIHandler<ActivitySeineDto>
}
@Override
- public ActivitySeineUI getUi() {
- return (ActivitySeineUI) super.getUi();
+ protected FocusTraversalPolicy createFocusTraversalPolicy(ActivitySeineUI ui) {
+ return new LayoutFocusTraversalPolicy() {
+
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ if (aComponent.getParent().equals(ui.getTime().getHourEditor().getEditor())) {
+ if (ui.getCloseAndCreate().isEnabled()) {
+ return ui.getCloseAndCreate();
+ }
+ return ui.getDelete();
+ }
+ break;
+ case 1:
+ if (aComponent.equals(ui.getVesselSpeed().getTextField())) {
+ return getLastComponent(aContainer);
+ }
+ case 2:
+ if (aComponent.equals(ui.getObservedSystem().getUniverseList())) {
+ return getLastComponent(aContainer);
+ }
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ JComponent editor = ui.getTime().getHourEditor().getEditor();
+ return ((JSpinner.DateEditor) editor).getTextField();
+ case 1:
+ return ui.getVesselSpeed();
+ case 2: return ui.getObservedSystem().getUniverseList();
+ }
+ return super.getFirstComponent(aContainer);
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ if (getModel().isCreatingMode()) {
+ if (ui.getSave().isEnabled()) {
+ return ui.getSave();
+ }
+ return ui.getReset();
+ } else
+ return ui.getCloseAndCreate();
+ }
+ };
}
@Override
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/RouteUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/RouteUI.jaxx
index f36134c..7fecea6 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/RouteUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/RouteUI.jaxx
@@ -20,7 +20,8 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.open.ContentOpenableUI superGenericType='RouteDto' contentTitle='{n("observe.content.route.title")}'>
+<fr.ird.observe.application.swing.ui.content.open.ContentOpenableUI superGenericType='RouteDto, RouteUI'
+ contentTitle='{n("observe.content.route.title")}'>
<import>
fr.ird.observe.services.dto.seine.RouteDto
@@ -45,11 +46,8 @@
<RouteDto id='bean'/>
<!-- validator -->
- <BeanValidator id='validator'
- autoField='true'
- beanClass='fr.ird.observe.services.dto.seine.RouteDto'
- errorTableModel='{getErrorTableModel()}'
- context='ui-update'>
+ <BeanValidator id='validator' autoField='true' beanClass='fr.ird.observe.services.dto.seine.RouteDto'
+ errorTableModel='{getErrorTableModel()}' context='ui-update'>
<field name='activitySeine' component='{actionDown}'/>
</BeanValidator>
@@ -82,10 +80,8 @@
</row>
<row>
<cell columns='2' fill="both" weightx="1" weighty="1">
- <JScrollPane id='comment'
- onFocusGained='comment2.requestFocus()'>
- <JTextArea id='comment2'
- onKeyReleased='getBean().setComment(comment2.getText())'/>
+ <JScrollPane id='comment' onFocusGained='comment2.requestFocus()'>
+ <JTextArea id='comment2' onKeyReleased='getBean().setComment(comment2.getText())'/>
</JScrollPane>
</cell>
</row>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/RouteUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/RouteUIHandler.java
index d17062e..b911436 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/RouteUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/RouteUIHandler.java
@@ -28,8 +28,8 @@ import fr.ird.observe.application.swing.decoration.ObserveI18nDecoratorHelper;
import fr.ird.observe.application.swing.ui.UIHelper;
import fr.ird.observe.application.swing.ui.content.ContentMode;
import fr.ird.observe.application.swing.ui.content.open.ContentOpenableUIHandler;
-import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import fr.ird.observe.application.swing.ui.tree.ObserveTreeHelper;
+import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import fr.ird.observe.services.dto.Form;
import fr.ird.observe.services.dto.referential.ReferentialReference;
import fr.ird.observe.services.dto.referential.seine.VesselActivitySeineDto;
@@ -45,6 +45,10 @@ import org.nuiton.util.DateUtil;
import org.nuiton.validator.NuitonValidatorScope;
import javax.swing.JOptionPane;
+import javax.swing.LayoutFocusTraversalPolicy;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.FocusTraversalPolicy;
import java.util.Date;
import static org.nuiton.i18n.I18n.n;
@@ -54,9 +58,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.0
*/
-class RouteUIHandler extends ContentOpenableUIHandler<RouteDto> {
-
-// private static final String UPDATE_TRIP_NODE = "updateTripNode";
+class RouteUIHandler extends ContentOpenableUIHandler<RouteDto, RouteUI> {
/** Logger */
private static final Log log = LogFactory.getLog(RouteUIHandler.class);
@@ -69,8 +71,35 @@ class RouteUIHandler extends ContentOpenableUIHandler<RouteDto> {
}
@Override
- public RouteUI getUi() {
- return (RouteUI) super.getUi();
+ protected FocusTraversalPolicy createFocusTraversalPolicy(RouteUI ui) {
+ return new LayoutFocusTraversalPolicy() {
+
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ if (aComponent.equals(ui.getDate().getEditor())) {
+ if (ui.getCloseAndCreate().isEnabled()) {
+ return ui.getCloseAndCreate();
+ }
+ return ui.getDelete();
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getComponentAfter(Container aContainer, Component aComponent) {
+ if (!ui.getCloseAndCreate().isEnabled() && aComponent.equals(ui.getDelete())) {
+
+ // retour au début
+ return ui.getDate();
+ }
+ if (aComponent.equals(ui.getCloseAndCreate())) {
+
+ // retour au début
+ return ui.getDate();
+ }
+ return super.getComponentAfter(aContainer, aComponent);
+ }
+ };
}
@Override
@@ -103,9 +132,7 @@ class RouteUIHandler extends ContentOpenableUIHandler<RouteDto> {
} else {
// la maree courante est ouverte
- addMessage(ui, NuitonValidatorScope.INFO,
- getTypeI18nKey(RouteDto.class),
- t(closeMessage));
+ addMessage(ui, NuitonValidatorScope.INFO, getTypeI18nKey(RouteDto.class), t(closeMessage));
}
return ContentMode.READ;
}
@@ -402,13 +429,13 @@ class RouteUIHandler extends ContentOpenableUIHandler<RouteDto> {
if (close) {
- // on sauvegarde l'activity
+ // on sauvegarde l'activité
selectedUI.save(false);
- // on ferme l'activity
+ // on ferme l'activité
selectedUI.closeData();
- // on ferme l'écean
+ // on ferme l'écran
selectedUI.stopEdit();
}
return selectedUI;
@@ -423,39 +450,6 @@ class RouteUIHandler extends ContentOpenableUIHandler<RouteDto> {
return !create && getOpenDataManager().canOpenRoute(getSelectedParentId());
}
-// private void repaintTripNode() {
-// Boolean updateTripNode = getUi().getContextValue(Boolean.class, UPDATE_TRIP_NODE);
-//
-// getUi().removeContextValue(Boolean.class, UPDATE_TRIP_NODE);
-//
-// if (updateTripNode == null || !updateTripNode) {
-// return;
-// }
-//
-//
-// ObserveTreeHelper treeHelper = getTreeHelper(getUi());
-// ObserveNode tripNode = treeHelper.getSelectedNode().getParent().getParent();
-// if (log.isInfoEnabled()) {
-// log.info("Refresh trip node : " + tripNode);
-// }
-// treeHelper.reloadNode(tripNode, false);
-// }
-
-// protected void setUpdateMareeNodeTag(boolean wasUpdated) {
-//
-// if (wasUpdated) {
-//
-// // la date de fin a ete modifiee, il faut : redessiner le noeud de la maree le repositionner
-// getUi().setContextValue(Boolean.TRUE, UPDATE_TRIP_NODE);
-//
-// } else {
-//
-// getUi().removeContextValue(Boolean.class, UPDATE_TRIP_NODE);
-//
-// }
-//
-// }
-
private RouteService getRouteService() {
return ObserveSwingApplicationContext.get().getMainDataSourceServicesProvider().newRouteService();
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/TripSeineUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/TripSeineUI.jaxx
index 1f5639b..51dcc25 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/TripSeineUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/TripSeineUI.jaxx
@@ -20,8 +20,8 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.open.ContentOpenableUI superGenericType='TripSeineDto'
- contentTitle='{n("observe.content.tripSeine.title")}'>
+<fr.ird.observe.application.swing.ui.content.open.ContentOpenableUI superGenericType='TripSeineDto, TripSeineUI'
+ contentTitle='{n("observe.content.tripSeine.title")}'>
<import>
fr.ird.observe.services.dto.seine.TripSeineDto
@@ -82,7 +82,7 @@ protected boolean canEditOcean(java.util.LinkedHashSet<RouteStubDto> routes) {
<JPanel id="body" layout='{new BorderLayout()}'>
<JTabbedPane id='tripSeineTabPane' constraints='BorderLayout.CENTER'>
<tab id='generalTab'>
- <Table insets="0" fill="both">
+ <Table insets="0" fill="both" id="formGeneral">
<!-- captain -->
<row>
@@ -90,7 +90,8 @@ protected boolean canEditOcean(java.util.LinkedHashSet<RouteStubDto> routes) {
<JLabel id='captainLabel'/>
</cell>
<cell anchor='east'>
- <BeanComboBox id='captain' constructorParams='this' genericType='ReferentialReference<PersonDto>' _entityClass='PersonDto.class'/>
+ <BeanComboBox id='captain' constructorParams='this' genericType='ReferentialReference<PersonDto>'
+ _entityClass='PersonDto.class'/>
</cell>
</row>
@@ -100,7 +101,8 @@ protected boolean canEditOcean(java.util.LinkedHashSet<RouteStubDto> routes) {
<JLabel id='observerLabel'/>
</cell>
<cell anchor='east'>
- <BeanComboBox id='observer' constructorParams='this' genericType='ReferentialReference<PersonDto>' _entityClass='PersonDto.class'/>
+ <BeanComboBox id='observer' constructorParams='this' genericType='ReferentialReference<PersonDto>'
+ _entityClass='PersonDto.class'/>
</cell>
</row>
@@ -110,7 +112,8 @@ protected boolean canEditOcean(java.util.LinkedHashSet<RouteStubDto> routes) {
<JLabel id='dataEntryOperatorLabel'/>
</cell>
<cell anchor='east'>
- <BeanComboBox id='dataEntryOperator' constructorParams='this' genericType='ReferentialReference<PersonDto>' _entityClass='PersonDto.class'/>
+ <BeanComboBox id='dataEntryOperator' constructorParams='this'
+ genericType='ReferentialReference<PersonDto>' _entityClass='PersonDto.class'/>
</cell>
</row>
@@ -120,7 +123,8 @@ protected boolean canEditOcean(java.util.LinkedHashSet<RouteStubDto> routes) {
<JLabel id='vesselLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <BeanComboBox id='vessel' constructorParams='this' genericType='ReferentialReference<VesselDto>' _entityClass='VesselDto.class'/>
+ <BeanComboBox id='vessel' constructorParams='this' genericType='ReferentialReference<VesselDto>'
+ _entityClass='VesselDto.class'/>
</cell>
</row>
@@ -130,7 +134,8 @@ protected boolean canEditOcean(java.util.LinkedHashSet<RouteStubDto> routes) {
<JLabel id='oceanLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <BeanComboBox id='ocean' genericType='ReferentialReference<OceanDto>' _entityClass='OceanDto.class' constructorParams='this'/>
+ <BeanComboBox id='ocean' genericType='ReferentialReference<OceanDto>' _entityClass='OceanDto.class'
+ constructorParams='this'/>
</cell>
</row>
@@ -140,7 +145,8 @@ protected boolean canEditOcean(java.util.LinkedHashSet<RouteStubDto> routes) {
<JLabel id='departureHarbourLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <BeanComboBox id='departureHarbour' genericType='ReferentialReference<HarbourDto>' _entityClass='HarbourDto.class' constructorParams='this'/>
+ <BeanComboBox id='departureHarbour' genericType='ReferentialReference<HarbourDto>'
+ _entityClass='HarbourDto.class' constructorParams='this'/>
</cell>
</row>
@@ -150,7 +156,8 @@ protected boolean canEditOcean(java.util.LinkedHashSet<RouteStubDto> routes) {
<JLabel id='landingHarbourLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both">
- <BeanComboBox id='landingHarbour' genericType='ReferentialReference<HarbourDto>' _entityClass='HarbourDto.class' constructorParams='this'/>
+ <BeanComboBox id='landingHarbour' genericType='ReferentialReference<HarbourDto>'
+ _entityClass='HarbourDto.class' constructorParams='this'/>
</cell>
</row>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/TripSeineUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/TripSeineUIHandler.java
index 84f2885..7a31c57 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/TripSeineUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/open/impl/seine/TripSeineUIHandler.java
@@ -25,6 +25,10 @@ import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
import fr.ird.observe.application.swing.configuration.ObserveSwingApplicationConfig;
import fr.ird.observe.application.swing.db.DataContext;
import fr.ird.observe.application.swing.db.constants.DataContextType;
+import fr.ird.observe.application.swing.ui.content.ContentMode;
+import fr.ird.observe.application.swing.ui.content.open.ContentOpenableUIHandler;
+import fr.ird.observe.application.swing.ui.content.open.ContentOpenableUIModel;
+import fr.ird.observe.application.swing.ui.util.tripMap.TripMapUI;
import fr.ird.observe.services.dto.Form;
import fr.ird.observe.services.dto.TripMapDto;
import fr.ird.observe.services.dto.referential.PersonHelper;
@@ -35,16 +39,16 @@ import fr.ird.observe.services.dto.result.SaveResultDto;
import fr.ird.observe.services.dto.seine.TripSeineDto;
import fr.ird.observe.services.dto.seine.TripSeineHelper;
import fr.ird.observe.services.service.data.seine.TripSeineService;
-import fr.ird.observe.application.swing.ui.content.ContentMode;
-import fr.ird.observe.application.swing.ui.content.open.ContentOpenableUIHandler;
-import fr.ird.observe.application.swing.ui.content.open.ContentOpenableUIModel;
-import fr.ird.observe.application.swing.ui.util.tripMap.TripMapUI;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.DateUtil;
import javax.swing.JTabbedPane;
+import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.SwingUtilities;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.FocusTraversalPolicy;
import java.util.Collection;
import java.util.Date;
import java.util.LinkedList;
@@ -57,7 +61,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.0
*/
-class TripSeineUIHandler extends ContentOpenableUIHandler<TripSeineDto> {
+class TripSeineUIHandler extends ContentOpenableUIHandler<TripSeineDto, TripSeineUI> {
/** Logger */
static private final Log log = LogFactory.getLog(TripSeineUIHandler.class);
@@ -71,12 +75,6 @@ class TripSeineUIHandler extends ContentOpenableUIHandler<TripSeineDto> {
n("observe.content.tripSeine.message.not.open"));
}
-
- @Override
- public TripSeineUI getUi() {
- return (TripSeineUI) super.getUi();
- }
-
@Override
public boolean doCloseData() {
boolean result = getOpenDataManager().isOpenTripSeine(getSelectedId());
@@ -87,6 +85,38 @@ class TripSeineUIHandler extends ContentOpenableUIHandler<TripSeineDto> {
}
@Override
+ protected FocusTraversalPolicy createFocusTraversalPolicy(TripSeineUI ui) {
+ return new LayoutFocusTraversalPolicy() {
+
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ if (aComponent.equals(ui.getCaptain().getCombobox().getEditor().getEditorComponent())) {
+ if (ui.getCloseAndCreate().isEnabled()) {
+ return ui.getCloseAndCreate();
+ }
+ return ui.getDelete();
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getComponentAfter(Container aContainer, Component aComponent) {
+ if (!ui.getCloseAndCreate().isEnabled() && aComponent.equals(ui.getDelete())) {
+
+ // retour au début
+ return ui.getCaptain();
+ }
+ if (aComponent.equals(ui.getCloseAndCreate())) {
+
+ // retour au début
+ return ui.getCaptain();
+ }
+ return super.getComponentAfter(aContainer, aComponent);
+ }
+ };
+ }
+
+ @Override
public void initUI() {
super.initUI();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableModel.java
index 3ba96f9..3cfcb10 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableModel.java
@@ -127,11 +127,10 @@ public abstract class ContentTableModel<P extends IdDto, B extends IdDto> extend
/** un drapeau pour savoir si le modèle a ete initialisé. */
private boolean init;
- private ObserveContentTableUI<P, B> context;
+ private ObserveContentTableUI<P, B, ?> context;
@SuppressWarnings("unchecked")
- public ContentTableModel(ObserveContentTableUI<P, B> context,
- List<ContentTableMeta<B>> metas) {
+ public ContentTableModel(ObserveContentTableUI<P, B, ?> context, List<ContentTableMeta<B>> metas) {
if (CollectionUtils.isEmpty(metas)) {
throw new NullPointerException("meta parameter can not be null, nor empty");
}
@@ -449,7 +448,7 @@ public abstract class ContentTableModel<P extends IdDto, B extends IdDto> extend
}
@SuppressWarnings("unchecked")
- protected ContentTableUIHandler<P, B> getHandler() {
+ protected ContentTableUIHandler<P, B, ?> getHandler() {
return context.getHandler();
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUI.jaxx
index c6e467b..58e3cdd 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUI.jaxx
@@ -22,8 +22,8 @@
<fr.ird.observe.application.swing.ui.content.ContentUI
abstract='true'
- superGenericType='E' implements="fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI<E,D>"
- genericType='E extends IdDto, D extends IdDto'>
+ superGenericType='E' implements="fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI<E, D, U>"
+ genericType='E extends IdDto, D extends IdDto, U extends ContentTableUI<E, D, U>'>
<import>
fr.ird.observe.application.swing.ui.actions.shared.ResetEditUIAction
@@ -58,7 +58,7 @@
<String id='deleteEntryTip' javaBean='n("observe.action.delete.entry.tip")'/>
<!-- Handler -->
- <ContentTableUIHandler id='handler' genericType='E, D'/>
+ <ContentTableUIHandler id='handler' genericType='E, D, U'/>
<!-- Model -->
<ContentTableUIModel id='model' genericType='E, D' initializer='ContentTableUIModel.newModel(this)'/>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIHandler.java
index a458c6c..86c660f 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIHandler.java
@@ -25,13 +25,6 @@ import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
import fr.ird.observe.application.swing.db.DataContext;
import fr.ird.observe.application.swing.db.ObserveSwingDataSource;
import fr.ird.observe.application.swing.db.constants.DataContextType;
-import fr.ird.observe.services.dto.IdDto;
-import fr.ird.observe.services.dto.longline.ActivityLonglineDto;
-import fr.ird.observe.services.dto.referential.ReferentialReference;
-import fr.ird.observe.services.dto.referential.SpeciesDto;
-import fr.ird.observe.services.dto.referential.seine.WeightCategoryDto;
-import fr.ird.observe.services.dto.seine.ActivitySeineDto;
-import fr.ird.observe.services.dto.seine.TargetCatchDto;
import fr.ird.observe.application.swing.ui.UIHelper;
import fr.ird.observe.application.swing.ui.content.ContentMode;
import fr.ird.observe.application.swing.ui.content.ContentUIHandler;
@@ -40,10 +33,18 @@ import fr.ird.observe.application.swing.ui.content.table.impl.longline.WeightMea
import fr.ird.observe.application.swing.ui.tree.node.ObserveNode;
import fr.ird.observe.application.swing.ui.util.table.EditableTableModelSupport;
import fr.ird.observe.application.swing.ui.util.table.InlineTableAutotSelectRowAndShowPopupAction;
+import fr.ird.observe.services.dto.IdDto;
+import fr.ird.observe.services.dto.longline.ActivityLonglineDto;
+import fr.ird.observe.services.dto.referential.ReferentialReference;
+import fr.ird.observe.services.dto.referential.SpeciesDto;
+import fr.ird.observe.services.dto.referential.seine.WeightCategoryDto;
+import fr.ird.observe.services.dto.seine.ActivitySeineDto;
+import fr.ird.observe.services.dto.seine.TargetCatchDto;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.validator.NuitonValidatorScope;
+import javax.swing.JComponent;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
@@ -53,6 +54,8 @@ import javax.swing.SwingUtilities;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.TableModelEvent;
import javax.swing.table.DefaultTableCellRenderer;
+import java.awt.Component;
+import java.awt.FocusTraversalPolicy;
import java.awt.Rectangle;
import java.beans.PropertyChangeListener;
import java.io.Serializable;
@@ -68,12 +71,12 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.4
*/
-public abstract class ContentTableUIHandler<E extends IdDto, D extends IdDto> extends ContentUIHandler<E> {
+public abstract class ContentTableUIHandler<E extends IdDto, D extends IdDto, U extends ContentTableUI<E, D, U>> extends ContentUIHandler<E> {
/** Logger */
private static final Log log = LogFactory.getLog(ContentTableUIHandler.class);
- protected ContentTableUIHandler(ObserveContentTableUI<E, D> ui, DataContextType dataContextType) {
+ protected ContentTableUIHandler(U ui, DataContextType dataContextType) {
super(ui, dataContextType, null);
}
@@ -133,8 +136,8 @@ public abstract class ContentTableUIHandler<E extends IdDto, D extends IdDto> ex
}
@Override
- public ObserveContentTableUI<E, D> getUi() {
- return (ObserveContentTableUI<E, D>) super.getUi();
+ public U getUi() {
+ return (U) super.getUi();
}
public final D getTableEditBean() {
@@ -143,7 +146,7 @@ public abstract class ContentTableUIHandler<E extends IdDto, D extends IdDto> ex
public final void updateEditor(ListSelectionEvent event) {
- final ObserveContentTableUI<E, D> ui = getUi();
+ U ui = getUi();
if (ui.getValidatorTable() == null) {
log.debug("skip validator is null!");
@@ -217,50 +220,40 @@ public abstract class ContentTableUIHandler<E extends IdDto, D extends IdDto> ex
protected abstract void loadEditBean(String beanId);
- //FIXME
-// @Override
-// protected final void onLoad(TopiaContext tx, E bean) throws TopiaException {
-// super.onLoad(tx, bean);
-//
-// // on duplique la liste des fils traites dans le tableau
-// // sinon on reste sur les references d'origine et on aura pas
-// // la possibilité d'annuler l'edition ensuite car on aura modifie
-// // les entrées d'origine...
-// E editBean = getBean();
-// Collection<D> data = loadChilds(tx, editBean);
-// getModel().getChildsUpdator().setChilds(editBean, data);
-// }
-
- //FIXME
-// protected Collection<D> loadChilds(TopiaContext tx, E bean) throws TopiaException {
-// Collection<D> childs = getModel().getChildsUpdator().getChilds(bean);
-// Collection<D> data = new ArrayList<D>();
-// if (CollectionUtils.isNotEmpty(childs)) {
-// Loador<D> loader = getModel().getChildLoador();
-// TopiaDAO<D> dao = getMainDataSource().getDAO(tx, getTableEditBean());
-// for (D c : childs) {
-// try {
-// D cUp = dao.findByTopiaId(c.getTopiaId());
-// D c2 = getModel().newTableEditBean();
-// loader.load(cUp, c2, true);
-// data.add(c2);
-// } catch (Exception e) {
-// throw new RuntimeException(e);
-// }
-// }
-// }
-// return data;
-// }
+ protected abstract FocusTraversalPolicy createFocusTraversalPolicy(U ui);
@Override
public void initUI() {
- final ContentTableUIInitializer<E, D, ObserveContentTableUI<E, D>> uiInitializer =
- new ContentTableUIInitializer<>(getUi());
+ ContentTableUIInitializer<E, D, U> uiInitializer = new ContentTableUIInitializer<>(getUi());
uiInitializer.initUI();
getModel().addPropertyChangeListener(ContentUIModel.PROPERTY_FORM, evt -> updateUiWithReferenceSetsFromModel());
+ ((JComponent) ui).setFocusCycleRoot(true);
+ ((JComponent) ui).setFocusTraversalPolicy(createFocusTraversalPolicy(getUi()));
+ }
+
+ protected Component getDefaultLastComponent(U ui, Component optionalComponent) {
+ if (ui.getSave().isEnabled()) {
+ return ui.getSave();
+ }
+ if (ui.getReset().isEnabled()) {
+ return ui.getReset();
+ }
+ if (optionalComponent != null) {
+ return optionalComponent;
+ }
+ if (ui.getDeleteEntry().isVisible() && ui.getDeleteEntry().isEnabled()) {
+ return ui.getDeleteEntry();
+ }
+ if (ui.getSaveNewEntry().isVisible() && ui.getSaveNewEntry().isEnabled()) {
+ return ui.getSaveNewEntry();
+ }
+ if (ui.getResetNewEntry().isVisible() && ui.getResetNewEntry().isEnabled()) {
+ return ui.getResetNewEntry();
+ }
+ return ui.getResetEntry();
}
@Override
@@ -271,7 +264,7 @@ public abstract class ContentTableUIHandler<E extends IdDto, D extends IdDto> ex
// récupération du mode de l'écran
ContentMode mode = computeContentMode();
- ObserveContentTableUI<E, D> ui = getUi();
+ U ui = getUi();
int oldIndex = ui.getTableModel().getSelectedRow();
@@ -341,7 +334,7 @@ public abstract class ContentTableUIHandler<E extends IdDto, D extends IdDto> ex
@Override
protected boolean doSave(E bean) throws Exception {
- ObserveContentTableUI<E, D> ui = getUi();
+ U ui = getUi();
List<D> objets = ui.getTableModel().getData();
@@ -364,63 +357,6 @@ public abstract class ContentTableUIHandler<E extends IdDto, D extends IdDto> ex
protected abstract void doPersist(E bean);
- //FIXME
-// @Override
-// protected E onUpdate(TopiaContext tx, Object parentBean, E beanToSave) throws TopiaException {
-//
-// List<D> childs = getUi().getTableModel().getData();
-//
-// E editBean = getBean();
-//
-// TopiaEntityBinder<E> binder = getLoadBinder();
-//
-// Loador<D> childBinder = getModel().getChildLoador();
-//
-// EntityListUpdator<E, D> childUpdator = getModel().getChildsUpdator();
-//
-// // recopie des propriétés du bean en excluant toujours la liste des fils
-// binder.copyExcluding(editBean, beanToSave, childUpdator.getPropertyName());
-//
-// // on conserve l'ancienne liste des fils (pour traitement ultérieure)
-// Collection<D> oldChilds =
-// new ArrayList<D>(childUpdator.getChilds(beanToSave));
-//
-// // suppression des fils dans le bean a sauver
-// childUpdator.removeAll(beanToSave);
-//
-// TopiaDAO<D> dao = ObserveDAOHelper.getDAO(tx, getModel().getChildType());
-//
-// for (D child : childs) {
-//
-// D childToSave;
-//
-// if (child.getTopiaId() == null) {
-//
-// // creation du fils
-// Map<String, Object> map = childBinder.obtainProperties(child);
-//
-// childToSave = dao.create(map);
-//
-// } else {
-//
-// // mise a jour du fils
-//
-// childToSave = dao.findByTopiaId(child.getTopiaId());
-//
-// childBinder.load(child, childToSave, false);
-// }
-//
-// // ajout du fils au bean à sauver
-// childUpdator.addToList(beanToSave, childToSave);
-// }
-//
-// // on donne la main aux implantations pour faire des traitements
-// // supplémentaires
-// onUpdateFinalize(tx, beanToSave, oldChilds);
-//
-// return beanToSave;
-// }
-
@Override
protected void afterSave(boolean refresh) {
@@ -434,11 +370,6 @@ public abstract class ContentTableUIHandler<E extends IdDto, D extends IdDto> ex
return true;
}
- //FIXME
-// protected void onUpdateFinalize(TopiaContext tx, E bean, Collection<D> oldChilds) throws TopiaException {
-// // par défaut, rien à faire
-// }
-
protected ContentTableModel<E, D> getTableModel() {
return getUi().getTableModel();
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIInitializer.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIInitializer.java
index c5d8701..93105a3 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIInitializer.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIInitializer.java
@@ -50,7 +50,7 @@ import java.awt.event.KeyEvent;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.7
*/
-public class ContentTableUIInitializer<E extends IdDto, D extends IdDto, UI extends ObserveContentTableUI<E, D>> extends ContentUIInitializer<E, UI> {
+public class ContentTableUIInitializer<E extends IdDto, D extends IdDto, UI extends ContentTableUI<E, D, UI>> extends ContentUIInitializer<E, UI> {
public static final String CLIENT_PROPERTY_TABLE_PROPERTY_NAME = "tablePropertyName";
@@ -71,7 +71,7 @@ public class ContentTableUIInitializer<E extends IdDto, D extends IdDto, UI exte
return ui.getModel();
}
- protected ContentTableUIHandler<E, D> getHandler() {
+ protected ContentTableUIHandler<E, D, UI> getHandler() {
return ui.getHandler();
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIModel.java
index fd26972..3209c07 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ContentTableUIModel.java
@@ -94,7 +94,7 @@ public abstract class ContentTableUIModel<E extends IdDto, D extends IdDto> exte
this.selectionModel = new ContentTableListSelectionModel();
}
- public static <E extends IdDto, D extends IdDto> ContentTableUIModel<E, D> newModel(ObserveContentTableUI<E, D> ui) {
+ public static <E extends IdDto, D extends IdDto> ContentTableUIModel<E, D> newModel(ObserveContentTableUI<E, D, ?> ui) {
String uiName = ui.getClass().getName();
String modelName = uiName + "Model";
@@ -110,13 +110,13 @@ public abstract class ContentTableUIModel<E extends IdDto, D extends IdDto> exte
}
- public void initModel(ObserveContentTableUI<E, D> ui, List<ContentTableMeta<D>> metas) {
+ public void initModel(ObserveContentTableUI<E, D, ?> ui, List<ContentTableMeta<D>> metas) {
this.tableModel = createTableModel(ui, metas);
}
- protected abstract ContentTableModel<E, D> createTableModel(ObserveContentTableUI<E, D> ui, List<ContentTableMeta<D>> metas) ;
+ protected abstract ContentTableModel<E, D> createTableModel(ObserveContentTableUI<E, D, ?> ui, List<ContentTableMeta<D>> metas) ;
public Class<D> getChildType() {
return childType;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ObserveContentTableUI.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ObserveContentTableUI.java
index 30feeeb..951482a 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ObserveContentTableUI.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/ObserveContentTableUI.java
@@ -35,9 +35,9 @@ import javax.swing.*;
* @author Tony Chemit - chemit(a)codelutin.com
* @since XXX
*/
-public interface ObserveContentTableUI<E extends IdDto, D extends IdDto> extends ObserveContentUI<E> {
+public interface ObserveContentTableUI<E extends IdDto, D extends IdDto, U extends ContentTableUI<E,D, U>> extends ObserveContentUI<E> {
- ContentTableUIHandler<E, D> getHandler();
+ ContentTableUIHandler<E, D, U> getHandler();
ContentTableUIModel<E, D> getModel();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BaitsCompositionUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BaitsCompositionUI.jaxx
index c417e00..5bab278 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BaitsCompositionUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BaitsCompositionUI.jaxx
@@ -19,10 +19,10 @@
-->
<fr.ird.observe.application.swing.ui.content.table.ContentTableUI
- superGenericType='SetLonglineGlobalCompositionDto, BaitsCompositionDto'
- contentTitle='{n("observe.content.baitsComposition.title")}'
- saveNewEntryText='{n("observe.content.baitsComposition.action.create")}'
- saveNewEntryTip='{n("observe.content.baitsComposition.action.create.tip")}'>
+ superGenericType='SetLonglineGlobalCompositionDto, BaitsCompositionDto, BaitsCompositionUI'
+ contentTitle='{n("observe.content.baitsComposition.title")}'
+ saveNewEntryText='{n("observe.content.baitsComposition.action.create")}'
+ saveNewEntryTip='{n("observe.content.baitsComposition.action.create.tip")}'>
<style source="../../CommonTable.jcss"/>
@@ -64,9 +64,8 @@
</BeanValidator>
<!-- le validateur d'une entrée de tableau -->
- <BeanValidator id='validatorTable' autoField='true' context='ui-update'
- beanClass='fr.ird.observe.services.dto.longline.BaitsCompositionDto'
- errorTableModel='{getErrorTableModel()}'/>
+ <BeanValidator id='validatorTable' autoField='true' context='ui-update' errorTableModel='{getErrorTableModel()}'
+ beanClass='fr.ird.observe.services.dto.longline.BaitsCompositionDto'/>
<Table id='editorPanel' fill='both' insets='1'>
@@ -76,7 +75,8 @@
<JLabel id='baitTypeLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='baitType' constructorParams='this' genericType='ReferentialReference<BaitTypeDto>' _entityClass='BaitTypeDto.class'/>
+ <BeanComboBox id='baitType' constructorParams='this' genericType='ReferentialReference<BaitTypeDto>'
+ _entityClass='BaitTypeDto.class'/>
</cell>
</row>
@@ -86,7 +86,8 @@
<JLabel id='baitSettingStatusLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='baitSettingStatus' constructorParams='this' genericType='ReferentialReference<BaitSettingStatusDto>' _entityClass='BaitSettingStatusDto.class'/>
+ <BeanComboBox id='baitSettingStatus' constructorParams='this' _entityClass='BaitSettingStatusDto.class'
+ genericType='ReferentialReference<BaitSettingStatusDto>'/>
</cell>
</row>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BaitsCompositionUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BaitsCompositionUIHandler.java
index d1da929..13377c4 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BaitsCompositionUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BaitsCompositionUIHandler.java
@@ -35,6 +35,8 @@ import org.apache.commons.logging.LogFactory;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
+import java.awt.FocusTraversalPolicy;
+
import static org.nuiton.i18n.I18n.n;
/**
@@ -43,7 +45,7 @@ import static org.nuiton.i18n.I18n.n;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.9
*/
-public class BaitsCompositionUIHandler extends ContentTableUIHandler<SetLonglineGlobalCompositionDto, BaitsCompositionDto> {
+public class BaitsCompositionUIHandler extends ContentTableUIHandler<SetLonglineGlobalCompositionDto, BaitsCompositionDto, BaitsCompositionUI> {
/** Logger */
private static final Log log = LogFactory.getLog(BaitsCompositionUIHandler.class);
@@ -53,8 +55,8 @@ public class BaitsCompositionUIHandler extends ContentTableUIHandler<SetLongline
}
@Override
- public BaitsCompositionUI getUi() {
- return (BaitsCompositionUI) super.getUi();
+ protected FocusTraversalPolicy createFocusTraversalPolicy(BaitsCompositionUI ui) {
+ return null;
}
@Override
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BaitsCompositionUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BaitsCompositionUIModel.java
index ef1e396..07fe92f 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BaitsCompositionUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BaitsCompositionUIModel.java
@@ -22,15 +22,15 @@ package fr.ird.observe.application.swing.ui.content.table.impl.longline;
* #L%
*/
-import com.google.common.collect.Lists;
-import fr.ird.observe.services.dto.longline.BaitsCompositionDto;
-import fr.ird.observe.services.dto.longline.BaitsCompositionHelper;
-import fr.ird.observe.services.dto.longline.SetLonglineGlobalCompositionDto;
import fr.ird.observe.application.swing.ui.content.table.ContentTableMeta;
import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
import fr.ird.observe.application.swing.ui.content.table.ContentTableUIModel;
import fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI;
+import fr.ird.observe.services.dto.longline.BaitsCompositionDto;
+import fr.ird.observe.services.dto.longline.BaitsCompositionHelper;
+import fr.ird.observe.services.dto.longline.SetLonglineGlobalCompositionDto;
+import java.util.Arrays;
import java.util.Collection;
import java.util.List;
@@ -51,12 +51,12 @@ public class BaitsCompositionUIModel extends ContentTableUIModel<SetLonglineGlob
SetLonglineGlobalCompositionDto.PROPERTY_BAITS_COMPOSITION
},
new String[]{BaitsCompositionDto.PROPERTY_BAIT_TYPE,
- BaitsCompositionDto.PROPERTY_BAIT_SETTING_STATUS,
- BaitsCompositionDto.PROPERTY_INDIVIDUAL_SIZE,
- BaitsCompositionDto.PROPERTY_INDIVIDUAL_WEIGHT,
- BaitsCompositionDto.PROPERTY_PROPORTION});
+ BaitsCompositionDto.PROPERTY_BAIT_SETTING_STATUS,
+ BaitsCompositionDto.PROPERTY_INDIVIDUAL_SIZE,
+ BaitsCompositionDto.PROPERTY_INDIVIDUAL_WEIGHT,
+ BaitsCompositionDto.PROPERTY_PROPORTION});
- List<ContentTableMeta<BaitsCompositionDto>> metas = Lists.newArrayList(
+ List<ContentTableMeta<BaitsCompositionDto>> metas = Arrays.asList(
ContentTableModel.newTableMeta(BaitsCompositionDto.class, BaitsCompositionDto.PROPERTY_BAIT_TYPE, false),
ContentTableModel.newTableMeta(BaitsCompositionDto.class, BaitsCompositionDto.PROPERTY_BAIT_SETTING_STATUS, false),
ContentTableModel.newTableMeta(BaitsCompositionDto.class, BaitsCompositionDto.PROPERTY_INDIVIDUAL_SIZE, false),
@@ -69,7 +69,7 @@ public class BaitsCompositionUIModel extends ContentTableUIModel<SetLonglineGlob
@Override
protected ContentTableModel<SetLonglineGlobalCompositionDto, BaitsCompositionDto> createTableModel(
- ObserveContentTableUI<SetLonglineGlobalCompositionDto, BaitsCompositionDto> ui,
+ ObserveContentTableUI<SetLonglineGlobalCompositionDto, BaitsCompositionDto, ?> ui,
List<ContentTableMeta<BaitsCompositionDto>> contentTableMetas) {
return new ContentTableModel<SetLonglineGlobalCompositionDto, BaitsCompositionDto>(ui, contentTableMetas) {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BranchlinesCompositionUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BranchlinesCompositionUI.jaxx
index c68aea7..5994fbc 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BranchlinesCompositionUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BranchlinesCompositionUI.jaxx
@@ -19,10 +19,10 @@
-->
<fr.ird.observe.application.swing.ui.content.table.ContentTableUI
- superGenericType='SetLonglineGlobalCompositionDto, BranchlinesCompositionDto'
- contentTitle='{n("observe.content.branchlinesComposition.title")}'
- saveNewEntryText='{n("observe.content.branchlinesComposition.action.create")}'
- saveNewEntryTip='{n("observe.content.branchlinesComposition.action.create.tip")}'>
+ superGenericType='SetLonglineGlobalCompositionDto, BranchlinesCompositionDto, BranchlinesCompositionUI'
+ contentTitle='{n("observe.content.branchlinesComposition.title")}'
+ saveNewEntryText='{n("observe.content.branchlinesComposition.action.create")}'
+ saveNewEntryTip='{n("observe.content.branchlinesComposition.action.create.tip")}'>
<style source="../../CommonTable.jcss"/>
@@ -63,9 +63,8 @@
</BeanValidator>
<!-- le validateur d'une entrée de tableau -->
- <BeanValidator id='validatorTable' autoField='true' context='ui-update'
- beanClass='fr.ird.observe.services.dto.longline.BranchlinesCompositionDto'
- errorTableModel='{getErrorTableModel()}'/>
+ <BeanValidator id='validatorTable' autoField='true' context='ui-update' errorTableModel='{getErrorTableModel()}'
+ beanClass='fr.ird.observe.services.dto.longline.BranchlinesCompositionDto'/>
<Table id='editorPanel' fill='both' insets='1'>
@@ -75,7 +74,8 @@
<JLabel id='topTypeLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='topType' constructorParams='this' genericType='ReferentialReference<LineTypeDto>' _entityClass='LineTypeDto.class'/>
+ <BeanComboBox id='topType' constructorParams='this' genericType='ReferentialReference<LineTypeDto>'
+ _entityClass='LineTypeDto.class'/>
</cell>
</row>
@@ -85,7 +85,8 @@
<JLabel id='tracelineTypeLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='tracelineType' constructorParams='this' genericType='ReferentialReference<LineTypeDto>' _entityClass='LineTypeDto.class'/>
+ <BeanComboBox id='tracelineType' constructorParams='this' genericType='ReferentialReference<LineTypeDto>'
+ _entityClass='LineTypeDto.class'/>
</cell>
</row>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BranchlinesCompositionUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BranchlinesCompositionUIHandler.java
index 259ba83..a0d947c 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BranchlinesCompositionUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BranchlinesCompositionUIHandler.java
@@ -35,6 +35,8 @@ import org.apache.commons.logging.LogFactory;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
+import java.awt.FocusTraversalPolicy;
+
import static org.nuiton.i18n.I18n.n;
/**
@@ -43,7 +45,7 @@ import static org.nuiton.i18n.I18n.n;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.9
*/
-public class BranchlinesCompositionUIHandler extends ContentTableUIHandler<SetLonglineGlobalCompositionDto, BranchlinesCompositionDto> {
+public class BranchlinesCompositionUIHandler extends ContentTableUIHandler<SetLonglineGlobalCompositionDto, BranchlinesCompositionDto, BranchlinesCompositionUI> {
/** Logger */
private static final Log log = LogFactory.getLog(BranchlinesCompositionUIHandler.class);
@@ -53,8 +55,8 @@ public class BranchlinesCompositionUIHandler extends ContentTableUIHandler<SetLo
}
@Override
- public BranchlinesCompositionUI getUi() {
- return (BranchlinesCompositionUI) super.getUi();
+ protected FocusTraversalPolicy createFocusTraversalPolicy(BranchlinesCompositionUI ui) {
+ return null;
}
@Override
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BranchlinesCompositionUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BranchlinesCompositionUIModel.java
index b757b51..9193e9f 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BranchlinesCompositionUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/BranchlinesCompositionUIModel.java
@@ -22,15 +22,15 @@ package fr.ird.observe.application.swing.ui.content.table.impl.longline;
* #L%
*/
-import com.google.common.collect.Lists;
-import fr.ird.observe.services.dto.longline.BranchlinesCompositionDto;
-import fr.ird.observe.services.dto.longline.BranchlinesCompositionHelper;
-import fr.ird.observe.services.dto.longline.SetLonglineGlobalCompositionDto;
import fr.ird.observe.application.swing.ui.content.table.ContentTableMeta;
import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
import fr.ird.observe.application.swing.ui.content.table.ContentTableUIModel;
import fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI;
+import fr.ird.observe.services.dto.longline.BranchlinesCompositionDto;
+import fr.ird.observe.services.dto.longline.BranchlinesCompositionHelper;
+import fr.ird.observe.services.dto.longline.SetLonglineGlobalCompositionDto;
+import java.util.Arrays;
import java.util.Collection;
import java.util.List;
@@ -51,12 +51,12 @@ public class BranchlinesCompositionUIModel extends ContentTableUIModel<SetLongli
SetLonglineGlobalCompositionDto.PROPERTY_BRANCHLINES_COMPOSITION
},
new String[]{BranchlinesCompositionDto.PROPERTY_TOP_TYPE,
- BranchlinesCompositionDto.PROPERTY_TRACELINE_TYPE,
- BranchlinesCompositionDto.PROPERTY_LENGTH,
- BranchlinesCompositionDto.PROPERTY_TRACELINE_LENGTH,
- BranchlinesCompositionDto.PROPERTY_PROPORTION});
+ BranchlinesCompositionDto.PROPERTY_TRACELINE_TYPE,
+ BranchlinesCompositionDto.PROPERTY_LENGTH,
+ BranchlinesCompositionDto.PROPERTY_TRACELINE_LENGTH,
+ BranchlinesCompositionDto.PROPERTY_PROPORTION});
- List<ContentTableMeta<BranchlinesCompositionDto>> metas = Lists.newArrayList(
+ List<ContentTableMeta<BranchlinesCompositionDto>> metas = Arrays.asList(
ContentTableModel.newTableMeta(BranchlinesCompositionDto.class, BranchlinesCompositionDto.PROPERTY_TOP_TYPE, false),
ContentTableModel.newTableMeta(BranchlinesCompositionDto.class, BranchlinesCompositionDto.PROPERTY_TRACELINE_TYPE, false),
ContentTableModel.newTableMeta(BranchlinesCompositionDto.class, BranchlinesCompositionDto.PROPERTY_LENGTH, false),
@@ -70,7 +70,7 @@ public class BranchlinesCompositionUIModel extends ContentTableUIModel<SetLongli
@Override
protected ContentTableModel<SetLonglineGlobalCompositionDto, BranchlinesCompositionDto> createTableModel(
- ObserveContentTableUI<SetLonglineGlobalCompositionDto, BranchlinesCompositionDto> ui,
+ ObserveContentTableUI<SetLonglineGlobalCompositionDto, BranchlinesCompositionDto, ?> ui,
List<ContentTableMeta<BranchlinesCompositionDto>> contentTableMetas) {
return new ContentTableModel<SetLonglineGlobalCompositionDto, BranchlinesCompositionDto>(ui, contentTableMetas) {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/CatchLonglineTableModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/CatchLonglineTableModel.java
index 5099fdd..f4d81e1 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/CatchLonglineTableModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/CatchLonglineTableModel.java
@@ -33,7 +33,6 @@ import fr.ird.observe.services.dto.longline.WeightMeasureDto;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.swing.SwingUtilities;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
@@ -51,7 +50,7 @@ public class CatchLonglineTableModel extends ContentTableModel<SetLonglineCatchD
private static final long serialVersionUID = 1L;
- public CatchLonglineTableModel(ObserveContentTableUI<SetLonglineCatchDto, CatchLonglineDto> context,
+ public CatchLonglineTableModel(ObserveContentTableUI<SetLonglineCatchDto, CatchLonglineDto, ?> context,
List<ContentTableMeta<CatchLonglineDto>> contentTableMetas) {
super(context, contentTableMetas);
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/CatchLonglineUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/CatchLonglineUI.jaxx
index 7499479..3449fb4 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/CatchLonglineUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/CatchLonglineUI.jaxx
@@ -20,12 +20,13 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.table.ContentTableUI superGenericType='SetLonglineCatchDto, CatchLonglineDto'
- contentTitle='{n("observe.content.catchLongline.title")}'
- newEntryText='{n("observe.content.catchLongline.action.new")}'
- newEntryTip='{n("observe.content.catchLongline.action.new.tip")}'
- saveNewEntryText='{n("observe.content.catchLongline.action.create")}'
- saveNewEntryTip='{n("observe.content.catchLongline.action.create.tip")}'>
+<fr.ird.observe.application.swing.ui.content.table.ContentTableUI
+ superGenericType='SetLonglineCatchDto, CatchLonglineDto, CatchLonglineUI'
+ contentTitle='{n("observe.content.catchLongline.title")}'
+ newEntryText='{n("observe.content.catchLongline.action.new")}'
+ newEntryTip='{n("observe.content.catchLongline.action.new.tip")}'
+ saveNewEntryText='{n("observe.content.catchLongline.action.create")}'
+ saveNewEntryTip='{n("observe.content.catchLongline.action.create.tip")}'>
<style source="../../CommonTable.jcss"/>
@@ -156,7 +157,8 @@
<JLabel id='sectionLabel'/>
</cell>
<cell fill="both" weightx="1">
- <BeanComboBox id='section' genericType='DataReference<SectionDto>' _entityClass='SectionDto.class' constructorParams='this'/>
+ <BeanComboBox id='section' genericType='DataReference<SectionDto>'
+ _entityClass='SectionDto.class' constructorParams='this'/>
</cell>
</row>
<row>
@@ -164,7 +166,8 @@
<JLabel id='basketLabel'/>
</cell>
<cell fill="both" weightx="1">
- <BeanComboBox id='basket' genericType='DataReference<BasketDto>' _entityClass='BasketDto.class' constructorParams='this'/>
+ <BeanComboBox id='basket' genericType='DataReference<BasketDto>'
+ _entityClass='BasketDto.class' constructorParams='this'/>
</cell>
</row>
<row>
@@ -172,7 +175,8 @@
<JLabel id='branchlineLabel'/>
</cell>
<cell fill="both" weightx="1">
- <BeanComboBox id='branchline' genericType='DataReference<BranchlineDto>' _entityClass='BranchlineDto.class' constructorParams='this'/>
+ <BeanComboBox id='branchline' genericType='DataReference<BranchlineDto>'
+ _entityClass='BranchlineDto.class' constructorParams='this'/>
</cell>
</row>
</Table>
@@ -187,7 +191,8 @@
<JLabel id='speciesCatchLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='speciesCatch' genericType='ReferentialReference<SpeciesDto>' _entityClass='SpeciesDto.class' constructorParams='this'/>
+ <BeanComboBox id='speciesCatch' genericType='ReferentialReference<SpeciesDto>'
+ _entityClass='SpeciesDto.class' constructorParams='this'/>
</cell>
<cell anchor='west'>
<JLabel id='tagNumberLabel'/>
@@ -226,13 +231,17 @@
<JLabel id='catchHealthnessLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='catchHealthness' constructorParams='this' genericType='ReferentialReference<HealthnessDto>' _entityClass='HealthnessDto.class'/>
+ <BeanComboBox id='catchHealthness' constructorParams='this'
+ genericType='ReferentialReference<HealthnessDto>'
+ _entityClass='HealthnessDto.class'/>
</cell>
<cell>
<JLabel id='hookPositionLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='hookPosition' constructorParams='this' genericType='ReferentialReference<HookPositionDto>' _entityClass='HookPositionDto.class'/>
+ <BeanComboBox id='hookPosition' constructorParams='this'
+ genericType='ReferentialReference<HookPositionDto>'
+ _entityClass='HookPositionDto.class'/>
</cell>
</row>
@@ -243,13 +252,17 @@
<JLabel id='catchFateLonglineLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='catchFateLongline' constructorParams='this' genericType='ReferentialReference<CatchFateLonglineDto>' _entityClass='CatchFateLonglineDto.class'/>
+ <BeanComboBox id='catchFateLongline' constructorParams='this'
+ genericType='ReferentialReference<CatchFateLonglineDto>'
+ _entityClass='CatchFateLonglineDto.class'/>
</cell>
<cell>
<JLabel id='discardHealthnessLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='discardHealthness' constructorParams='this' genericType='ReferentialReference<HealthnessDto>' _entityClass='HealthnessDto.class'/>
+ <BeanComboBox id='discardHealthness' constructorParams='this'
+ genericType='ReferentialReference<HealthnessDto>'
+ _entityClass='HealthnessDto.class'/>
</cell>
</row>
@@ -303,7 +316,8 @@
<row>
<cell columns="2" fill="both" weighty="0.7">
<JScrollPane id='predatorPane'>
- <FilterableDoubleList id='predator' genericType='ReferentialReference<SpeciesDto>' _entityClass='SpeciesDto.class'/>
+ <FilterableDoubleList id='predator' genericType='ReferentialReference<SpeciesDto>'
+ _entityClass='SpeciesDto.class'/>
</JScrollPane>
</cell>
</row>
@@ -322,7 +336,9 @@
<JLabel id='stomacFullnessLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='stomacFullness' constructorParams='this' genericType='ReferentialReference<StomacFullnessDto>' _entityClass='StomacFullnessDto.class'/>
+ <BeanComboBox id='stomacFullness' constructorParams='this'
+ genericType='ReferentialReference<StomacFullnessDto>'
+ _entityClass='StomacFullnessDto.class'/>
</cell>
</row>
@@ -332,7 +348,8 @@
<JLabel id='sexLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='sex' constructorParams='this' genericType='ReferentialReference<SexDto>' _entityClass='SexDto.class'/>
+ <BeanComboBox id='sex' constructorParams='this' genericType='ReferentialReference<SexDto>'
+ _entityClass='SexDto.class'/>
</cell>
</row>
@@ -342,7 +359,9 @@
<JLabel id='maturityStatusLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='maturityStatus' constructorParams='this' genericType='ReferentialReference<MaturityStatusDto>' _entityClass='MaturityStatusDto.class'/>
+ <BeanComboBox id='maturityStatus' constructorParams='this'
+ genericType='ReferentialReference<MaturityStatusDto>'
+ _entityClass='MaturityStatusDto.class'/>
</cell>
</row>
@@ -422,7 +441,9 @@
<JLabel id='baitHaulingStatusLabel'/>
</cell>
<cell anchor='east' weightx="1" fill="both" columns="2">
- <BeanComboBox id='baitHaulingStatus' constructorParams='this' genericType='ReferentialReference<BaitHaulingStatusDto>' _entityClass='BaitHaulingStatusDto.class'/>
+ <BeanComboBox id='baitHaulingStatus' constructorParams='this'
+ genericType='ReferentialReference<BaitHaulingStatusDto>'
+ _entityClass='BaitHaulingStatusDto.class'/>
</cell>
</row>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/CatchLonglineUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/CatchLonglineUIHandler.java
index 2cf0545..2ed9f6d 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/CatchLonglineUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/CatchLonglineUIHandler.java
@@ -52,11 +52,11 @@ import fr.ird.observe.services.dto.longline.WeightMeasureDto;
import fr.ird.observe.services.dto.referential.ReferentialDto;
import fr.ird.observe.services.dto.referential.ReferentialReference;
import fr.ird.observe.services.dto.referential.ReferentialReferences;
+import fr.ird.observe.services.dto.referential.SizeMeasureTypeDto;
import fr.ird.observe.services.dto.referential.SpeciesDto;
+import fr.ird.observe.services.dto.referential.WeightMeasureTypeDto;
import fr.ird.observe.services.dto.referential.longline.CatchFateLonglineDto;
import fr.ird.observe.services.dto.referential.longline.HealthnessDto;
-import fr.ird.observe.services.dto.referential.SizeMeasureTypeDto;
-import fr.ird.observe.services.dto.referential.WeightMeasureTypeDto;
import fr.ird.observe.services.dto.result.SaveResultDto;
import fr.ird.observe.services.service.data.longline.BranchlineService;
import fr.ird.observe.services.service.data.longline.SetLonglineCatchService;
@@ -76,8 +76,12 @@ import javax.swing.JOptionPane;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
import javax.swing.JTable;
+import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.event.TableModelListener;
import javax.swing.table.DefaultTableCellRenderer;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.FocusTraversalPolicy;
import java.beans.PropertyChangeListener;
import java.util.Calendar;
import java.util.Collection;
@@ -97,7 +101,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.7
*/
-public class CatchLonglineUIHandler extends ContentTableUIHandler<SetLonglineCatchDto, CatchLonglineDto> {
+public class CatchLonglineUIHandler extends ContentTableUIHandler<SetLonglineCatchDto, CatchLonglineDto, CatchLonglineUI> {
/** Logger */
private static final Log log = LogFactory.getLog(CatchLonglineUIHandler.class);
@@ -136,11 +140,6 @@ public class CatchLonglineUIHandler extends ContentTableUIHandler<SetLonglineCat
}
@Override
- public CatchLonglineUI getUi() {
- return (CatchLonglineUI) super.getUi();
- }
-
- @Override
public CatchLonglineUIModel getModel() {
return (CatchLonglineUIModel) super.getModel();
}
@@ -148,7 +147,7 @@ public class CatchLonglineUIHandler extends ContentTableUIHandler<SetLonglineCat
@Override
public void initUI() {
- final CatchLonglineContentTableUIInitializer uiInitializer = new CatchLonglineContentTableUIInitializer(getUi());
+ CatchLonglineContentTableUIInitializer uiInitializer = new CatchLonglineContentTableUIInitializer(getUi());
uiInitializer.initUI();
getModel().addPropertyChangeListener(CatchLonglineUIModel.PROPERTY_SHOW_INDIVIDUAL_TABS, evt -> {
@@ -178,6 +177,84 @@ public class CatchLonglineUIHandler extends ContentTableUIHandler<SetLonglineCat
}
@Override
+ protected FocusTraversalPolicy createFocusTraversalPolicy(CatchLonglineUI ui) {
+ return new LayoutFocusTraversalPolicy() {
+
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ if (getTableModel().isCreate()) {
+ if (aComponent.equals(ui.getAcquisitionModeIndividual())) {
+ return getLastComponent(aContainer);
+ }
+ } else {
+ if (aComponent.equals(ui.getSection().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ }
+
+ case 1:
+ if (aComponent.equals(ui.getDepredated())) {
+ return getLastComponent(aContainer);
+ }
+ case 2:
+ if (aComponent.equals(ui.getStomacFullness().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ case 5:
+ if (aComponent.equals(ui.getDepthRecorder())) {
+ return getLastComponent(aContainer);
+ }
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ if (getTableModel().isCreate()) {
+ return ui.getAcquisitionModeIndividual();
+ } else {
+ return ui.getSection();
+ }
+ case 1:
+ return ui.getDepredated();
+ case 2:
+ return ui.getStomacFullness();
+ case 5:
+ return ui.getDepthRecorder();
+ }
+ return super.getFirstComponent(aContainer);
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ if (ui.getSave().isEnabled()) {
+ return ui.getSave();
+ }
+ if (ui.getReset().isEnabled()) {
+ return ui.getReset();
+ }
+ if (ui.getDeleteEntry().isEnabled()) {
+ return ui.getDeleteEntry();
+ }
+ if (ui.getSaveNewEntry().isEnabled()) {
+ return ui.getSaveNewEntry();
+ }
+ if (ui.getResetEntry().isEnabled()) {
+ return ui.getResetEntry();
+ }
+
+ return super.getLastComponent(aContainer);
+ }
+ };
+ }
+
+ @Override
public void openUI() {
if (log.isInfoEnabled()) {
@@ -423,7 +500,7 @@ public class CatchLonglineUIHandler extends ContentTableUIHandler<SetLonglineCat
ui.getFishingOperationTabPane().setSelectedIndex(0);
// select by default individual acquisition mode
- String openTripLonglineId = getDataContext().getOpenTripLonglineId();
+// String openTripLonglineId = getDataContext().getOpenTripLonglineId();
ObserveTreeHelper treeHelper = ObserveSwingApplicationContext.get().getMainUI().getTreeHelper();
ObserveNode selectedNode = treeHelper.getSelectedNode();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/CatchLonglineUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/CatchLonglineUIModel.java
index cc50155..45091d1 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/CatchLonglineUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/CatchLonglineUIModel.java
@@ -23,17 +23,17 @@ package fr.ird.observe.application.swing.ui.content.table.impl.longline;
*/
import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Lists;
-import fr.ird.observe.services.dto.longline.BranchlineDto;
-import fr.ird.observe.services.dto.longline.CatchLonglineDto;
-import fr.ird.observe.services.dto.longline.SetLonglineCatchDto;
import fr.ird.observe.application.swing.ui.content.table.ContentTableMeta;
import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
import fr.ird.observe.application.swing.ui.content.table.ContentTableUIModel;
import fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI;
+import fr.ird.observe.services.dto.longline.BranchlineDto;
+import fr.ird.observe.services.dto.longline.CatchLonglineDto;
+import fr.ird.observe.services.dto.longline.SetLonglineCatchDto;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderModelBuilder;
+import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Set;
@@ -122,35 +122,35 @@ public class CatchLonglineUIModel extends ContentTableUIModel<SetLonglineCatchDt
SetLonglineCatchDto.PROPERTY_CATCH_LONGLINE
},
new String[]{CatchLonglineDto.PROPERTY_SPECIES_CATCH,
- CatchLonglineDto.PROPERTY_ACQUISITION_MODE,
- CatchLonglineDto.PROPERTY_COUNT,
- CatchLonglineDto.PROPERTY_CATCH_HEALTHNESS,
- CatchLonglineDto.PROPERTY_CATCH_FATE_LONGLINE,
- CatchLonglineDto.PROPERTY_DISCARD_HEALTHNESS,
- CatchLonglineDto.PROPERTY_DEPREDATED,
- CatchLonglineDto.PROPERTY_NUMBER,
- CatchLonglineDto.PROPERTY_HOME_ID,
- CatchLonglineDto.PROPERTY_HOOK_POSITION,
- CatchLonglineDto.PROPERTY_HOOK_WHEN_DISCARDED,
- CatchLonglineDto.PROPERTY_MATURITY_STATUS,
- CatchLonglineDto.PROPERTY_PHOTO_REFERENCES,
- CatchLonglineDto.PROPERTY_SEX,
- CatchLonglineDto.PROPERTY_PREDATOR,
- CatchLonglineDto.PROPERTY_STOMAC_FULLNESS,
- CatchLonglineDto.PROPERTY_TOTAL_WEIGHT,
- CatchLonglineDto.PROPERTY_BEAT_DIAMETER,
- CatchLonglineDto.PROPERTY_GONADE_WEIGHT,
- CatchLonglineDto.PROPERTY_SECTION,
- CatchLonglineDto.PROPERTY_BASKET,
- CatchLonglineDto.PROPERTY_BRANCHLINE,
- CatchLonglineDto.PROPERTY_TAG_NUMBER,
- CatchLonglineDto.PROPERTY_COMMENT
+ CatchLonglineDto.PROPERTY_ACQUISITION_MODE,
+ CatchLonglineDto.PROPERTY_COUNT,
+ CatchLonglineDto.PROPERTY_CATCH_HEALTHNESS,
+ CatchLonglineDto.PROPERTY_CATCH_FATE_LONGLINE,
+ CatchLonglineDto.PROPERTY_DISCARD_HEALTHNESS,
+ CatchLonglineDto.PROPERTY_DEPREDATED,
+ CatchLonglineDto.PROPERTY_NUMBER,
+ CatchLonglineDto.PROPERTY_HOME_ID,
+ CatchLonglineDto.PROPERTY_HOOK_POSITION,
+ CatchLonglineDto.PROPERTY_HOOK_WHEN_DISCARDED,
+ CatchLonglineDto.PROPERTY_MATURITY_STATUS,
+ CatchLonglineDto.PROPERTY_PHOTO_REFERENCES,
+ CatchLonglineDto.PROPERTY_SEX,
+ CatchLonglineDto.PROPERTY_PREDATOR,
+ CatchLonglineDto.PROPERTY_STOMAC_FULLNESS,
+ CatchLonglineDto.PROPERTY_TOTAL_WEIGHT,
+ CatchLonglineDto.PROPERTY_BEAT_DIAMETER,
+ CatchLonglineDto.PROPERTY_GONADE_WEIGHT,
+ CatchLonglineDto.PROPERTY_SECTION,
+ CatchLonglineDto.PROPERTY_BASKET,
+ CatchLonglineDto.PROPERTY_BRANCHLINE,
+ CatchLonglineDto.PROPERTY_TAG_NUMBER,
+ CatchLonglineDto.PROPERTY_COMMENT
});
this.sizeMeasuresTableModel = new SizeMeasuresTableModel();
this.weightMeasuresTableModel = new WeightMeasuresTableModel();
- List<ContentTableMeta<CatchLonglineDto>> metas = Lists.newArrayList(
+ List<ContentTableMeta<CatchLonglineDto>> metas = Arrays.asList(
ContentTableModel.newTableMeta(CatchLonglineDto.class, CatchLonglineDto.PROPERTY_SECTION, false),
ContentTableModel.newTableMeta(CatchLonglineDto.class, CatchLonglineDto.PROPERTY_BASKET, false),
ContentTableModel.newTableMeta(CatchLonglineDto.class, CatchLonglineDto.PROPERTY_BRANCHLINE, false),
@@ -232,7 +232,7 @@ public class CatchLonglineUIModel extends ContentTableUIModel<SetLonglineCatchDt
}
@Override
- protected ContentTableModel<SetLonglineCatchDto, CatchLonglineDto> createTableModel(ObserveContentTableUI<SetLonglineCatchDto, CatchLonglineDto> ui, List<ContentTableMeta<CatchLonglineDto>> contentTableMetas) {
+ protected ContentTableModel<SetLonglineCatchDto, CatchLonglineDto> createTableModel(ObserveContentTableUI<SetLonglineCatchDto, CatchLonglineDto, ?> ui, List<ContentTableMeta<CatchLonglineDto>> contentTableMetas) {
return new CatchLonglineTableModel(ui, contentTableMetas);
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/EncounterUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/EncounterUI.jaxx
index 21588ef..673ce69 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/EncounterUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/EncounterUI.jaxx
@@ -19,10 +19,10 @@
-->
<fr.ird.observe.application.swing.ui.content.table.ContentTableUI
- superGenericType='ActivityLonglineEncounterDto, EncounterDto'
- contentTitle='{n("observe.content.encounter.title")}'
- saveNewEntryText='{n("observe.content.encounter.action.create")}'
- saveNewEntryTip='{n("observe.content.encounter.action.create.tip")}'>
+ superGenericType='ActivityLonglineEncounterDto, EncounterDto, EncounterUI'
+ contentTitle='{n("observe.content.encounter.title")}'
+ saveNewEntryText='{n("observe.content.encounter.action.create")}'
+ saveNewEntryTip='{n("observe.content.encounter.action.create.tip")}'>
<style source="../../CommonTable.jcss"/>
@@ -77,7 +77,8 @@
<JLabel id='encounterTypeLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='encounterType' constructorParams='this' genericType='ReferentialReference<EncounterTypeDto>' _entityClass='EncounterTypeDto.class'/>
+ <BeanComboBox id='encounterType' constructorParams='this'
+ genericType='ReferentialReference<EncounterTypeDto>' _entityClass='EncounterTypeDto.class'/>
</cell>
</row>
@@ -87,7 +88,8 @@
<JLabel id='speciesLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='species' constructorParams='this' genericType='ReferentialReference<SpeciesDto>' _entityClass='SpeciesDto.class'/>
+ <BeanComboBox id='species' constructorParams='this' genericType='ReferentialReference<SpeciesDto>'
+ _entityClass='SpeciesDto.class'/>
</cell>
</row>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/EncounterUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/EncounterUIHandler.java
index 00d6bb7..59063c5 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/EncounterUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/EncounterUIHandler.java
@@ -24,6 +24,8 @@ package fr.ird.observe.application.swing.ui.content.table.impl.longline;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
import fr.ird.observe.application.swing.db.constants.DataContextType;
+import fr.ird.observe.application.swing.ui.UIHelper;
+import fr.ird.observe.application.swing.ui.content.table.ContentTableUIHandler;
import fr.ird.observe.services.dto.Form;
import fr.ird.observe.services.dto.longline.ActivityLonglineEncounterDto;
import fr.ird.observe.services.dto.longline.ActivityLonglineEncounterHelper;
@@ -35,15 +37,17 @@ import fr.ird.observe.services.dto.referential.SpeciesDto;
import fr.ird.observe.services.dto.referential.SpeciesListDto;
import fr.ird.observe.services.dto.referential.longline.EncounterTypeDto;
import fr.ird.observe.services.dto.result.SaveResultDto;
-import fr.ird.observe.services.service.referential.ReferentialService;
import fr.ird.observe.services.service.data.longline.ActivityLongLineEncounterService;
-import fr.ird.observe.application.swing.ui.UIHelper;
-import fr.ird.observe.application.swing.ui.content.table.ContentTableUIHandler;
+import fr.ird.observe.services.service.referential.ReferentialService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.swing.JTable;
+import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.table.DefaultTableCellRenderer;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.FocusTraversalPolicy;
import java.util.Collection;
import java.util.LinkedList;
import java.util.Set;
@@ -56,7 +60,7 @@ import static org.nuiton.i18n.I18n.n;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.7
*/
-public class EncounterUIHandler extends ContentTableUIHandler<ActivityLonglineEncounterDto, EncounterDto> {
+public class EncounterUIHandler extends ContentTableUIHandler<ActivityLonglineEncounterDto, EncounterDto, EncounterUI> {
/** Logger */
private static final Log log = LogFactory.getLog(EncounterUIHandler.class);
@@ -66,11 +70,6 @@ public class EncounterUIHandler extends ContentTableUIHandler<ActivityLonglineEn
}
@Override
- public EncounterUI getUi() {
- return (EncounterUI) super.getUi();
- }
-
- @Override
protected void onSelectedRowChanged(int editingRow, EncounterDto bean, boolean create) {
if (getTableModel().isEditable()) {
if (log.isDebugEnabled()) {
@@ -81,6 +80,36 @@ public class EncounterUIHandler extends ContentTableUIHandler<ActivityLonglineEn
}
@Override
+ protected FocusTraversalPolicy createFocusTraversalPolicy(EncounterUI ui) {
+ return new LayoutFocusTraversalPolicy() {
+
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ if (aComponent.equals(ui.getEncounterType().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ return ui.getEncounterType();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ if (ui.getSave().isEnabled()) {
+ return ui.getSave();
+ }
+ if (ui.getReset().isEnabled()) {
+ return ui.getReset();
+ }
+ return ui.getComment2();
+ }
+ };
+ }
+
+ @Override
protected void initTableUI(DefaultTableCellRenderer renderer) {
JTable table = getUi().getTable();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/EncounterUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/EncounterUIModel.java
index e5ea568..0da0597 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/EncounterUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/EncounterUIModel.java
@@ -22,15 +22,15 @@ package fr.ird.observe.application.swing.ui.content.table.impl.longline;
* #L%
*/
-import com.google.common.collect.Lists;
-import fr.ird.observe.services.dto.longline.ActivityLonglineEncounterDto;
-import fr.ird.observe.services.dto.longline.EncounterDto;
-import fr.ird.observe.services.dto.longline.EncounterHelper;
import fr.ird.observe.application.swing.ui.content.table.ContentTableMeta;
import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
import fr.ird.observe.application.swing.ui.content.table.ContentTableUIModel;
import fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI;
+import fr.ird.observe.services.dto.longline.ActivityLonglineEncounterDto;
+import fr.ird.observe.services.dto.longline.EncounterDto;
+import fr.ird.observe.services.dto.longline.EncounterHelper;
+import java.util.Arrays;
import java.util.Collection;
import java.util.List;
@@ -56,7 +56,7 @@ public class EncounterUIModel extends ContentTableUIModel<ActivityLonglineEncoun
EncounterDto.PROPERTY_COUNT,
EncounterDto.PROPERTY_ENCOUNTER_TYPE});
- List<ContentTableMeta<EncounterDto>> metas = Lists.newArrayList(
+ List<ContentTableMeta<EncounterDto>> metas = Arrays.asList(
ContentTableModel.newTableMeta(EncounterDto.class, EncounterDto.PROPERTY_ENCOUNTER_TYPE, false),
ContentTableModel.newTableMeta(EncounterDto.class, EncounterDto.PROPERTY_SPECIES, false),
ContentTableModel.newTableMeta(EncounterDto.class, EncounterDto.PROPERTY_DISTANCE, false),
@@ -68,7 +68,7 @@ public class EncounterUIModel extends ContentTableUIModel<ActivityLonglineEncoun
@Override
protected ContentTableModel<ActivityLonglineEncounterDto, EncounterDto> createTableModel(
- ObserveContentTableUI<ActivityLonglineEncounterDto, EncounterDto> ui,
+ ObserveContentTableUI<ActivityLonglineEncounterDto, EncounterDto, ?> ui,
List<ContentTableMeta<EncounterDto>> contentTableMetas) {
return new ContentTableModel<ActivityLonglineEncounterDto, EncounterDto>(ui, contentTableMetas) {
private static final long serialVersionUID = 1L;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/FloatlinesCompositionUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/FloatlinesCompositionUI.jaxx
index 6e42e3b..2851019 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/FloatlinesCompositionUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/FloatlinesCompositionUI.jaxx
@@ -19,10 +19,10 @@
-->
<fr.ird.observe.application.swing.ui.content.table.ContentTableUI
- superGenericType='SetLonglineGlobalCompositionDto, FloatlinesCompositionDto'
- contentTitle='{n("observe.content.floatlinesComposition.title")}'
- saveNewEntryText='{n("observe.content.floatlinesComposition.action.create")}'
- saveNewEntryTip='{n("observe.content.floatlinesComposition.action.create.tip")}'>
+ superGenericType='SetLonglineGlobalCompositionDto, FloatlinesCompositionDto, FloatlinesCompositionUI'
+ contentTitle='{n("observe.content.floatlinesComposition.title")}'
+ saveNewEntryText='{n("observe.content.floatlinesComposition.action.create")}'
+ saveNewEntryTip='{n("observe.content.floatlinesComposition.action.create.tip")}'>
<style source="../../CommonTable.jcss"/>
@@ -64,9 +64,8 @@
</BeanValidator>
<!-- le validateur d'une entrée de tableau -->
- <BeanValidator id='validatorTable' autoField='true' context='ui-update'
- beanClass='fr.ird.observe.services.dto.longline.FloatlinesCompositionDto'
- errorTableModel='{getErrorTableModel()}'/>
+ <BeanValidator id='validatorTable' autoField='true' context='ui-update' errorTableModel='{getErrorTableModel()}'
+ beanClass='fr.ird.observe.services.dto.longline.FloatlinesCompositionDto'/>
<Table id='editorPanel' fill='both' insets='1'>
@@ -76,7 +75,8 @@
<JLabel id='lineTypeLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='lineType' constructorParams='this' genericType='ReferentialReference<LineTypeDto>' _entityClass='LineTypeDto.class'/>
+ <BeanComboBox id='lineType' constructorParams='this' genericType='ReferentialReference<LineTypeDto>'
+ _entityClass='LineTypeDto.class'/>
</cell>
</row>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/FloatlinesCompositionUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/FloatlinesCompositionUIHandler.java
index 5de05fa..c402d38 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/FloatlinesCompositionUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/FloatlinesCompositionUIHandler.java
@@ -34,6 +34,8 @@ import org.apache.commons.logging.LogFactory;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
+import java.awt.FocusTraversalPolicy;
+
import static org.nuiton.i18n.I18n.n;
/**
@@ -42,7 +44,7 @@ import static org.nuiton.i18n.I18n.n;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.9
*/
-public class FloatlinesCompositionUIHandler extends ContentTableUIHandler<SetLonglineGlobalCompositionDto, FloatlinesCompositionDto> {
+public class FloatlinesCompositionUIHandler extends ContentTableUIHandler<SetLonglineGlobalCompositionDto, FloatlinesCompositionDto, FloatlinesCompositionUI> {
/** Logger */
private static final Log log = LogFactory.getLog(FloatlinesCompositionUIHandler.class);
@@ -52,8 +54,8 @@ public class FloatlinesCompositionUIHandler extends ContentTableUIHandler<SetLon
}
@Override
- public FloatlinesCompositionUI getUi() {
- return (FloatlinesCompositionUI) super.getUi();
+ protected FocusTraversalPolicy createFocusTraversalPolicy(FloatlinesCompositionUI ui) {
+ return null;
}
@Override
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/FloatlinesCompositionUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/FloatlinesCompositionUIModel.java
index ca309ba..6cbb411 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/FloatlinesCompositionUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/FloatlinesCompositionUIModel.java
@@ -22,15 +22,15 @@ package fr.ird.observe.application.swing.ui.content.table.impl.longline;
* #L%
*/
-import com.google.common.collect.Lists;
-import fr.ird.observe.services.dto.longline.FloatlinesCompositionDto;
-import fr.ird.observe.services.dto.longline.FloatlinesCompositionHelper;
-import fr.ird.observe.services.dto.longline.SetLonglineGlobalCompositionDto;
import fr.ird.observe.application.swing.ui.content.table.ContentTableMeta;
import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
import fr.ird.observe.application.swing.ui.content.table.ContentTableUIModel;
import fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI;
+import fr.ird.observe.services.dto.longline.FloatlinesCompositionDto;
+import fr.ird.observe.services.dto.longline.FloatlinesCompositionHelper;
+import fr.ird.observe.services.dto.longline.SetLonglineGlobalCompositionDto;
+import java.util.Arrays;
import java.util.Collection;
import java.util.List;
@@ -51,10 +51,10 @@ public class FloatlinesCompositionUIModel extends ContentTableUIModel<SetLonglin
SetLonglineGlobalCompositionDto.PROPERTY_FLOATLINES_COMPOSITION
},
new String[]{FloatlinesCompositionDto.PROPERTY_LINE_TYPE,
- FloatlinesCompositionDto.PROPERTY_LENGTH,
- FloatlinesCompositionDto.PROPERTY_PROPORTION});
+ FloatlinesCompositionDto.PROPERTY_LENGTH,
+ FloatlinesCompositionDto.PROPERTY_PROPORTION});
- List<ContentTableMeta<FloatlinesCompositionDto>> metas = Lists.newArrayList(
+ List<ContentTableMeta<FloatlinesCompositionDto>> metas = Arrays.asList(
ContentTableModel.newTableMeta(FloatlinesCompositionDto.class, FloatlinesCompositionDto.PROPERTY_LINE_TYPE, false),
ContentTableModel.newTableMeta(FloatlinesCompositionDto.class, FloatlinesCompositionDto.PROPERTY_LENGTH, false),
ContentTableModel.newTableMeta(FloatlinesCompositionDto.class, FloatlinesCompositionDto.PROPERTY_PROPORTION, false));
@@ -66,11 +66,12 @@ public class FloatlinesCompositionUIModel extends ContentTableUIModel<SetLonglin
@Override
protected ContentTableModel<SetLonglineGlobalCompositionDto, FloatlinesCompositionDto> createTableModel(
- ObserveContentTableUI<SetLonglineGlobalCompositionDto, FloatlinesCompositionDto> ui,
+ ObserveContentTableUI<SetLonglineGlobalCompositionDto, FloatlinesCompositionDto, ?> ui,
List<ContentTableMeta<FloatlinesCompositionDto>> contentTableMetas) {
return new ContentTableModel<SetLonglineGlobalCompositionDto, FloatlinesCompositionDto>(ui, contentTableMetas) {
private static final long serialVersionUID = 1L;
+
@Override
protected Collection<FloatlinesCompositionDto> getChilds(SetLonglineGlobalCompositionDto bean) {
return bean.getFloatlinesComposition();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/GearUseFeaturesLonglineTableModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/GearUseFeaturesLonglineTableModel.java
index efd69f6..7fafb31 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/GearUseFeaturesLonglineTableModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/GearUseFeaturesLonglineTableModel.java
@@ -23,15 +23,15 @@ package fr.ird.observe.application.swing.ui.content.table.impl.longline;
*/
import com.google.common.collect.Sets;
+import fr.ird.observe.application.swing.ui.content.table.ContentTableMeta;
+import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
+import fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI;
import fr.ird.observe.services.dto.longline.GearUseFeaturesLonglineDto;
import fr.ird.observe.services.dto.longline.GearUseFeaturesLonglineHelper;
import fr.ird.observe.services.dto.longline.GearUseFeaturesMeasurementLonglineDto;
import fr.ird.observe.services.dto.longline.TripLonglineGearUseDto;
import fr.ird.observe.services.dto.referential.GearDto;
import fr.ird.observe.services.dto.referential.ReferentialReference;
-import fr.ird.observe.application.swing.ui.content.table.ContentTableMeta;
-import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
-import fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -54,7 +54,7 @@ public class GearUseFeaturesLonglineTableModel extends ContentTableModel<TripLon
private transient GearUseFeaturesLonglineUIHandler gearUseFeaturesLonglineUIHandler;
- public GearUseFeaturesLonglineTableModel(ObserveContentTableUI<TripLonglineGearUseDto, GearUseFeaturesLonglineDto> context,
+ public GearUseFeaturesLonglineTableModel(ObserveContentTableUI<TripLonglineGearUseDto, GearUseFeaturesLonglineDto, ?> context,
List<ContentTableMeta<GearUseFeaturesLonglineDto>> contentTableMetas) {
super(context, contentTableMetas);
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/GearUseFeaturesLonglineUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/GearUseFeaturesLonglineUI.jaxx
index b7609c4..86b428e 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/GearUseFeaturesLonglineUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/GearUseFeaturesLonglineUI.jaxx
@@ -21,10 +21,10 @@
-->
<fr.ird.observe.application.swing.ui.content.table.ContentTableUI
- superGenericType='TripLonglineGearUseDto, GearUseFeaturesLonglineDto'
- contentTitle='{n("observe.content.gearUseFeaturesLongline.title")}'
- saveNewEntryText='{n("observe.content.action.gearUseFeaturesLongline")}'
- saveNewEntryTip='{n("observe.content.action.gearUseFeaturesLongline.tip")}'>
+ superGenericType='TripLonglineGearUseDto, GearUseFeaturesLonglineDto, GearUseFeaturesLonglineUI'
+ contentTitle='{n("observe.content.gearUseFeaturesLongline.title")}'
+ saveNewEntryText='{n("observe.content.action.gearUseFeaturesLongline")}'
+ saveNewEntryTip='{n("observe.content.action.gearUseFeaturesLongline.tip")}'>
<style source="../../CommonTable.jcss"/>
@@ -32,7 +32,6 @@
fr.ird.observe.services.dto.CommentableDto
fr.ird.observe.services.dto.longline.TripLonglineDto
fr.ird.observe.services.dto.longline.GearUseFeaturesLonglineDto
- fr.ird.observe.services.dto.longline.GearUseFeaturesMeasurementLonglineDto
fr.ird.observe.services.dto.referential.ReferentialReference
fr.ird.observe.services.dto.referential.GearDto
fr.ird.observe.application.swing.ui.content.table.*
@@ -66,17 +65,12 @@
<ContentTableModel id='tableModel'/>
<!-- le validateur de l'écran -->
- <BeanValidator id='validator'
- beanClass='fr.ird.observe.services.dto.longline.TripLonglineGearUseDto'
- errorTableModel='{getErrorTableModel()}'
- context='ui-update'/>
+ <BeanValidator id='validator' beanClass='fr.ird.observe.services.dto.longline.TripLonglineGearUseDto'
+ errorTableModel='{getErrorTableModel()}' context='ui-update'/>
<!-- le validateur d'une entrée de tableau -->
- <BeanValidator id='validatorTable'
- autoField='true'
- beanClass='fr.ird.observe.services.dto.longline.GearUseFeaturesLonglineDto'
- errorTableModel='{getErrorTableModel()}'
- context='ui-update'/>
+ <BeanValidator id='validatorTable' autoField='true' errorTableModel='{getErrorTableModel()}' context='ui-update'
+ beanClass='fr.ird.observe.services.dto.longline.GearUseFeaturesLonglineDto'/>
<JPopupMenu id='measurementsTablePopup'>
<JMenuItem id='addMeasurement' onActionPerformed='getHandler().addMeasurement()'/>
@@ -101,7 +95,8 @@
<JLabel id='gearLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='gear' constructorParams='this' genericType='ReferentialReference<GearDto>' _entityClass='GearDto.class'/>
+ <BeanComboBox id='gear' constructorParams='this' genericType='ReferentialReference<GearDto>'
+ _entityClass='GearDto.class'/>
</cell>
</row>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/GearUseFeaturesLonglineUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/GearUseFeaturesLonglineUIHandler.java
index 097b2ae..13a708d 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/GearUseFeaturesLonglineUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/GearUseFeaturesLonglineUIHandler.java
@@ -45,8 +45,8 @@ import fr.ird.observe.services.dto.referential.GearCaracteristicTypeHelper;
import fr.ird.observe.services.dto.referential.GearDto;
import fr.ird.observe.services.dto.referential.ReferentialReference;
import fr.ird.observe.services.dto.result.SaveResultDto;
-import fr.ird.observe.services.service.referential.ReferentialService;
import fr.ird.observe.services.service.data.longline.TripLonglineGearUseService;
+import fr.ird.observe.services.service.referential.ReferentialService;
import jaxx.runtime.SwingUtil;
import jaxx.runtime.validator.swing.SwingValidatorMessage;
import jaxx.runtime.validator.swing.SwingValidatorMessageTableModel;
@@ -57,8 +57,12 @@ import org.nuiton.validator.NuitonValidatorScope;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JTable;
+import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.event.TableModelListener;
import javax.swing.table.DefaultTableCellRenderer;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.FocusTraversalPolicy;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.beans.PropertyChangeListener;
@@ -78,7 +82,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.16
*/
-public class GearUseFeaturesLonglineUIHandler extends ContentTableUIHandler<TripLonglineGearUseDto, GearUseFeaturesLonglineDto> {
+public class GearUseFeaturesLonglineUIHandler extends ContentTableUIHandler<TripLonglineGearUseDto, GearUseFeaturesLonglineDto, GearUseFeaturesLonglineUI> {
/** Logger */
private static final Log log = LogFactory.getLog(GearUseFeaturesLonglineUIHandler.class);
@@ -100,8 +104,37 @@ public class GearUseFeaturesLonglineUIHandler extends ContentTableUIHandler<Trip
}
@Override
- public GearUseFeaturesLonglineUI getUi() {
- return (GearUseFeaturesLonglineUI) super.getUi();
+ protected FocusTraversalPolicy createFocusTraversalPolicy(GearUseFeaturesLonglineUI ui) {
+
+ return new LayoutFocusTraversalPolicy() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ int selectedIndex = ui.getGearUseFeaturesTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ if (aComponent.equals(ui.getGear().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ int selectedIndex = ui.getGearUseFeaturesTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ return ui.getGear();
+ }
+ return super.getFirstComponent(aContainer);
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ return getDefaultLastComponent(ui, null);
+ }
+ };
+
}
@Override
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/GearUseFeaturesLonglineUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/GearUseFeaturesLonglineUIModel.java
index adb0d7b..a5865fd 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/GearUseFeaturesLonglineUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/GearUseFeaturesLonglineUIModel.java
@@ -23,14 +23,14 @@ package fr.ird.observe.application.swing.ui.content.table.impl.longline;
*/
import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Lists;
-import fr.ird.observe.services.dto.longline.GearUseFeaturesLonglineDto;
-import fr.ird.observe.services.dto.longline.TripLonglineGearUseDto;
import fr.ird.observe.application.swing.ui.content.table.ContentTableMeta;
import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
import fr.ird.observe.application.swing.ui.content.table.ContentTableUIModel;
import fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI;
+import fr.ird.observe.services.dto.longline.GearUseFeaturesLonglineDto;
+import fr.ird.observe.services.dto.longline.TripLonglineGearUseDto;
+import java.util.Arrays;
import java.util.List;
import java.util.Set;
@@ -74,7 +74,7 @@ public class GearUseFeaturesLonglineUIModel extends ContentTableUIModel<TripLong
this.measurementsTableModel = new GearUseFeaturesMeasurementLonglinesTableModel();
- List<ContentTableMeta<GearUseFeaturesLonglineDto>> metas = Lists.newArrayList(
+ List<ContentTableMeta<GearUseFeaturesLonglineDto>> metas = Arrays.asList(
ContentTableModel.newTableMeta(GearUseFeaturesLonglineDto.class, GearUseFeaturesLonglineDto.PROPERTY_GEAR, false),
ContentTableModel.newTableMeta(GearUseFeaturesLonglineDto.class, GearUseFeaturesLonglineDto.PROPERTY_NUMBER, false),
ContentTableModel.newTableMeta(GearUseFeaturesLonglineDto.class, GearUseFeaturesLonglineDto.PROPERTY_USED_IN_TRIP, false),
@@ -86,7 +86,7 @@ public class GearUseFeaturesLonglineUIModel extends ContentTableUIModel<TripLong
}
@Override
- protected GearUseFeaturesLonglineTableModel createTableModel(ObserveContentTableUI<TripLonglineGearUseDto, GearUseFeaturesLonglineDto> ui, List<ContentTableMeta<GearUseFeaturesLonglineDto>> contentTableMetas) {
+ protected GearUseFeaturesLonglineTableModel createTableModel(ObserveContentTableUI<TripLonglineGearUseDto, GearUseFeaturesLonglineDto, ?> ui, List<ContentTableMeta<GearUseFeaturesLonglineDto>> contentTableMetas) {
return new GearUseFeaturesLonglineTableModel(ui, contentTableMetas);
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/HooksCompositionUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/HooksCompositionUI.jaxx
index 7328788..8448aa5 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/HooksCompositionUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/HooksCompositionUI.jaxx
@@ -19,10 +19,10 @@
-->
<fr.ird.observe.application.swing.ui.content.table.ContentTableUI
- superGenericType='SetLonglineGlobalCompositionDto, HooksCompositionDto'
- contentTitle='{n("observe.content.hooksComposition.title")}'
- saveNewEntryText='{n("observe.content.hooksComposition.action.create")}'
- saveNewEntryTip='{n("observe.content.hooksComposition.action.create.tip")}'>
+ superGenericType='SetLonglineGlobalCompositionDto, HooksCompositionDto, HooksCompositionUI'
+ contentTitle='{n("observe.content.hooksComposition.title")}'
+ saveNewEntryText='{n("observe.content.hooksComposition.action.create")}'
+ saveNewEntryTip='{n("observe.content.hooksComposition.action.create.tip")}'>
<style source="../../CommonTable.jcss"/>
@@ -64,9 +64,8 @@
</BeanValidator>
<!-- le validateur d'une entrée de tableau -->
- <BeanValidator id='validatorTable' autoField='true' context='ui-update'
- beanClass='fr.ird.observe.services.dto.longline.HooksCompositionDto'
- errorTableModel='{getErrorTableModel()}'/>
+ <BeanValidator id='validatorTable' autoField='true' context='ui-update' errorTableModel='{getErrorTableModel()}'
+ beanClass='fr.ird.observe.services.dto.longline.HooksCompositionDto'/>
<Table id='editorPanel' fill='both' insets='1'>
@@ -76,7 +75,8 @@
<JLabel id='hookTypeLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='hookType' constructorParams='this' genericType='ReferentialReference<HookTypeDto>' _entityClass='HookTypeDto.class'/>
+ <BeanComboBox id='hookType' constructorParams='this' genericType='ReferentialReference<HookTypeDto>'
+ _entityClass='HookTypeDto.class'/>
</cell>
</row>
@@ -86,11 +86,11 @@
<JLabel id='hookSizeLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='hookSize' constructorParams='this' genericType='ReferentialReference<HookSizeDto>' _entityClass='HookSizeDto.class'/>
+ <BeanComboBox id='hookSize' constructorParams='this' genericType='ReferentialReference<HookSizeDto>'
+ _entityClass='HookSizeDto.class'/>
</cell>
</row>
-
<!-- hookOffset -->
<row>
<cell>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/HooksCompositionUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/HooksCompositionUIHandler.java
index ad25532..e3e2c88 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/HooksCompositionUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/HooksCompositionUIHandler.java
@@ -35,6 +35,8 @@ import org.apache.commons.logging.LogFactory;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
+import java.awt.FocusTraversalPolicy;
+
import static org.nuiton.i18n.I18n.n;
/**
@@ -43,7 +45,7 @@ import static org.nuiton.i18n.I18n.n;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.9
*/
-public class HooksCompositionUIHandler extends ContentTableUIHandler<SetLonglineGlobalCompositionDto, HooksCompositionDto> {
+public class HooksCompositionUIHandler extends ContentTableUIHandler<SetLonglineGlobalCompositionDto, HooksCompositionDto, HooksCompositionUI> {
/** Logger */
private static final Log log = LogFactory.getLog(HooksCompositionUIHandler.class);
@@ -53,8 +55,8 @@ public class HooksCompositionUIHandler extends ContentTableUIHandler<SetLongline
}
@Override
- public HooksCompositionUI getUi() {
- return (HooksCompositionUI) super.getUi();
+ protected FocusTraversalPolicy createFocusTraversalPolicy(HooksCompositionUI ui) {
+ return null;
}
@Override
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/HooksCompositionUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/HooksCompositionUIModel.java
index 1ab45b5..1b9e373 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/HooksCompositionUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/HooksCompositionUIModel.java
@@ -22,15 +22,15 @@ package fr.ird.observe.application.swing.ui.content.table.impl.longline;
* #L%
*/
-import com.google.common.collect.Lists;
-import fr.ird.observe.services.dto.longline.HooksCompositionDto;
-import fr.ird.observe.services.dto.longline.HooksCompositionHelper;
-import fr.ird.observe.services.dto.longline.SetLonglineGlobalCompositionDto;
import fr.ird.observe.application.swing.ui.content.table.ContentTableMeta;
import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
import fr.ird.observe.application.swing.ui.content.table.ContentTableUIModel;
import fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI;
+import fr.ird.observe.services.dto.longline.HooksCompositionDto;
+import fr.ird.observe.services.dto.longline.HooksCompositionHelper;
+import fr.ird.observe.services.dto.longline.SetLonglineGlobalCompositionDto;
+import java.util.Arrays;
import java.util.Collection;
import java.util.List;
@@ -51,11 +51,11 @@ public class HooksCompositionUIModel extends ContentTableUIModel<SetLonglineGlob
SetLonglineGlobalCompositionDto.PROPERTY_HOOKS_COMPOSITION
},
new String[]{HooksCompositionDto.PROPERTY_HOOK_TYPE,
- HooksCompositionDto.PROPERTY_HOOK_SIZE,
- HooksCompositionDto.PROPERTY_HOOK_OFFSET,
- HooksCompositionDto.PROPERTY_PROPORTION});
+ HooksCompositionDto.PROPERTY_HOOK_SIZE,
+ HooksCompositionDto.PROPERTY_HOOK_OFFSET,
+ HooksCompositionDto.PROPERTY_PROPORTION});
- List<ContentTableMeta<HooksCompositionDto>> metas = Lists.newArrayList(
+ List<ContentTableMeta<HooksCompositionDto>> metas = Arrays.asList(
ContentTableModel.newTableMeta(HooksCompositionDto.class, HooksCompositionDto.PROPERTY_HOOK_TYPE, false),
ContentTableModel.newTableMeta(HooksCompositionDto.class, HooksCompositionDto.PROPERTY_HOOK_SIZE, false),
ContentTableModel.newTableMeta(HooksCompositionDto.class, HooksCompositionDto.PROPERTY_HOOK_OFFSET, false),
@@ -68,11 +68,12 @@ public class HooksCompositionUIModel extends ContentTableUIModel<SetLonglineGlob
@Override
protected ContentTableModel<SetLonglineGlobalCompositionDto, HooksCompositionDto> createTableModel(
- ObserveContentTableUI<SetLonglineGlobalCompositionDto, HooksCompositionDto> ui,
+ ObserveContentTableUI<SetLonglineGlobalCompositionDto, HooksCompositionDto, ?> ui,
List<ContentTableMeta<HooksCompositionDto>> contentTableMetas) {
return new ContentTableModel<SetLonglineGlobalCompositionDto, HooksCompositionDto>(ui, contentTableMetas) {
private static final long serialVersionUID = 1L;
+
@Override
protected Collection<HooksCompositionDto> getChilds(SetLonglineGlobalCompositionDto bean) {
return bean.getHooksComposition();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/SensorUsedUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/SensorUsedUI.jaxx
index 5a25e06..c32c54e 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/SensorUsedUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/SensorUsedUI.jaxx
@@ -19,10 +19,10 @@
-->
<fr.ird.observe.application.swing.ui.content.table.ContentTableUI
- superGenericType='ActivityLonglineSensorUsedDto, SensorUsedDto'
- contentTitle='{n("observe.content.sensorUsed.title")}'
- saveNewEntryText='{n("observe.content.sensorUsed.action.create")}'
- saveNewEntryTip='{n("observe.content.sensorUsed.action.create.tip")}'>
+ superGenericType='ActivityLonglineSensorUsedDto, SensorUsedDto, SensorUsedUI'
+ contentTitle='{n("observe.content.sensorUsed.title")}'
+ saveNewEntryText='{n("observe.content.sensorUsed.action.create")}'
+ saveNewEntryTip='{n("observe.content.sensorUsed.action.create.tip")}'>
<style source="../../CommonTable.jcss"/>
@@ -77,7 +77,8 @@
<JLabel id='sensorTypeLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='sensorType' constructorParams='this' genericType='ReferentialReference<SensorTypeDto>' _entityClass='SensorTypeDto.class'/>
+ <BeanComboBox id='sensorType' constructorParams='this' genericType='ReferentialReference<SensorTypeDto>'
+ _entityClass='SensorTypeDto.class'/>
</cell>
</row>
@@ -87,7 +88,9 @@
<JLabel id='sensorDataFormatLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='sensorDataFormat' constructorParams='this' genericType='ReferentialReference<SensorDataFormatDto>' _entityClass='SensorDataFormatDto.class'/>
+ <BeanComboBox id='sensorDataFormat' constructorParams='this'
+ genericType='ReferentialReference<SensorDataFormatDto>'
+ _entityClass='SensorDataFormatDto.class'/>
</cell>
</row>
@@ -97,7 +100,8 @@
<JLabel id='sensorBrandLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='sensorBrand' constructorParams='this' genericType='ReferentialReference<SensorBrandDto>' _entityClass='SensorBrandDto.class'/>
+ <BeanComboBox id='sensorBrand' constructorParams='this' genericType='ReferentialReference<SensorBrandDto>'
+ _entityClass='SensorBrandDto.class'/>
</cell>
</row>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/SensorUsedUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/SensorUsedUIHandler.java
index 0b3bb08..b1bd29b 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/SensorUsedUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/SensorUsedUIHandler.java
@@ -44,8 +44,11 @@ import org.nuiton.jaxx.runtime.JaxxFileChooser;
import javax.swing.JOptionPane;
import javax.swing.JTable;
+import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.table.DefaultTableCellRenderer;
import java.awt.Component;
+import java.awt.Container;
+import java.awt.FocusTraversalPolicy;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
@@ -59,7 +62,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.7
*/
-public class SensorUsedUIHandler extends ContentTableUIHandler<ActivityLonglineSensorUsedDto, SensorUsedDto> {
+public class SensorUsedUIHandler extends ContentTableUIHandler<ActivityLonglineSensorUsedDto, SensorUsedDto, SensorUsedUI> {
/** Logger */
private static final Log log = LogFactory.getLog(SensorUsedUIHandler.class);
@@ -69,11 +72,6 @@ public class SensorUsedUIHandler extends ContentTableUIHandler<ActivityLonglineS
}
@Override
- public SensorUsedUI getUi() {
- return (SensorUsedUI) super.getUi();
- }
-
- @Override
protected void onSelectedRowChanged(int editingRow, SensorUsedDto bean, boolean create) {
if (getTableModel().isEditable()) {
if (log.isDebugEnabled()) {
@@ -234,6 +232,36 @@ public class SensorUsedUIHandler extends ContentTableUIHandler<ActivityLonglineS
ActivityLonglineSensorUsedHelper.copyActivityLonglineSensorUsedDto(form.getObject(), getBean());
}
+ @Override
+ protected FocusTraversalPolicy createFocusTraversalPolicy(SensorUsedUI ui) {
+ return new LayoutFocusTraversalPolicy() {
+
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ if (aComponent.equals(ui.getSensorType().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ return ui.getSensorType();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ if (ui.getSave().isEnabled()) {
+ return ui.getSave();
+ }
+ if (ui.getReset().isEnabled()) {
+ return ui.getReset();
+ }
+ return ui.getComment2();
+ }
+ };
+ }
+
protected ActivityLongLineSensorUsedService getActivityLonglineSensorUsedService() {
return ObserveSwingApplicationContext.get().getMainDataSourceServicesProvider().newActivityLongLineSensorUsedService();
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/SensorUsedUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/SensorUsedUIModel.java
index fa79727..aa13383 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/SensorUsedUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/SensorUsedUIModel.java
@@ -22,15 +22,15 @@ package fr.ird.observe.application.swing.ui.content.table.impl.longline;
* #L%
*/
-import com.google.common.collect.Lists;
-import fr.ird.observe.services.dto.longline.ActivityLonglineSensorUsedDto;
-import fr.ird.observe.services.dto.longline.SensorUsedDto;
-import fr.ird.observe.services.dto.longline.SensorUsedHelper;
import fr.ird.observe.application.swing.ui.content.table.ContentTableMeta;
import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
import fr.ird.observe.application.swing.ui.content.table.ContentTableUIModel;
import fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI;
+import fr.ird.observe.services.dto.longline.ActivityLonglineSensorUsedDto;
+import fr.ird.observe.services.dto.longline.SensorUsedDto;
+import fr.ird.observe.services.dto.longline.SensorUsedHelper;
+import java.util.Arrays;
import java.util.Collection;
import java.util.List;
@@ -52,13 +52,13 @@ public class SensorUsedUIModel extends ContentTableUIModel<ActivityLonglineSenso
ActivityLonglineSensorUsedDto.PROPERTY_SENSOR_USED,
ActivityLonglineSensorUsedDto.PROPERTY_COMMENT},
new String[]{SensorUsedDto.PROPERTY_HAS_DATA,
- SensorUsedDto.PROPERTY_DATA,
- SensorUsedDto.PROPERTY_SENSOR_SERIAL_NO,
- SensorUsedDto.PROPERTY_SENSOR_TYPE,
- SensorUsedDto.PROPERTY_SENSOR_BRAND,
- SensorUsedDto.PROPERTY_SENSOR_DATA_FORMAT});
+ SensorUsedDto.PROPERTY_DATA,
+ SensorUsedDto.PROPERTY_SENSOR_SERIAL_NO,
+ SensorUsedDto.PROPERTY_SENSOR_TYPE,
+ SensorUsedDto.PROPERTY_SENSOR_BRAND,
+ SensorUsedDto.PROPERTY_SENSOR_DATA_FORMAT});
- List<ContentTableMeta<SensorUsedDto>> metas = Lists.newArrayList(
+ List<ContentTableMeta<SensorUsedDto>> metas = Arrays.asList(
ContentTableModel.newTableMeta(SensorUsedDto.class, SensorUsedDto.PROPERTY_SENSOR_TYPE, false),
ContentTableModel.newTableMeta(SensorUsedDto.class, SensorUsedDto.PROPERTY_SENSOR_BRAND, false),
ContentTableModel.newTableMeta(SensorUsedDto.class, SensorUsedDto.PROPERTY_SENSOR_DATA_FORMAT, false),
@@ -72,11 +72,12 @@ public class SensorUsedUIModel extends ContentTableUIModel<ActivityLonglineSenso
@Override
protected ContentTableModel<ActivityLonglineSensorUsedDto, SensorUsedDto> createTableModel(
- ObserveContentTableUI<ActivityLonglineSensorUsedDto, SensorUsedDto> ui,
+ ObserveContentTableUI<ActivityLonglineSensorUsedDto, SensorUsedDto, ?> ui,
List<ContentTableMeta<SensorUsedDto>> contentTableMetas) {
return new ContentTableModel<ActivityLonglineSensorUsedDto, SensorUsedDto>(ui, contentTableMetas) {
private static final long serialVersionUID = 1L;
+
@Override
protected Collection<SensorUsedDto> getChilds(ActivityLonglineSensorUsedDto bean) {
return bean.getSensorUsed();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/TdrUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/TdrUI.jaxx
index c7ddc72..3e7c8e5 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/TdrUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/TdrUI.jaxx
@@ -18,10 +18,10 @@
#L%
-->
-<fr.ird.observe.application.swing.ui.content.table.ContentTableUI superGenericType='SetLonglineTdrDto, TdrDto'
- contentTitle='{n("observe.content.tdr.title")}'
- saveNewEntryText='{n("observe.content.tdr.action.create")}'
- saveNewEntryTip='{n("observe.content.tdr.action.create.tip")}'>
+<fr.ird.observe.application.swing.ui.content.table.ContentTableUI superGenericType='SetLonglineTdrDto, TdrDto, TdrUI'
+ contentTitle='{n("observe.content.tdr.title")}'
+ saveNewEntryText='{n("observe.content.tdr.action.create")}'
+ saveNewEntryTip='{n("observe.content.tdr.action.create.tip")}'>
<style source="../../CommonTable.jcss"/>
@@ -124,7 +124,9 @@
<JLabel id='sensorBrandLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='sensorBrand' constructorParams='this' genericType='ReferentialReference<SensorBrandDto>' _entityClass='SensorBrandDto.class'/>
+ <BeanComboBox id='sensorBrand' constructorParams='this'
+ genericType='ReferentialReference<SensorBrandDto>'
+ _entityClass='SensorBrandDto.class'/>
</cell>
</row>
@@ -176,7 +178,8 @@
<JLabel id='sectionLabel'/>
</cell>
<cell fill="both" weightx="1">
- <BeanComboBox id='section' genericType='DataReference<SectionDto>' _entityClass='SectionDto.class' constructorParams='this'/>
+ <BeanComboBox id='section' genericType='DataReference<SectionDto>'
+ _entityClass='SectionDto.class' constructorParams='this'/>
</cell>
</row>
<row>
@@ -184,7 +187,8 @@
<JLabel id='basketLabel'/>
</cell>
<cell fill="both" weightx="1">
- <BeanComboBox id='basket' genericType='DataReference<BasketDto>' _entityClass='BasketDto.class' constructorParams='this'/>
+ <BeanComboBox id='basket' genericType='DataReference<BasketDto>'
+ _entityClass='BasketDto.class' constructorParams='this'/>
</cell>
</row>
<row>
@@ -192,7 +196,8 @@
<JLabel id='branchlineLabel'/>
</cell>
<cell fill="both" weightx="1">
- <BeanComboBox id='branchline' genericType='DataReference<BranchlineDto>' _entityClass='BranchlineDto.class' constructorParams='this'/>
+ <BeanComboBox id='branchline' genericType='DataReference<BranchlineDto>'
+ _entityClass='BranchlineDto.class' constructorParams='this'/>
</cell>
</row>
</Table>
@@ -206,7 +211,8 @@
</cell>
<cell weightx='1' anchor='east'>
<BeanComboBox id='itemHorizontalPosition' constructorParams='this'
- genericType='ReferentialReference<ItemHorizontalPositionDto>' _entityClass='ItemHorizontalPositionDto.class'/>
+ genericType='ReferentialReference<ItemHorizontalPositionDto>'
+ _entityClass='ItemHorizontalPositionDto.class'/>
</cell>
</row>
@@ -217,7 +223,8 @@
</cell>
<cell weightx='1' anchor='east'>
<BeanComboBox id='itemVerticalPosition' constructorParams='this'
- genericType='ReferentialReference<ItemVerticalPositionDto>' _entityClass='ItemVerticalPositionDto.class'/>
+ genericType='ReferentialReference<ItemVerticalPositionDto>'
+ _entityClass='ItemVerticalPositionDto.class'/>
</cell>
</row>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/TdrUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/TdrUIHandler.java
index 1d4a545..1617795 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/TdrUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/TdrUIHandler.java
@@ -54,9 +54,12 @@ import org.nuiton.validator.NuitonValidatorScope;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JTable;
+import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.event.TableModelListener;
import javax.swing.table.DefaultTableCellRenderer;
import java.awt.Component;
+import java.awt.Container;
+import java.awt.FocusTraversalPolicy;
import java.beans.PropertyChangeListener;
import java.io.File;
import java.io.IOException;
@@ -77,7 +80,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since XXX
*/
-public class TdrUIHandler extends ContentTableUIHandler<SetLonglineTdrDto, TdrDto> {
+public class TdrUIHandler extends ContentTableUIHandler<SetLonglineTdrDto, TdrDto, TdrUI> {
/** Logger */
private static final Log log = LogFactory.getLog(TdrUIHandler.class);
@@ -108,11 +111,6 @@ public class TdrUIHandler extends ContentTableUIHandler<SetLonglineTdrDto, TdrDt
}
@Override
- public TdrUI getUi() {
- return (TdrUI) super.getUi();
- }
-
- @Override
protected void onSelectedRowChanged(int editingRow, TdrDto bean, boolean create) {
ContentTableModel<SetLonglineTdrDto, TdrDto> model = getTableModel();
@@ -210,6 +208,79 @@ public class TdrUIHandler extends ContentTableUIHandler<SetLonglineTdrDto, TdrDt
}
@Override
+ protected FocusTraversalPolicy createFocusTraversalPolicy(TdrUI ui) {
+ return new LayoutFocusTraversalPolicy() {
+
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ int selectedIndex = ui.getEditTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ if (aComponent.equals(ui.getHomeId())) {
+ return getLastComponent(aContainer);
+ }
+ case 1:
+ if (aComponent.equals(ui.getSection().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ case 2:
+ if (aComponent.equals(ui.getEnableTimestamp())) {
+ return getLastComponent(aContainer);
+ }
+ case 3:
+ if (aComponent.equals(ui.getFishingStartDepth())) {
+ return getLastComponent(aContainer);
+ }
+ case 4:
+ if (aComponent.equals(ui.getSpecies().getUniverseList())) {
+ return getLastComponent(aContainer);
+ }
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ int selectedIndex = ui.getEditTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ return ui.getHomeId();
+ case 1:
+ return ui.getSection();
+ case 2:
+ return ui.getEnableTimestamp();
+ case 3:
+ return ui.getFishingStartDepth();
+ case 4:
+ return ui.getSpecies().getUniverseList();
+ }
+ return super.getFirstComponent(aContainer);
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ if (ui.getSave().isEnabled()) {
+ return ui.getSave();
+ }
+ if (ui.getReset().isEnabled()) {
+ return ui.getReset();
+ }
+ if (ui.getDeleteEntry().isEnabled()) {
+ return ui.getDeleteEntry();
+ }
+ if (ui.getSaveNewEntry().isEnabled()) {
+ return ui.getSaveNewEntry();
+ }
+ if (ui.getResetEntry().isEnabled()) {
+ return ui.getResetEntry();
+ }
+
+ return super.getLastComponent(aContainer);
+ }
+ };
+ }
+
+ @Override
public void openUI() {
if (log.isInfoEnabled()) {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/TdrUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/TdrUIModel.java
index e2d8b35..793fa1d 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/TdrUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/longline/TdrUIModel.java
@@ -32,6 +32,7 @@ import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
import fr.ird.observe.application.swing.ui.content.table.ContentTableUIModel;
import fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI;
+import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Set;
@@ -147,7 +148,7 @@ public class TdrUIModel extends ContentTableUIModel<SetLonglineTdrDto, TdrDto> {
// species tab
TdrDto.PROPERTY_SPECIES});
- List<ContentTableMeta<TdrDto>> metas = Lists.newArrayList(
+ List<ContentTableMeta<TdrDto>> metas = Arrays.asList(
ContentTableModel.newTableMeta(TdrDto.class, TdrDto.PROPERTY_HOME_ID, false),
ContentTableModel.newTableMeta(TdrDto.class, TdrDto.PROPERTY_SERIAL_NO, false),
ContentTableModel.newTableMeta(TdrDto.class, TdrDto.PROPERTY_SENSOR_BRAND, false),
@@ -159,7 +160,7 @@ public class TdrUIModel extends ContentTableUIModel<SetLonglineTdrDto, TdrDto> {
@Override
protected ContentTableModel<SetLonglineTdrDto, TdrDto> createTableModel(
- ObserveContentTableUI<SetLonglineTdrDto, TdrDto> ui,
+ ObserveContentTableUI<SetLonglineTdrDto, TdrDto, ?> ui,
List<ContentTableMeta<TdrDto>> contentTableMetas) {
return new ContentTableModel<SetLonglineTdrDto, TdrDto>(ui, contentTableMetas) {
private static final long serialVersionUID = 1L;
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/AbstractSampleUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/AbstractSampleUIHandler.java
index fbf67dc..9efd037 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/AbstractSampleUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/AbstractSampleUIHandler.java
@@ -23,8 +23,8 @@ package fr.ird.observe.application.swing.ui.content.table.impl.seine;
*/
import fr.ird.observe.application.swing.db.constants.DataContextType;
+import fr.ird.observe.application.swing.ui.content.table.ContentTableUI;
import fr.ird.observe.application.swing.ui.content.table.ContentTableUIHandler;
-import fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI;
import fr.ird.observe.services.dto.IdDto;
import fr.ird.observe.services.dto.referential.ReferentialReference;
import fr.ird.observe.services.dto.referential.SpeciesDto;
@@ -38,7 +38,7 @@ import java.beans.PropertyChangeListener;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 5.1
*/
-public abstract class AbstractSampleUIHandler<E extends IdDto, D extends IdDto> extends ContentTableUIHandler<E, D> {
+public abstract class AbstractSampleUIHandler<E extends IdDto, D extends IdDto, U extends ContentTableUI<E, D, U>> extends ContentTableUIHandler<E, D, U> {
/**
* Ecoute les modifications de la propriété {@link TargetLengthDto#getWeight()},
@@ -67,7 +67,7 @@ public abstract class AbstractSampleUIHandler<E extends IdDto, D extends IdDto>
*/
protected final PropertyChangeListener speciesChanged;
- protected AbstractSampleUIHandler(ObserveContentTableUI<E, D> ui) {
+ protected AbstractSampleUIHandler(U ui) {
super(ui, DataContextType.SetSeine);
weightChanged = evt -> {
onWeightChanged((Float) evt.getNewValue());
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/GearUseFeaturesSeineTableModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/GearUseFeaturesSeineTableModel.java
index 9b1a35b..d3b7557 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/GearUseFeaturesSeineTableModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/GearUseFeaturesSeineTableModel.java
@@ -23,15 +23,15 @@ package fr.ird.observe.application.swing.ui.content.table.impl.seine;
*/
import com.google.common.collect.Sets;
+import fr.ird.observe.application.swing.ui.content.table.ContentTableMeta;
+import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
+import fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI;
import fr.ird.observe.services.dto.referential.GearDto;
import fr.ird.observe.services.dto.referential.ReferentialReference;
import fr.ird.observe.services.dto.seine.GearUseFeaturesMeasurementSeineDto;
import fr.ird.observe.services.dto.seine.GearUseFeaturesSeineDto;
import fr.ird.observe.services.dto.seine.GearUseFeaturesSeineHelper;
import fr.ird.observe.services.dto.seine.TripSeineGearUseDto;
-import fr.ird.observe.application.swing.ui.content.table.ContentTableMeta;
-import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
-import fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -54,7 +54,7 @@ public class GearUseFeaturesSeineTableModel extends ContentTableModel<TripSeineG
private transient GearUseFeaturesSeineUIHandler gearUseFeaturesSeineUIHandler;
- public GearUseFeaturesSeineTableModel(ObserveContentTableUI<TripSeineGearUseDto, GearUseFeaturesSeineDto> context,
+ public GearUseFeaturesSeineTableModel(ObserveContentTableUI<TripSeineGearUseDto, GearUseFeaturesSeineDto, ?> context,
List<ContentTableMeta<GearUseFeaturesSeineDto>> contentTableMetas) {
super(context, contentTableMetas);
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/GearUseFeaturesSeineUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/GearUseFeaturesSeineUI.jaxx
index 9ac4a1a..291995d 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/GearUseFeaturesSeineUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/GearUseFeaturesSeineUI.jaxx
@@ -21,10 +21,10 @@
-->
<fr.ird.observe.application.swing.ui.content.table.ContentTableUI
- superGenericType='TripSeineGearUseDto, GearUseFeaturesSeineDto'
- contentTitle='{n("observe.content.gearUseFeaturesSeine.title")}'
- saveNewEntryText='{n("observe.content.action.create.gearUseFeaturesSeine")}'
- saveNewEntryTip='{n("observe.content.action.create.gearUseFeaturesSeine.tip")}'>
+ superGenericType='TripSeineGearUseDto, GearUseFeaturesSeineDto, GearUseFeaturesSeineUI'
+ contentTitle='{n("observe.content.gearUseFeaturesSeine.title")}'
+ saveNewEntryText='{n("observe.content.action.create.gearUseFeaturesSeine")}'
+ saveNewEntryTip='{n("observe.content.action.create.gearUseFeaturesSeine.tip")}'>
<style source="../../CommonTable.jcss"/>
@@ -32,7 +32,6 @@
fr.ird.observe.services.dto.CommentableDto
fr.ird.observe.services.dto.seine.TripSeineGearUseDto
fr.ird.observe.services.dto.seine.GearUseFeaturesSeineDto
- fr.ird.observe.services.dto.seine.GearUseFeaturesMeasurementSeineDto
fr.ird.observe.services.dto.referential.ReferentialReference
fr.ird.observe.services.dto.referential.GearDto
fr.ird.observe.application.swing.ui.content.table.*
@@ -66,17 +65,12 @@
<ContentTableModel id='tableModel'/>
<!-- le validateur de l'écran -->
- <BeanValidator id='validator'
- beanClass='fr.ird.observe.services.dto.seine.TripSeineGearUseDto'
- errorTableModel='{getErrorTableModel()}'
- context='ui-update'/>
+ <BeanValidator id='validator' beanClass='fr.ird.observe.services.dto.seine.TripSeineGearUseDto'
+ errorTableModel='{getErrorTableModel()}' context='ui-update'/>
<!-- le validateur d'une entrée de tableau -->
- <BeanValidator id='validatorTable'
- autoField='true'
- beanClass='fr.ird.observe.services.dto.seine.GearUseFeaturesSeineDto'
- errorTableModel='{getErrorTableModel()}'
- context='ui-update'/>
+ <BeanValidator id='validatorTable' autoField='true' errorTableModel='{getErrorTableModel()}' context='ui-update'
+ beanClass='fr.ird.observe.services.dto.seine.GearUseFeaturesSeineDto'/>
<JPopupMenu id='measurementsTablePopup'>
<JMenuItem id='addMeasurement' onActionPerformed='getHandler().addMeasurement()'/>
@@ -101,7 +95,8 @@
<JLabel id='gearLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='gear' constructorParams='this' genericType='ReferentialReference<GearDto>' _entityClass='GearDto.class'/>
+ <BeanComboBox id='gear' constructorParams='this' genericType='ReferentialReference<GearDto>'
+ _entityClass='GearDto.class'/>
</cell>
</row>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/GearUseFeaturesSeineUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/GearUseFeaturesSeineUIHandler.java
index 565fd94..932488b 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/GearUseFeaturesSeineUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/GearUseFeaturesSeineUIHandler.java
@@ -57,8 +57,12 @@ import org.nuiton.validator.NuitonValidatorScope;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JTable;
+import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.event.TableModelListener;
import javax.swing.table.DefaultTableCellRenderer;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.FocusTraversalPolicy;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.beans.PropertyChangeListener;
@@ -78,7 +82,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 3.16
*/
-public class GearUseFeaturesSeineUIHandler extends ContentTableUIHandler<TripSeineGearUseDto, GearUseFeaturesSeineDto> {
+public class GearUseFeaturesSeineUIHandler extends ContentTableUIHandler<TripSeineGearUseDto, GearUseFeaturesSeineDto, GearUseFeaturesSeineUI> {
/** Logger */
private static final Log log = LogFactory.getLog(GearUseFeaturesSeineUIHandler.class);
@@ -100,8 +104,53 @@ public class GearUseFeaturesSeineUIHandler extends ContentTableUIHandler<TripSei
}
@Override
- public GearUseFeaturesSeineUI getUi() {
- return (GearUseFeaturesSeineUI) super.getUi();
+ protected FocusTraversalPolicy createFocusTraversalPolicy(GearUseFeaturesSeineUI ui) {
+ return new LayoutFocusTraversalPolicy() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ int selectedIndex = ui.getGearUseFeaturesTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ if (aComponent.equals(ui.getGear().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ int selectedIndex = ui.getGearUseFeaturesTabPane().getSelectedIndex();
+ switch (selectedIndex) {
+ case 0:
+ return ui.getGear();
+ }
+ return super.getFirstComponent(aContainer);
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ if (ui.getSave().isEnabled()) {
+ return ui.getSave();
+ }
+ if (ui.getReset().isEnabled()) {
+ return ui.getReset();
+ }
+ if (ui.getDeleteEntry().isVisible() && ui.getDeleteEntry().isEnabled()) {
+ return ui.getDeleteEntry();
+ }
+ if (ui.getSaveNewEntry().isVisible() && ui.getSaveNewEntry().isEnabled()) {
+ return ui.getSaveNewEntry();
+ }
+ if (ui.getResetNewEntry().isVisible() && ui.getResetNewEntry().isEnabled()) {
+ return ui.getResetNewEntry();
+ }
+ if (ui.getResetEntry().isEnabled()) {
+ return ui.getResetEntry();
+ }
+ return super.getLastComponent(aContainer);
+ }
+ };
}
@Override
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/GearUseFeaturesSeineUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/GearUseFeaturesSeineUIModel.java
index 4696bfb..1b6c58a 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/GearUseFeaturesSeineUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/GearUseFeaturesSeineUIModel.java
@@ -23,14 +23,14 @@ package fr.ird.observe.application.swing.ui.content.table.impl.seine;
*/
import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Lists;
-import fr.ird.observe.services.dto.seine.GearUseFeaturesSeineDto;
-import fr.ird.observe.services.dto.seine.TripSeineGearUseDto;
import fr.ird.observe.application.swing.ui.content.table.ContentTableMeta;
import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
import fr.ird.observe.application.swing.ui.content.table.ContentTableUIModel;
import fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI;
+import fr.ird.observe.services.dto.seine.GearUseFeaturesSeineDto;
+import fr.ird.observe.services.dto.seine.TripSeineGearUseDto;
+import java.util.Arrays;
import java.util.List;
import java.util.Set;
@@ -59,13 +59,13 @@ public class GearUseFeaturesSeineUIModel extends ContentTableUIModel<TripSeineGe
public GearUseFeaturesSeineUIModel(GearUseFeaturesSeineUI ui) {
super(TripSeineGearUseDto.class,
- GearUseFeaturesSeineDto.class,
- new String[]{
- TripSeineGearUseDto.PROPERTY_ID,
- TripSeineGearUseDto.PROPERTY_GEAR_USE_FEATURES_SEINE,
- TripSeineGearUseDto.PROPERTY_LAST_UPDATE_DATE,
- },
- new String[]{
+ GearUseFeaturesSeineDto.class,
+ new String[]{
+ TripSeineGearUseDto.PROPERTY_ID,
+ TripSeineGearUseDto.PROPERTY_GEAR_USE_FEATURES_SEINE,
+ TripSeineGearUseDto.PROPERTY_LAST_UPDATE_DATE,
+ },
+ new String[]{
GearUseFeaturesSeineDto.PROPERTY_ID,
GearUseFeaturesSeineDto.PROPERTY_NUMBER,
GearUseFeaturesSeineDto.PROPERTY_USED_IN_TRIP,
@@ -76,7 +76,7 @@ public class GearUseFeaturesSeineUIModel extends ContentTableUIModel<TripSeineGe
this.measurementsTableModel = new GearUseFeaturesMeasurementSeinesTableModel();
- List<ContentTableMeta<GearUseFeaturesSeineDto>> metas = Lists.newArrayList(
+ List<ContentTableMeta<GearUseFeaturesSeineDto>> metas = Arrays.asList(
ContentTableModel.newTableMeta(GearUseFeaturesSeineDto.class, GearUseFeaturesSeineDto.PROPERTY_GEAR, false),
ContentTableModel.newTableMeta(GearUseFeaturesSeineDto.class, GearUseFeaturesSeineDto.PROPERTY_NUMBER, false),
ContentTableModel.newTableMeta(GearUseFeaturesSeineDto.class, GearUseFeaturesSeineDto.PROPERTY_USED_IN_TRIP, false),
@@ -88,7 +88,7 @@ public class GearUseFeaturesSeineUIModel extends ContentTableUIModel<TripSeineGe
@Override
protected GearUseFeaturesSeineTableModel createTableModel(
- ObserveContentTableUI<TripSeineGearUseDto, GearUseFeaturesSeineDto> ui,
+ ObserveContentTableUI<TripSeineGearUseDto, GearUseFeaturesSeineDto, ?> ui,
List<ContentTableMeta<GearUseFeaturesSeineDto>> contentTableMetas) {
return new GearUseFeaturesSeineTableModel(ui, contentTableMetas);
}
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetCatchUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetCatchUI.jaxx
index 66852f6..473ea0f 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetCatchUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetCatchUI.jaxx
@@ -22,10 +22,10 @@
<fr.ird.observe.application.swing.ui.content.table.ContentTableUI
- superGenericType='SetSeineNonTargetCatchDto, NonTargetCatchDto'
- contentTitle='{n("observe.common.nonTargetCatch")}'
- saveNewEntryText='{n("observe.content.action.create.nonTargetCatch")}'
- saveNewEntryTip='{n("observe.content.action.create.nonTargetCatch.tip")}'>
+ superGenericType='SetSeineNonTargetCatchDto, NonTargetCatchDto, NonTargetCatchUI'
+ contentTitle='{n("observe.common.nonTargetCatch")}'
+ saveNewEntryText='{n("observe.content.action.create.nonTargetCatch")}'
+ saveNewEntryTip='{n("observe.content.action.create.nonTargetCatch.tip")}'>
<style source="../../CommonTable.jcss"/>
@@ -66,20 +66,15 @@
<!-- le validateur de l'écran -->
- <BeanValidator id='validator'
- beanClass='fr.ird.observe.services.dto.seine.SetSeineNonTargetCatchDto'
- errorTableModel='{getErrorTableModel()}'
- context='ui-update'>
+ <BeanValidator id='validator' beanClass='fr.ird.observe.services.dto.seine.SetSeineNonTargetCatchDto'
+ errorTableModel='{getErrorTableModel()}' context='ui-update'>
<!-- clef unique -->
<field name="nonTargetCatch" component="editorPanel"/>
</BeanValidator>
<!-- le validateur d'une entrée de tableau -->
- <BeanValidator id='validatorTable'
- autoField='true'
- beanClass='fr.ird.observe.services.dto.seine.NonTargetCatchDto'
- errorTableModel='{getErrorTableModel()}'
- context='ui-update'/>
+ <BeanValidator id='validatorTable' autoField='true' beanClass='fr.ird.observe.services.dto.seine.NonTargetCatchDto'
+ errorTableModel='{getErrorTableModel()}' context='ui-update'/>
<Table id='editorPanel' fill='both' insets='1'
onFocusGained='species.requestFocus()'>
@@ -90,7 +85,8 @@
<JLabel id='speciesLabel'/>
</cell>
<cell weightx='1' anchor='east' columns="2">
- <BeanComboBox id='species' constructorParams='this' genericType='ReferentialReference<SpeciesDto>' _entityClass='SpeciesDto.class'/>
+ <BeanComboBox id='species' constructorParams='this' genericType='ReferentialReference<SpeciesDto>'
+ _entityClass='SpeciesDto.class'/>
</cell>
</row>
@@ -100,7 +96,8 @@
<JLabel id='speciesFateLabel'/>
</cell>
<cell weightx='1' anchor='east' columns="2">
- <BeanComboBox id='speciesFate' constructorParams='this' genericType='ReferentialReference<SpeciesFateDto>' _entityClass='SpeciesFateDto.class'/>
+ <BeanComboBox id='speciesFate' constructorParams='this' genericType='ReferentialReference<SpeciesFateDto>'
+ _entityClass='SpeciesFateDto.class'/>
</cell>
</row>
@@ -110,7 +107,8 @@
<JLabel id='reasonForDiscardLabel'/>
</cell>
<cell weightx='1' anchor='east' columns="2">
- <BeanComboBox id='reasonForDiscard' constructorParams='this' genericType='ReferentialReference<ReasonForDiscardDto>' _entityClass='ReasonForDiscardDto.class'/>
+ <BeanComboBox id='reasonForDiscard' constructorParams='this' _entityClass='ReasonForDiscardDto.class'
+ genericType='ReferentialReference<ReasonForDiscardDto>'/>
</cell>
</row>
@@ -124,8 +122,7 @@
</cell>
<cell anchor='east'>
<JToolBar id='catchWeightComputedAction'>
- <JButton id='catchWeightComputedInformation'
- onActionPerformed='getHandler().resetCatchWeightComputed()'/>
+ <JButton id='catchWeightComputedInformation' onActionPerformed='getHandler().resetCatchWeightComputed()'/>
</JToolBar>
</cell>
</row>
@@ -141,8 +138,7 @@
</cell>
<cell anchor='east'>
<JToolBar id='totalCountComputedAction'>
- <JButton id='totalCountComputedInformation'
- onActionPerformed='getHandler().resetTotalCountComputed()'/>
+ <JButton id='totalCountComputedInformation' onActionPerformed='getHandler().resetTotalCountComputed()'/>
</JToolBar>
</cell>
</row>
@@ -157,8 +153,7 @@
</cell>
<cell anchor='east'>
<JToolBar id='meanWeightComputedAction'>
- <JButton id='meanWeightComputedInformation'
- onActionPerformed='getHandler().resetMeanWeightComputed()'/>
+ <JButton id='meanWeightComputedInformation' onActionPerformed='getHandler().resetMeanWeightComputed()'/>
</JToolBar>
</cell>
</row>
@@ -173,8 +168,7 @@
</cell>
<cell anchor='east'>
<JToolBar id='meanLengthComputedAction'>
- <JButton id='meanLengthComputedInformation'
- onActionPerformed='getHandler().resetMeanLengthComputed()'/>
+ <JButton id='meanLengthComputedInformation' onActionPerformed='getHandler().resetMeanLengthComputed()'/>
</JToolBar>
</cell>
</row>
@@ -197,8 +191,7 @@
<!-- comment -->
<row>
<cell columns='3' weighty='1'>
- <JScrollPane id='comment'
- onFocusGained='comment2.requestFocus()'>
+ <JScrollPane id='comment' onFocusGained='comment2.requestFocus()'>
<JTextArea id='comment2'
onKeyReleased='getTableEditBean().setComment(((JTextArea) event.getSource()).getText())'/>
</JScrollPane>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetCatchUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetCatchUIHandler.java
index a2f5278..ee42d6e 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetCatchUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetCatchUIHandler.java
@@ -51,7 +51,11 @@ import org.apache.commons.logging.LogFactory;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JTable;
+import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.table.DefaultTableCellRenderer;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.FocusTraversalPolicy;
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.Collection;
@@ -66,7 +70,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.0
*/
-public class NonTargetCatchUIHandler extends ContentTableUIHandler<SetSeineNonTargetCatchDto, NonTargetCatchDto> {
+public class NonTargetCatchUIHandler extends ContentTableUIHandler<SetSeineNonTargetCatchDto, NonTargetCatchDto, NonTargetCatchUI> {
/** Logger */
private static final Log log = LogFactory.getLog(NonTargetCatchUIHandler.class);
@@ -128,8 +132,26 @@ public class NonTargetCatchUIHandler extends ContentTableUIHandler<SetSeineNonTa
}
@Override
- public NonTargetCatchUI getUi() {
- return (NonTargetCatchUI) super.getUi();
+ protected FocusTraversalPolicy createFocusTraversalPolicy(NonTargetCatchUI ui) {
+ return new LayoutFocusTraversalPolicy() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ if (aComponent.equals(ui.getSpecies().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ return ui.getSpecies();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ return getDefaultLastComponent(ui, null);
+ }
+ };
}
public String getCatchWeightDataTip(NonTargetCatchComputedValueSource computed) {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetCatchUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetCatchUIModel.java
index be4a698..f95e4ff 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetCatchUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetCatchUIModel.java
@@ -22,15 +22,15 @@ package fr.ird.observe.application.swing.ui.content.table.impl.seine;
* #L%
*/
-import com.google.common.collect.Lists;
-import fr.ird.observe.services.dto.seine.NonTargetCatchDto;
-import fr.ird.observe.services.dto.seine.NonTargetCatchHelper;
-import fr.ird.observe.services.dto.seine.SetSeineNonTargetCatchDto;
import fr.ird.observe.application.swing.ui.content.table.ContentTableMeta;
import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
import fr.ird.observe.application.swing.ui.content.table.ContentTableUIModel;
import fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI;
+import fr.ird.observe.services.dto.seine.NonTargetCatchDto;
+import fr.ird.observe.services.dto.seine.NonTargetCatchHelper;
+import fr.ird.observe.services.dto.seine.SetSeineNonTargetCatchDto;
+import java.util.Arrays;
import java.util.Collection;
import java.util.List;
@@ -65,7 +65,7 @@ public class NonTargetCatchUIModel extends ContentTableUIModel<SetSeineNonTarget
NonTargetCatchDto.PROPERTY_COMMENT
});
- List<ContentTableMeta<NonTargetCatchDto>> metas = Lists.newArrayList(
+ List<ContentTableMeta<NonTargetCatchDto>> metas = Arrays.asList(
ContentTableModel.newTableMeta(NonTargetCatchDto.class, NonTargetCatchDto.PROPERTY_SPECIES, false),
ContentTableModel.newTableMeta(NonTargetCatchDto.class, NonTargetCatchDto.PROPERTY_SPECIES_FATE, false),
ContentTableModel.newTableMeta(NonTargetCatchDto.class, NonTargetCatchDto.PROPERTY_REASON_FOR_DISCARD, false),
@@ -82,7 +82,7 @@ public class NonTargetCatchUIModel extends ContentTableUIModel<SetSeineNonTarget
@Override
protected ContentTableModel<SetSeineNonTargetCatchDto, NonTargetCatchDto> createTableModel(
- ObserveContentTableUI<SetSeineNonTargetCatchDto, NonTargetCatchDto> ui,
+ ObserveContentTableUI<SetSeineNonTargetCatchDto, NonTargetCatchDto, ?> ui,
List<ContentTableMeta<NonTargetCatchDto>> contentTableMetas) {
return new ContentTableModel<SetSeineNonTargetCatchDto, NonTargetCatchDto>(ui, contentTableMetas) {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetSampleUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetSampleUI.jaxx
index cc648fa..f741966 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetSampleUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetSampleUI.jaxx
@@ -21,7 +21,7 @@
-->
<fr.ird.observe.application.swing.ui.content.table.ContentTableUI
- superGenericType='NonTargetSampleDto, NonTargetLengthDto'
+ superGenericType='NonTargetSampleDto, NonTargetLengthDto, NonTargetSampleUI'
contentTitle='{n("observe.common.nonTargetSample")}'
saveNewEntryText='{n("observe.content.action.create.nonTargetSample")}'
saveNewEntryTip='{n("observe.content.action.create.nonTargetSample.tip")}'>
@@ -66,19 +66,14 @@
<ContentTableModel id='tableModel'/>
<!-- le validateur de l'écran -->
- <BeanValidator id='validator'
- beanClass='fr.ird.observe.services.dto.seine.NonTargetSampleDto'
- errorTableModel='{getErrorTableModel()}'
- context='ui-update'>
+ <BeanValidator id='validator' beanClass='fr.ird.observe.services.dto.seine.NonTargetSampleDto'
+ errorTableModel='{getErrorTableModel()}' context='ui-update'>
<field name='comment'/>
</BeanValidator>
<!-- le validateur d'une entrée de tableau -->
- <BeanValidator id='validatorTable'
- autoField='true'
- beanClass='fr.ird.observe.services.dto.seine.NonTargetLengthDto'
- errorTableModel='{getErrorTableModel()}'
- context='ui-update'>
+ <BeanValidator id='validatorTable' autoField='true' beanClass='fr.ird.observe.services.dto.seine.NonTargetLengthDto'
+ errorTableModel='{getErrorTableModel()}' context='ui-update'>
</BeanValidator>
<ButtonGroup id='acquisitionModeGroup'
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetSampleUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetSampleUIHandler.java
index 1ec4207..aa464d0 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetSampleUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetSampleUIHandler.java
@@ -46,7 +46,11 @@ import org.nuiton.validator.NuitonValidatorScope;
import javax.swing.JComponent;
import javax.swing.JTable;
+import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.table.DefaultTableCellRenderer;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.FocusTraversalPolicy;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
@@ -60,7 +64,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.0
*/
-public class NonTargetSampleUIHandler extends AbstractSampleUIHandler<NonTargetSampleDto, NonTargetLengthDto> {
+public class NonTargetSampleUIHandler extends AbstractSampleUIHandler<NonTargetSampleDto, NonTargetLengthDto, NonTargetSampleUI> {
/** Logger */
private static final Log log = LogFactory.getLog(NonTargetSampleUIHandler.class);
@@ -70,8 +74,33 @@ public class NonTargetSampleUIHandler extends AbstractSampleUIHandler<NonTargetS
}
@Override
- public NonTargetSampleUI getUi() {
- return (NonTargetSampleUI) super.getUi();
+ protected FocusTraversalPolicy createFocusTraversalPolicy(NonTargetSampleUI ui) {
+ return new LayoutFocusTraversalPolicy() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ if (aComponent.equals(ui.getAcquisitionModeEffectif())) {
+ return getLastComponent(aContainer);
+ }
+ if (aComponent.equals(ui.getSizeMeasureType().getCombobox().getEditor().getEditorComponent()) && !ui.getAcquisitionModeEffectif().isEnabled()) {
+ return super.getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ if (ui.getAcquisitionModeEffectif().isEnabled()) {
+ return ui.getAcquisitionModeEffectif();
+ }
+ return ui.getSizeMeasureType();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ return getDefaultLastComponent(ui, ui.getComment2());
+ }
+ };
+
}
@Override
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetSampleUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetSampleUIModel.java
index 3087dba..87d3d7e 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetSampleUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/NonTargetSampleUIModel.java
@@ -47,7 +47,7 @@ public class NonTargetSampleUIModel extends ContentTableUIModel<NonTargetSampleD
private static final long serialVersionUID = 1L;
- public static final String PROPERTY_DEFAULT_SIZE_MEASURE_TYPE="defaultSizeMeasureType";
+ public static final String PROPERTY_DEFAULT_SIZE_MEASURE_TYPE = "defaultSizeMeasureType";
private ReferentialReference<SizeMeasureTypeDto> defaultSizeMeasureType;
@@ -59,15 +59,15 @@ public class NonTargetSampleUIModel extends ContentTableUIModel<NonTargetSampleD
NonTargetSampleDto.PROPERTY_NON_TARGET_LENGTH,
NonTargetSampleDto.PROPERTY_COMMENT},
new String[]{NonTargetLengthDto.PROPERTY_SPECIES,
- NonTargetLengthDto.PROPERTY_LENGTH,
- NonTargetLengthDto.PROPERTY_IS_LENGTH_COMPUTED,
- NonTargetLengthDto.PROPERTY_WEIGHT,
- NonTargetLengthDto.PROPERTY_IS_WEIGHT_COMPUTED,
- NonTargetLengthDto.PROPERTY_SEX,
- NonTargetLengthDto.PROPERTY_COUNT,
- NonTargetLengthDto.PROPERTY_SPECIES_FATE,
- NonTargetLengthDto.PROPERTY_ACQUISITION_MODE,
- NonTargetLengthDto.PROPERTY_PICTURES_REFERENCES
+ NonTargetLengthDto.PROPERTY_LENGTH,
+ NonTargetLengthDto.PROPERTY_IS_LENGTH_COMPUTED,
+ NonTargetLengthDto.PROPERTY_WEIGHT,
+ NonTargetLengthDto.PROPERTY_IS_WEIGHT_COMPUTED,
+ NonTargetLengthDto.PROPERTY_SEX,
+ NonTargetLengthDto.PROPERTY_COUNT,
+ NonTargetLengthDto.PROPERTY_SPECIES_FATE,
+ NonTargetLengthDto.PROPERTY_ACQUISITION_MODE,
+ NonTargetLengthDto.PROPERTY_PICTURES_REFERENCES
});
List<ContentTableMeta<NonTargetLengthDto>> metas = Arrays.asList(
@@ -91,9 +91,10 @@ public class NonTargetSampleUIModel extends ContentTableUIModel<NonTargetSampleD
}
@Override
- protected ContentTableModel<NonTargetSampleDto, NonTargetLengthDto> createTableModel(ObserveContentTableUI<NonTargetSampleDto, NonTargetLengthDto> ui, List<ContentTableMeta<NonTargetLengthDto>> contentTableMetas) {
+ protected ContentTableModel<NonTargetSampleDto, NonTargetLengthDto> createTableModel(ObserveContentTableUI<NonTargetSampleDto, NonTargetLengthDto, ?> ui, List<ContentTableMeta<NonTargetLengthDto>> contentTableMetas) {
return new ContentTableModel<NonTargetSampleDto, NonTargetLengthDto>(ui, contentTableMetas) {
private static final long serialVersionUID = 1L;
+
@Override
protected Collection<NonTargetLengthDto> getChilds(NonTargetSampleDto bean) {
return bean.getNonTargetLength();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectObservedSpeciesUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectObservedSpeciesUI.jaxx
index b912040..1e6d6cb 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectObservedSpeciesUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectObservedSpeciesUI.jaxx
@@ -21,10 +21,10 @@
-->
<fr.ird.observe.application.swing.ui.content.table.ContentTableUI
- superGenericType='FloatingObjectObservedSpeciesDto, ObjectObservedSpeciesDto'
- contentTitle='{n("observe.common.objectObservedSpecies")}'
- saveNewEntryText='{n("observe.content.action.create.objectObservedSpecies")}'
- saveNewEntryTip='{n("observe.content.action.create.objectObservedSpecies.tip")}'>
+ superGenericType='FloatingObjectObservedSpeciesDto, ObjectObservedSpeciesDto, ObjectObservedSpeciesUI'
+ contentTitle='{n("observe.common.objectObservedSpecies")}'
+ saveNewEntryText='{n("observe.content.action.create.objectObservedSpecies")}'
+ saveNewEntryTip='{n("observe.content.action.create.objectObservedSpecies.tip")}'>
<style source="../../CommonTable.jcss"/>
@@ -62,18 +62,13 @@
<ContentTableModel id='tableModel'/>
<!-- le validateur de l'écran -->
- <BeanValidator id='validator'
- autoField='true'
+ <BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.seine.FloatingObjectObservedSpeciesDto'
- errorTableModel='{getErrorTableModel()}'
- context='ui-update'/>
+ errorTableModel='{getErrorTableModel()}' context='ui-update'/>
<!-- le validateur d'une entrée de tableau -->
- <BeanValidator id='validatorTable'
- autoField='true'
- beanClass='fr.ird.observe.services.dto.seine.ObjectObservedSpeciesDto'
- errorTableModel='{getErrorTableModel()}'
- context='ui-update'/>
+ <BeanValidator id='validatorTable' autoField='true' errorTableModel='{getErrorTableModel()}' context='ui-update'
+ beanClass='fr.ird.observe.services.dto.seine.ObjectObservedSpeciesDto'/>
<Table id='editorPanel' fill='both' insets='1'>
@@ -83,8 +78,8 @@
<JLabel id='speciesLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='species' constructorParams='this'
- genericType='ReferentialReference<SpeciesDto>' _entityClass='SpeciesDto.class'/>
+ <BeanComboBox id='species' constructorParams='this' genericType='ReferentialReference<SpeciesDto>'
+ _entityClass='SpeciesDto.class'/>
</cell>
</row>
@@ -113,10 +108,8 @@
<Table id='extraZone' fill='both' weightx='1' insets='0'>
<row>
<cell weighty='1'>
- <JScrollPane id='comment'
- onFocusGained='comment2.requestFocus()'>
- <JTextArea id='comment2'
- onKeyReleased='getBean().setComment(comment2.getText())'/>
+ <JScrollPane id='comment' onFocusGained='comment2.requestFocus()'>
+ <JTextArea id='comment2' onKeyReleased='getBean().setComment(comment2.getText())'/>
</JScrollPane>
</cell>
</row>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectObservedSpeciesUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectObservedSpeciesUIHandler.java
index 54ac0f8..da0e421 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectObservedSpeciesUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectObservedSpeciesUIHandler.java
@@ -43,7 +43,11 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.swing.JTable;
+import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.table.DefaultTableCellRenderer;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.FocusTraversalPolicy;
import java.util.Collection;
import java.util.LinkedList;
import java.util.Set;
@@ -54,7 +58,7 @@ import static org.nuiton.i18n.I18n.n;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.0
*/
-public class ObjectObservedSpeciesUIHandler extends ContentTableUIHandler<FloatingObjectObservedSpeciesDto, ObjectObservedSpeciesDto> {
+public class ObjectObservedSpeciesUIHandler extends ContentTableUIHandler<FloatingObjectObservedSpeciesDto, ObjectObservedSpeciesDto, ObjectObservedSpeciesUI> {
/** Logger */
private static final Log log = LogFactory.getLog(ObjectObservedSpeciesUIHandler.class);
@@ -64,8 +68,26 @@ public class ObjectObservedSpeciesUIHandler extends ContentTableUIHandler<Floati
}
@Override
- public ObjectObservedSpeciesUI getUi() {
- return (ObjectObservedSpeciesUI) super.getUi();
+ protected FocusTraversalPolicy createFocusTraversalPolicy(ObjectObservedSpeciesUI ui) {
+ return new LayoutFocusTraversalPolicy() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ if (aComponent.equals(ui.getSpecies().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ return ui.getSpecies();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ return getDefaultLastComponent(ui, ui.getComment2());
+ }
+ };
}
@Override
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectObservedSpeciesUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectObservedSpeciesUIModel.java
index 6764cf7..4ead773 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectObservedSpeciesUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectObservedSpeciesUIModel.java
@@ -22,15 +22,15 @@ package fr.ird.observe.application.swing.ui.content.table.impl.seine;
* #L%
*/
-import com.google.common.collect.Lists;
-import fr.ird.observe.services.dto.seine.FloatingObjectObservedSpeciesDto;
-import fr.ird.observe.services.dto.seine.ObjectObservedSpeciesDto;
-import fr.ird.observe.services.dto.seine.ObjectObservedSpeciesHelper;
import fr.ird.observe.application.swing.ui.content.table.ContentTableMeta;
import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
import fr.ird.observe.application.swing.ui.content.table.ContentTableUIModel;
import fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI;
+import fr.ird.observe.services.dto.seine.FloatingObjectObservedSpeciesDto;
+import fr.ird.observe.services.dto.seine.ObjectObservedSpeciesDto;
+import fr.ird.observe.services.dto.seine.ObjectObservedSpeciesHelper;
+import java.util.Arrays;
import java.util.Collection;
import java.util.List;
@@ -57,7 +57,7 @@ public class ObjectObservedSpeciesUIModel extends ContentTableUIModel<FloatingOb
ObjectObservedSpeciesDto.PROPERTY_COUNT}
);
- List<ContentTableMeta<ObjectObservedSpeciesDto>> metas = Lists.newArrayList(
+ List<ContentTableMeta<ObjectObservedSpeciesDto>> metas = Arrays.asList(
ContentTableModel.newTableMeta(ObjectObservedSpeciesDto.class, ObjectObservedSpeciesDto.PROPERTY_SPECIES, false),
ContentTableModel.newTableMeta(ObjectObservedSpeciesDto.class, ObjectObservedSpeciesDto.PROPERTY_SPECIES_STATUS, false),
ContentTableModel.newTableMeta(ObjectObservedSpeciesDto.class, ObjectObservedSpeciesDto.PROPERTY_COUNT, false));
@@ -68,11 +68,12 @@ public class ObjectObservedSpeciesUIModel extends ContentTableUIModel<FloatingOb
@Override
protected ContentTableModel<FloatingObjectObservedSpeciesDto, ObjectObservedSpeciesDto> createTableModel(
- ObserveContentTableUI<FloatingObjectObservedSpeciesDto, ObjectObservedSpeciesDto> ui,
+ ObserveContentTableUI<FloatingObjectObservedSpeciesDto, ObjectObservedSpeciesDto, ?> ui,
List<ContentTableMeta<ObjectObservedSpeciesDto>> contentTableMetas) {
return new ContentTableModel<FloatingObjectObservedSpeciesDto, ObjectObservedSpeciesDto>(ui, contentTableMetas) {
private static final long serialVersionUID = 1L;
+
@Override
protected Collection<ObjectObservedSpeciesDto> getChilds(FloatingObjectObservedSpeciesDto bean) {
return bean.getObjectObservedSpecies();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectSchoolEstimateUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectSchoolEstimateUI.jaxx
index c5a18d4..ac22112 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectSchoolEstimateUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectSchoolEstimateUI.jaxx
@@ -21,10 +21,10 @@
-->
<fr.ird.observe.application.swing.ui.content.table.ContentTableUI
- superGenericType='FloatingObjectSchoolEstimateDto, ObjectSchoolEstimateDto'
- contentTitle='{n("observe.common.schoolEstimate")}'
- saveNewEntryText='{n("observe.content.action.create.schoolEstimate")}'
- saveNewEntryTip='{n("observe.content.action.create.schoolEstimate.tip")}'>
+ superGenericType='FloatingObjectSchoolEstimateDto, ObjectSchoolEstimateDto, ObjectSchoolEstimateUI'
+ contentTitle='{n("observe.common.schoolEstimate")}'
+ saveNewEntryText='{n("observe.content.action.create.schoolEstimate")}'
+ saveNewEntryTip='{n("observe.content.action.create.schoolEstimate.tip")}'>
<style source="../../CommonTable.jcss"/>
@@ -61,18 +61,13 @@
<ContentTableModel id='tableModel'/>
<!-- le validateur de l'écran -->
- <BeanValidator id='validator'
- autoField='true'
+ <BeanValidator id='validator' autoField='true'
beanClass='fr.ird.observe.services.dto.seine.FloatingObjectSchoolEstimateDto'
- errorTableModel='{getErrorTableModel()}'
- context='ui-update'/>
+ errorTableModel='{getErrorTableModel()}' context='ui-update'/>
<!-- le validateur d'une entrée de tableau -->
- <BeanValidator id='validatorTable'
- autoField='true'
- beanClass='fr.ird.observe.services.dto.seine.ObjectSchoolEstimateDto'
- errorTableModel='{getErrorTableModel()}'
- context='ui-update'/>
+ <BeanValidator id='validatorTable' autoField='true' errorTableModel='{getErrorTableModel()}' context='ui-update'
+ beanClass='fr.ird.observe.services.dto.seine.ObjectSchoolEstimateDto'/>
<Table id='editorPanel' fill='both' insets='1'>
@@ -82,8 +77,8 @@
<JLabel id='speciesLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='species' constructorParams='this'
- genericType='ReferentialReference<SpeciesDto>' _entityClass='SpeciesDto.class'/>
+ <BeanComboBox id='species' constructorParams='this' genericType='ReferentialReference<SpeciesDto>'
+ _entityClass='SpeciesDto.class'/>
</cell>
</row>
@@ -101,10 +96,8 @@
<Table id='extraZone' fill='both' weightx='1' insets='1'>
<row>
<cell weighty='1'>
- <JScrollPane id='comment'
- onFocusGained='comment2.requestFocus()'>
- <JTextArea id='comment2'
- onKeyReleased='getBean().setComment(comment2.getText())'/>
+ <JScrollPane id='comment' onFocusGained='comment2.requestFocus()'>
+ <JTextArea id='comment2' onKeyReleased='getBean().setComment(comment2.getText())'/>
</JScrollPane>
</cell>
</row>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectSchoolEstimateUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectSchoolEstimateUIHandler.java
index c2d6ccd..272ac1d 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectSchoolEstimateUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectSchoolEstimateUIHandler.java
@@ -41,7 +41,11 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.swing.JTable;
+import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.table.DefaultTableCellRenderer;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.FocusTraversalPolicy;
import java.util.Collection;
import java.util.LinkedList;
import java.util.Set;
@@ -52,7 +56,7 @@ import static org.nuiton.i18n.I18n.n;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.0
*/
-public class ObjectSchoolEstimateUIHandler extends ContentTableUIHandler<FloatingObjectSchoolEstimateDto, ObjectSchoolEstimateDto> {
+public class ObjectSchoolEstimateUIHandler extends ContentTableUIHandler<FloatingObjectSchoolEstimateDto, ObjectSchoolEstimateDto, ObjectSchoolEstimateUI> {
/** Logger */
@@ -63,8 +67,26 @@ public class ObjectSchoolEstimateUIHandler extends ContentTableUIHandler<Floatin
}
@Override
- public ObjectSchoolEstimateUI getUi() {
- return (ObjectSchoolEstimateUI) super.getUi();
+ protected FocusTraversalPolicy createFocusTraversalPolicy(ObjectSchoolEstimateUI ui) {
+ return new LayoutFocusTraversalPolicy() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ if (aComponent.equals(ui.getSpecies().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ return ui.getSpecies();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ return getDefaultLastComponent(ui, ui.getComment2());
+ }
+ };
}
@Override
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectSchoolEstimateUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectSchoolEstimateUIModel.java
index 09bb397..f513381 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectSchoolEstimateUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/ObjectSchoolEstimateUIModel.java
@@ -22,15 +22,15 @@ package fr.ird.observe.application.swing.ui.content.table.impl.seine;
* #L%
*/
-import com.google.common.collect.Lists;
-import fr.ird.observe.services.dto.seine.FloatingObjectSchoolEstimateDto;
-import fr.ird.observe.services.dto.seine.ObjectSchoolEstimateDto;
-import fr.ird.observe.services.dto.seine.ObjectSchoolEstimateHelper;
import fr.ird.observe.application.swing.ui.content.table.ContentTableMeta;
import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
import fr.ird.observe.application.swing.ui.content.table.ContentTableUIModel;
import fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI;
+import fr.ird.observe.services.dto.seine.FloatingObjectSchoolEstimateDto;
+import fr.ird.observe.services.dto.seine.ObjectSchoolEstimateDto;
+import fr.ird.observe.services.dto.seine.ObjectSchoolEstimateHelper;
+import java.util.Arrays;
import java.util.Collection;
import java.util.List;
@@ -56,7 +56,7 @@ public class ObjectSchoolEstimateUIModel extends ContentTableUIModel<FloatingObj
ObjectSchoolEstimateDto.PROPERTY_TOTAL_WEIGHT}
);
- List<ContentTableMeta<ObjectSchoolEstimateDto>> metas = Lists.newArrayList(
+ List<ContentTableMeta<ObjectSchoolEstimateDto>> metas = Arrays.asList(
ContentTableModel.newTableMeta(ObjectSchoolEstimateDto.class, ObjectSchoolEstimateDto.PROPERTY_SPECIES, false),
ContentTableModel.newTableMeta(ObjectSchoolEstimateDto.class, ObjectSchoolEstimateDto.PROPERTY_TOTAL_WEIGHT, false));
@@ -66,11 +66,12 @@ public class ObjectSchoolEstimateUIModel extends ContentTableUIModel<FloatingObj
@Override
protected ContentTableModel<FloatingObjectSchoolEstimateDto, ObjectSchoolEstimateDto> createTableModel(
- ObserveContentTableUI<FloatingObjectSchoolEstimateDto, ObjectSchoolEstimateDto> ui,
+ ObserveContentTableUI<FloatingObjectSchoolEstimateDto, ObjectSchoolEstimateDto, ?> ui,
List<ContentTableMeta<ObjectSchoolEstimateDto>> contentTableMetas) {
return new ContentTableModel<FloatingObjectSchoolEstimateDto, ObjectSchoolEstimateDto>(ui, contentTableMetas) {
private static final long serialVersionUID = 1L;
+
@Override
protected Collection<ObjectSchoolEstimateDto> getChilds(FloatingObjectSchoolEstimateDto bean) {
return bean.getObjectSchoolEstimate();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/SchoolEstimateUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/SchoolEstimateUI.jaxx
index 1990c02..6a03201 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/SchoolEstimateUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/SchoolEstimateUI.jaxx
@@ -21,12 +21,10 @@
-->
<fr.ird.observe.application.swing.ui.content.table.ContentTableUI
- superGenericType='SetSeineSchoolEstimateDto, SchoolEstimateDto'
-
-
- contentTitle='{n("observe.common.schoolEstimate")}'
- saveNewEntryText='{n("observe.content.action.create.schoolEstimate")}'
- saveNewEntryTip='{n("observe.content.action.create.schoolEstimate.tip")}'>
+ superGenericType='SetSeineSchoolEstimateDto, SchoolEstimateDto, SchoolEstimateUI'
+ contentTitle='{n("observe.common.schoolEstimate")}'
+ saveNewEntryText='{n("observe.content.action.create.schoolEstimate")}'
+ saveNewEntryTip='{n("observe.content.action.create.schoolEstimate.tip")}'>
<style source="../../CommonTable.jcss"/>
@@ -63,21 +61,15 @@
<ContentTableModel id='tableModel'/>
<!-- le validateur de l'écran -->
- <BeanValidator id='validator'
- autoField='true'
- beanClass='fr.ird.observe.services.dto.seine.SetSeineSchoolEstimateDto'
- errorTableModel='{getErrorTableModel()}'
- context='ui-update'>
+ <BeanValidator id='validator' autoField='true' beanClass='fr.ird.observe.services.dto.seine.SetSeineSchoolEstimateDto'
+ errorTableModel='{getErrorTableModel()}' context='ui-update'>
<!-- clef unique -->
<field name="schoolEstimate" component="editorPanel"/>
</BeanValidator>
<!-- le validateur d'une entrée de tableau -->
- <BeanValidator id='validatorTable'
- autoField='true'
- beanClass='fr.ird.observe.services.dto.seine.SchoolEstimateDto'
- errorTableModel='{getErrorTableModel()}'
- context='ui-update'/>
+ <BeanValidator id='validatorTable' autoField='true' beanClass='fr.ird.observe.services.dto.seine.SchoolEstimateDto'
+ errorTableModel='{getErrorTableModel()}' context='ui-update'/>
<!-- formulaire -->
<Table id='editorPanel' fill='both' insets='1'>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/SchoolEstimateUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/SchoolEstimateUIHandler.java
index ea130a4..a663687 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/SchoolEstimateUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/SchoolEstimateUIHandler.java
@@ -23,6 +23,9 @@ package fr.ird.observe.application.swing.ui.content.table.impl.seine;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
import fr.ird.observe.application.swing.db.constants.DataContextType;
+import fr.ird.observe.application.swing.ui.UIHelper;
+import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
+import fr.ird.observe.application.swing.ui.content.table.ContentTableUIHandler;
import fr.ird.observe.services.dto.Form;
import fr.ird.observe.services.dto.referential.ReferentialDto;
import fr.ird.observe.services.dto.referential.ReferentialReference;
@@ -35,15 +38,16 @@ import fr.ird.observe.services.dto.seine.SetSeineSchoolEstimateDto;
import fr.ird.observe.services.dto.seine.SetSeineSchoolEstimateHelper;
import fr.ird.observe.services.service.data.seine.SchoolEstimateService;
import fr.ird.observe.services.service.data.seine.TripSeineService;
-import fr.ird.observe.application.swing.ui.UIHelper;
-import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
-import fr.ird.observe.application.swing.ui.content.table.ContentTableUIHandler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.swing.JComponent;
import javax.swing.JTable;
+import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.table.DefaultTableCellRenderer;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.FocusTraversalPolicy;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
@@ -57,7 +61,7 @@ import static org.nuiton.i18n.I18n.n;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.0
*/
-public class SchoolEstimateUIHandler extends ContentTableUIHandler<SetSeineSchoolEstimateDto, SchoolEstimateDto> {
+public class SchoolEstimateUIHandler extends ContentTableUIHandler<SetSeineSchoolEstimateDto, SchoolEstimateDto, SchoolEstimateUI> {
/** Logger */
private static final Log log = LogFactory.getLog(SchoolEstimateUIHandler.class);
@@ -67,8 +71,32 @@ public class SchoolEstimateUIHandler extends ContentTableUIHandler<SetSeineSchoo
}
@Override
- public SchoolEstimateUI getUi() {
- return (SchoolEstimateUI) super.getUi();
+ protected FocusTraversalPolicy createFocusTraversalPolicy(SchoolEstimateUI ui) {
+ return new LayoutFocusTraversalPolicy() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ if (aComponent.equals(ui.getSpecies().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ if (aComponent.equals(ui.getTotalWeight().getTextField()) && !ui.getSpecies().isEnabled()) {
+ return getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ if (ui.getSpecies().isEnabled()) {
+ return ui.getSpecies();
+ }
+ return ui.getTotalWeight();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ return getDefaultLastComponent(ui, ui.getComment2());
+ }
+ };
}
@Override
@@ -98,7 +126,7 @@ public class SchoolEstimateUIHandler extends ContentTableUIHandler<SetSeineSchoo
Set<String> listSpeciesIdUsed = listSpeciesUsed.stream().map(ReferentialReference::getId).collect(Collectors.toSet());
- availableEspeces = ReferentialReferences.filterNotContains(references,listSpeciesIdUsed);
+ availableEspeces = ReferentialReferences.filterNotContains(references, listSpeciesIdUsed);
requestFocus = ui.getSpecies();
} else {
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/SchoolEstimateUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/SchoolEstimateUIModel.java
index d0585a3..b09c152 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/SchoolEstimateUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/SchoolEstimateUIModel.java
@@ -22,15 +22,15 @@ package fr.ird.observe.application.swing.ui.content.table.impl.seine;
* #L%
*/
-import com.google.common.collect.Lists;
-import fr.ird.observe.services.dto.seine.SchoolEstimateDto;
-import fr.ird.observe.services.dto.seine.SchoolEstimateHelper;
-import fr.ird.observe.services.dto.seine.SetSeineSchoolEstimateDto;
import fr.ird.observe.application.swing.ui.content.table.ContentTableMeta;
import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
import fr.ird.observe.application.swing.ui.content.table.ContentTableUIModel;
import fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI;
+import fr.ird.observe.services.dto.seine.SchoolEstimateDto;
+import fr.ird.observe.services.dto.seine.SchoolEstimateHelper;
+import fr.ird.observe.services.dto.seine.SetSeineSchoolEstimateDto;
+import java.util.Arrays;
import java.util.Collection;
import java.util.List;
@@ -52,12 +52,12 @@ public class SchoolEstimateUIModel extends ContentTableUIModel<SetSeineSchoolEst
SetSeineSchoolEstimateDto.PROPERTY_SCHOOL_ESTIMATE,
SetSeineSchoolEstimateDto.PROPERTY_COMMENT},
new String[]{
- SchoolEstimateDto.PROPERTY_SPECIES,
- SchoolEstimateDto.PROPERTY_TOTAL_WEIGHT,
- SchoolEstimateDto.PROPERTY_MEAN_WEIGHT}
+ SchoolEstimateDto.PROPERTY_SPECIES,
+ SchoolEstimateDto.PROPERTY_TOTAL_WEIGHT,
+ SchoolEstimateDto.PROPERTY_MEAN_WEIGHT}
);
- List<ContentTableMeta<SchoolEstimateDto>> metas = Lists.newArrayList(
+ List<ContentTableMeta<SchoolEstimateDto>> metas = Arrays.asList(
ContentTableModel.newTableMeta(SchoolEstimateDto.class, SchoolEstimateDto.PROPERTY_SPECIES, false),
ContentTableModel.newTableMeta(SchoolEstimateDto.class, SchoolEstimateDto.PROPERTY_TOTAL_WEIGHT, false),
ContentTableModel.newTableMeta(SchoolEstimateDto.class, SchoolEstimateDto.PROPERTY_MEAN_WEIGHT, false));
@@ -68,11 +68,12 @@ public class SchoolEstimateUIModel extends ContentTableUIModel<SetSeineSchoolEst
@Override
protected ContentTableModel<SetSeineSchoolEstimateDto, SchoolEstimateDto> createTableModel(
- ObserveContentTableUI<SetSeineSchoolEstimateDto, SchoolEstimateDto> ui,
+ ObserveContentTableUI<SetSeineSchoolEstimateDto, SchoolEstimateDto, ?> ui,
List<ContentTableMeta<SchoolEstimateDto>> contentTableMetas) {
return new ContentTableModel<SetSeineSchoolEstimateDto, SchoolEstimateDto>(ui, contentTableMetas) {
private static final long serialVersionUID = 1L;
+
@Override
protected Collection<SchoolEstimateDto> getChilds(SetSeineSchoolEstimateDto bean) {
return bean.getSchoolEstimate();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetCatchUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetCatchUI.jaxx
index 3b72dc1..08a308a 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetCatchUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetCatchUI.jaxx
@@ -21,10 +21,10 @@
-->
<fr.ird.observe.application.swing.ui.content.table.ContentTableUI
- superGenericType='SetSeineTargetCatchDto, TargetCatchDto'
- contentTitle='{n("observe.common.targetCatch")}'
- saveNewEntryText='{n("observe.content.action.create.targetCatch")}'
- saveNewEntryTip='{n("observe.content.action.create.targetCatch.tip")}'>
+ superGenericType='SetSeineTargetCatchDto, TargetCatchDto, TargetCatchUI'
+ contentTitle='{n("observe.common.targetCatch")}'
+ saveNewEntryText='{n("observe.content.action.create.targetCatch")}'
+ saveNewEntryTip='{n("observe.content.action.create.targetCatch.tip")}'>
<style source="../../CommonTable.jcss"/>
@@ -64,20 +64,15 @@
<ContentTableModel id='tableModel'/>
<!-- le validateur de l'écran -->
- <BeanValidator id='validator'
- beanClass='fr.ird.observe.services.dto.seine.SetSeineTargetCatchDto'
- errorTableModel='{getErrorTableModel()}'
- context='ui-update-targetCatch'>
+ <BeanValidator id='validator' beanClass='fr.ird.observe.services.dto.seine.SetSeineTargetCatchDto'
+ errorTableModel='{getErrorTableModel()}' context='ui-update-targetCatch'>
<!-- clef unique -->
<field name="targetCatch" component="editorPanel"/>
</BeanValidator>
<!-- le validateur d'une entrée de tableau -->
- <BeanValidator id='validatorTable'
- autoField='true'
- beanClass='fr.ird.observe.services.dto.seine.TargetCatchDto'
- errorTableModel='{getErrorTableModel()}'
- context='ui-update-targetCatch'/>
+ <BeanValidator id='validatorTable' autoField='true' beanClass='fr.ird.observe.services.dto.seine.TargetCatchDto'
+ errorTableModel='{getErrorTableModel()}' context='ui-update-targetCatch'/>
<Table id='editorPanel' fill='both' insets='1'
onFocusGained='species.requestFocus()'>
@@ -88,7 +83,8 @@
<JLabel id='speciesLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='species' genericType='ReferentialReference<SpeciesDto>' _entityClass='SpeciesDto.class' constructorParams='this'/>
+ <BeanComboBox id='species' genericType='ReferentialReference<SpeciesDto>' _entityClass='SpeciesDto.class'
+ constructorParams='this'/>
</cell>
</row>
@@ -99,7 +95,8 @@
<JLabel id='weightCategoryLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='weightCategory' genericType='ReferentialReference<WeightCategoryDto>' _entityClass='WeightCategoryDto.class' constructorParams='this'/>
+ <BeanComboBox id='weightCategory' genericType='ReferentialReference<WeightCategoryDto>'
+ _entityClass='WeightCategoryDto.class' constructorParams='this'/>
</cell>
</row>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetCatchUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetCatchUIHandler.java
index 4a72373..d722d51 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetCatchUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetCatchUIHandler.java
@@ -25,6 +25,9 @@ import com.google.common.collect.Iterables;
import com.google.common.collect.Sets;
import fr.ird.observe.application.swing.ObserveSwingApplicationContext;
import fr.ird.observe.application.swing.db.constants.DataContextType;
+import fr.ird.observe.application.swing.ui.UIHelper;
+import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
+import fr.ird.observe.application.swing.ui.content.table.ContentTableUIHandler;
import fr.ird.observe.services.dto.Form;
import fr.ird.observe.services.dto.referential.ReferentialDto;
import fr.ird.observe.services.dto.referential.ReferentialReference;
@@ -40,9 +43,6 @@ import fr.ird.observe.services.dto.seine.TargetCatchDto;
import fr.ird.observe.services.dto.seine.TargetCatchHelper;
import fr.ird.observe.services.service.data.seine.TargetCatchService;
import fr.ird.observe.services.service.data.seine.TripSeineService;
-import fr.ird.observe.application.swing.ui.UIHelper;
-import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
-import fr.ird.observe.application.swing.ui.content.table.ContentTableUIHandler;
import jaxx.runtime.swing.editor.bean.BeanComboBox;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -51,7 +51,11 @@ import org.nuiton.decorator.Decorator;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JTable;
+import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.table.DefaultTableCellRenderer;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.FocusTraversalPolicy;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
@@ -65,7 +69,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.0
*/
-public class TargetCatchUIHandler extends ContentTableUIHandler<SetSeineTargetCatchDto, TargetCatchDto> {
+public class TargetCatchUIHandler extends ContentTableUIHandler<SetSeineTargetCatchDto, TargetCatchDto, TargetCatchUI> {
/** Logger */
private static final Log log = LogFactory.getLog(TargetCatchUIHandler.class);
@@ -75,8 +79,32 @@ public class TargetCatchUIHandler extends ContentTableUIHandler<SetSeineTargetCa
}
@Override
- public TargetCatchUI getUi() {
- return (TargetCatchUI) super.getUi();
+ protected FocusTraversalPolicy createFocusTraversalPolicy(TargetCatchUI ui) {
+ return new LayoutFocusTraversalPolicy() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ if (aComponent.equals(ui.getSpecies().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ if (aComponent.equals(ui.getCatchWeight().getTextField()) && !ui.getSpecies().isEnabled()) {
+ return super.getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ if (ui.getSpecies().isEnabled()) {
+ return ui.getSpecies();
+ }
+ return ui.getCatchWeight();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ return getDefaultLastComponent(ui, ui.getTargetCatchCompositionEstimatedByObserver());
+ }
+ };
}
@Override
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetCatchUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetCatchUIModel.java
index b9cb1d4..a3a6afc 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetCatchUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetCatchUIModel.java
@@ -22,16 +22,16 @@ package fr.ird.observe.application.swing.ui.content.table.impl.seine;
* #L%
*/
-import com.google.common.collect.Lists;
-import fr.ird.observe.services.dto.referential.seine.WeightCategoryDto;
-import fr.ird.observe.services.dto.seine.SetSeineTargetCatchDto;
-import fr.ird.observe.services.dto.seine.TargetCatchDto;
-import fr.ird.observe.services.dto.seine.TargetCatchHelper;
import fr.ird.observe.application.swing.ui.content.table.ContentTableMeta;
import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
import fr.ird.observe.application.swing.ui.content.table.ContentTableUIModel;
import fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI;
+import fr.ird.observe.services.dto.referential.seine.WeightCategoryDto;
+import fr.ird.observe.services.dto.seine.SetSeineTargetCatchDto;
+import fr.ird.observe.services.dto.seine.TargetCatchDto;
+import fr.ird.observe.services.dto.seine.TargetCatchHelper;
+import java.util.Arrays;
import java.util.Collection;
import java.util.List;
@@ -54,15 +54,15 @@ public class TargetCatchUIModel extends ContentTableUIModel<SetSeineTargetCatchD
SetSeineTargetCatchDto.PROPERTY_TARGET_CATCH
},
new String[]{
- TargetCatchDto.PROPERTY_WEIGHT_CATEGORY,
- TargetCatchDto.PROPERTY_CATCH_WEIGHT,
- TargetCatchDto.PROPERTY_WELL,
- TargetCatchDto.PROPERTY_BROUGHT_ON_DECK,
- TargetCatchDto.PROPERTY_DISCARDED,
- TargetCatchDto.PROPERTY_COMMENT}
+ TargetCatchDto.PROPERTY_WEIGHT_CATEGORY,
+ TargetCatchDto.PROPERTY_CATCH_WEIGHT,
+ TargetCatchDto.PROPERTY_WELL,
+ TargetCatchDto.PROPERTY_BROUGHT_ON_DECK,
+ TargetCatchDto.PROPERTY_DISCARDED,
+ TargetCatchDto.PROPERTY_COMMENT}
);
- List<ContentTableMeta<TargetCatchDto>> metas = Lists.newArrayList(
+ List<ContentTableMeta<TargetCatchDto>> metas = Arrays.asList(
ContentTableModel.newTableMeta(TargetCatchDto.class, WeightCategoryDto.PROPERTY_SPECIES, true),
ContentTableModel.newTableMeta(TargetCatchDto.class, TargetCatchDto.PROPERTY_WEIGHT_CATEGORY, true),
ContentTableModel.newTableMeta(TargetCatchDto.class, TargetCatchDto.PROPERTY_WELL, false),
@@ -75,10 +75,11 @@ public class TargetCatchUIModel extends ContentTableUIModel<SetSeineTargetCatchD
@Override
protected ContentTableModel<SetSeineTargetCatchDto, TargetCatchDto> createTableModel(
- ObserveContentTableUI<SetSeineTargetCatchDto, TargetCatchDto> ui,
+ ObserveContentTableUI<SetSeineTargetCatchDto, TargetCatchDto, ?> ui,
List<ContentTableMeta<TargetCatchDto>> contentTableMetas) {
return new ContentTableModel<SetSeineTargetCatchDto, TargetCatchDto>(ui, contentTableMetas) {
private static final long serialVersionUID = 1L;
+
@Override
protected Collection<TargetCatchDto> getChilds(SetSeineTargetCatchDto bean) {
return bean.getTargetCatch();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetDiscardCatchUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetDiscardCatchUI.jaxx
index c462c04..a6de31a 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetDiscardCatchUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetDiscardCatchUI.jaxx
@@ -21,10 +21,10 @@
-->
<fr.ird.observe.application.swing.ui.content.table.ContentTableUI
- superGenericType='SetSeineTargetCatchDto, TargetCatchDto'
- contentTitle='{n("observe.common.targetDiscarded")}'
- saveNewEntryText='{n("observe.content.action.create.targetDiscarded")}'
- saveNewEntryTip='{n("observe.content.action.create.targetDiscarded.tip")}'>
+ superGenericType='SetSeineTargetCatchDto, TargetCatchDto, TargetDiscardCatchUI'
+ contentTitle='{n("observe.common.targetDiscarded")}'
+ saveNewEntryText='{n("observe.content.action.create.targetDiscarded")}'
+ saveNewEntryTip='{n("observe.content.action.create.targetDiscarded.tip")}'>
<style source="../../CommonTable.jcss"/>
@@ -66,20 +66,15 @@
<ContentTableModel id='tableModel'/>
<!-- le validateur de l'écran -->
- <BeanValidator id='validator'
- beanClass='fr.ird.observe.services.dto.seine.SetSeineTargetCatchDto'
- errorTableModel='{getErrorTableModel()}'
- context='ui-update-targetDiscarded'>
+ <BeanValidator id='validator' beanClass='fr.ird.observe.services.dto.seine.SetSeineTargetCatchDto'
+ errorTableModel='{getErrorTableModel()}' context='ui-update-targetDiscarded'>
<!-- clef unique -->
<field name="targetCatch" component="editorPanel"/>
</BeanValidator>
<!-- le validateur d'une entrée de tableau -->
- <BeanValidator id='validatorTable'
- autoField='true'
- beanClass='fr.ird.observe.services.dto.seine.TargetCatchDto'
- errorTableModel='{getErrorTableModel()}'
- context='ui-update-targetDiscarded'/>
+ <BeanValidator id='validatorTable' autoField='true' beanClass='fr.ird.observe.services.dto.seine.TargetCatchDto'
+ errorTableModel='{getErrorTableModel()}' context='ui-update-targetDiscarded'/>
<Table id='editorPanel' fill='both' insets='1'>
@@ -89,7 +84,8 @@
<JLabel id='speciesLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='species' constructorParams='this' genericType='ReferentialReference<SpeciesDto>' _entityClass='SpeciesDto.class'/>
+ <BeanComboBox id='species' constructorParams='this' genericType='ReferentialReference<SpeciesDto>'
+ _entityClass='SpeciesDto.class'/>
</cell>
</row>
@@ -99,7 +95,8 @@
<JLabel id='weightCategoryLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='weightCategory' constructorParams='this' genericType='ReferentialReference<WeightCategoryDto>' _entityClass='WeightCategoryDto.class'/>
+ <BeanComboBox id='weightCategory' constructorParams='this' _entityClass='WeightCategoryDto.class'
+ genericType='ReferentialReference<WeightCategoryDto>'/>
</cell>
</row>
@@ -109,7 +106,8 @@
<JLabel id='reasonForDiscardLabel'/>
</cell>
<cell weightx='1' anchor='east'>
- <BeanComboBox id='reasonForDiscard' constructorParams='this' genericType='ReferentialReference<ReasonForDiscardDto>' _entityClass='ReasonForDiscardDto.class'/>
+ <BeanComboBox id='reasonForDiscard' constructorParams='this' _entityClass='ReasonForDiscardDto.class'
+ genericType='ReferentialReference<ReasonForDiscardDto>'/>
</cell>
</row>
@@ -140,8 +138,7 @@
<!-- comment -->
<row>
<cell columns='2' weighty='1'>
- <JScrollPane id='comment'
- onFocusGained='comment2.requestFocus()'>
+ <JScrollPane id='comment' onFocusGained='comment2.requestFocus()'>
<JTextArea id='comment2'
onKeyReleased='getTableEditBean().setComment(((JTextArea) event.getSource()).getText())'/>
</JScrollPane>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetDiscardCatchUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetDiscardCatchUIHandler.java
index 830f600..d9bceb4 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetDiscardCatchUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetDiscardCatchUIHandler.java
@@ -52,7 +52,11 @@ import org.nuiton.decorator.Decorator;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JTable;
+import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.table.DefaultTableCellRenderer;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.FocusTraversalPolicy;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -68,7 +72,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.0
*/
-public class TargetDiscardCatchUIHandler extends ContentTableUIHandler<SetSeineTargetCatchDto, TargetCatchDto> {
+public class TargetDiscardCatchUIHandler extends ContentTableUIHandler<SetSeineTargetCatchDto, TargetCatchDto, TargetDiscardCatchUI> {
/** Logger */
private static final Log log = LogFactory.getLog(TargetDiscardCatchUIHandler.class);
@@ -78,8 +82,32 @@ public class TargetDiscardCatchUIHandler extends ContentTableUIHandler<SetSeineT
}
@Override
- public TargetDiscardCatchUI getUi() {
- return (TargetDiscardCatchUI) super.getUi();
+ protected FocusTraversalPolicy createFocusTraversalPolicy(TargetDiscardCatchUI ui) {
+ return new LayoutFocusTraversalPolicy() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ if (aComponent.equals(ui.getSpecies().getCombobox().getEditor().getEditorComponent())) {
+ return getLastComponent(aContainer);
+ }
+ if (aComponent.equals(ui.getCatchWeight().getTextField()) && !ui.getSpecies().isEnabled()) {
+ return super.getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ if (ui.getSpecies().isEnabled()) {
+ return ui.getSpecies();
+ }
+ return ui.getCatchWeight();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ return getDefaultLastComponent(ui, ui.getTargetDiscardCatchCompositionEstimatedByObserver());
+ }
+ };
}
@Override
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetDiscardCatchUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetDiscardCatchUIModel.java
index bd83a08..ac6b6c0 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetDiscardCatchUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetDiscardCatchUIModel.java
@@ -22,16 +22,16 @@ package fr.ird.observe.application.swing.ui.content.table.impl.seine;
* #L%
*/
-import com.google.common.collect.Lists;
-import fr.ird.observe.services.dto.referential.seine.WeightCategoryDto;
-import fr.ird.observe.services.dto.seine.SetSeineTargetCatchDto;
-import fr.ird.observe.services.dto.seine.TargetCatchDto;
-import fr.ird.observe.services.dto.seine.TargetCatchHelper;
import fr.ird.observe.application.swing.ui.content.table.ContentTableMeta;
import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
import fr.ird.observe.application.swing.ui.content.table.ContentTableUIModel;
import fr.ird.observe.application.swing.ui.content.table.ObserveContentTableUI;
+import fr.ird.observe.services.dto.referential.seine.WeightCategoryDto;
+import fr.ird.observe.services.dto.seine.SetSeineTargetCatchDto;
+import fr.ird.observe.services.dto.seine.TargetCatchDto;
+import fr.ird.observe.services.dto.seine.TargetCatchHelper;
+import java.util.Arrays;
import java.util.Collection;
import java.util.List;
@@ -53,14 +53,14 @@ public class TargetDiscardCatchUIModel extends ContentTableUIModel<SetSeineTarge
SetSeineTargetCatchDto.PROPERTY_DISCARDED,
SetSeineTargetCatchDto.PROPERTY_TARGET_CATCH},
new String[]{
- TargetCatchDto.PROPERTY_WEIGHT_CATEGORY,
- TargetCatchDto.PROPERTY_CATCH_WEIGHT,
- TargetCatchDto.PROPERTY_REASON_FOR_DISCARD,
- TargetCatchDto.PROPERTY_DISCARDED,
- TargetCatchDto.PROPERTY_BROUGHT_ON_DECK,
- TargetCatchDto.PROPERTY_COMMENT});
+ TargetCatchDto.PROPERTY_WEIGHT_CATEGORY,
+ TargetCatchDto.PROPERTY_CATCH_WEIGHT,
+ TargetCatchDto.PROPERTY_REASON_FOR_DISCARD,
+ TargetCatchDto.PROPERTY_DISCARDED,
+ TargetCatchDto.PROPERTY_BROUGHT_ON_DECK,
+ TargetCatchDto.PROPERTY_COMMENT});
- List<ContentTableMeta<TargetCatchDto>> metas = Lists.newArrayList(
+ List<ContentTableMeta<TargetCatchDto>> metas = Arrays.asList(
ContentTableModel.newTableMeta(TargetCatchDto.class, WeightCategoryDto.PROPERTY_SPECIES, true),
ContentTableModel.newTableMeta(TargetCatchDto.class, TargetCatchDto.PROPERTY_WEIGHT_CATEGORY, true),
ContentTableModel.newTableMeta(TargetCatchDto.class, TargetCatchDto.PROPERTY_REASON_FOR_DISCARD, true),
@@ -74,11 +74,12 @@ public class TargetDiscardCatchUIModel extends ContentTableUIModel<SetSeineTarge
@Override
protected ContentTableModel<SetSeineTargetCatchDto, TargetCatchDto> createTableModel(
- ObserveContentTableUI<SetSeineTargetCatchDto, TargetCatchDto> ui,
+ ObserveContentTableUI<SetSeineTargetCatchDto, TargetCatchDto, ?> ui,
List<ContentTableMeta<TargetCatchDto>> contentTableMetas) {
return new ContentTableModel<SetSeineTargetCatchDto, TargetCatchDto>(ui, contentTableMetas) {
private static final long serialVersionUID = 1L;
+
@Override
protected Collection<TargetCatchDto> getChilds(SetSeineTargetCatchDto bean) {
return bean.getTargetCatch();
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetSampleCaptureUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetSampleCaptureUI.jaxx
index 69ab37d..49e14a1 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetSampleCaptureUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetSampleCaptureUI.jaxx
@@ -20,10 +20,9 @@
#L%
-->
-<TargetSampleUI
- contentTitle='{n("observe.common.targetSampleCapture")}'
- saveNewEntryText='{n("observe.content.action.create.targetSampleCapture")}'
- saveNewEntryTip='{n("observe.content.action.create.targetSampleCapture.tip")}'>
+<TargetSampleUI contentTitle='{n("observe.common.targetSampleCapture")}'
+ saveNewEntryText='{n("observe.content.action.create.targetSampleCapture")}'
+ saveNewEntryTip='{n("observe.content.action.create.targetSampleCapture.tip")}'>
<import>
static org.nuiton.i18n.I18n.n
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetSampleRejeteUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetSampleRejeteUI.jaxx
index 36f5716..a80c9de 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetSampleRejeteUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetSampleRejeteUI.jaxx
@@ -20,10 +20,9 @@
#L%
-->
-<TargetSampleUI
- contentTitle='{n("observe.common.targetSample")}'
- saveNewEntryText='{n("observe.content.action.create.targetSample")}'
- saveNewEntryTip='{n("observe.content.action.create.targetSample.tip")}'>
+<TargetSampleUI contentTitle='{n("observe.common.targetSample")}'
+ saveNewEntryText='{n("observe.content.action.create.targetSample")}'
+ saveNewEntryTip='{n("observe.content.action.create.targetSample.tip")}'>
<import>
static org.nuiton.i18n.I18n.n
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetSampleUI.jaxx b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetSampleUI.jaxx
index 74667d6..717e3d1 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetSampleUI.jaxx
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetSampleUI.jaxx
@@ -21,8 +21,7 @@
-->
<fr.ird.observe.application.swing.ui.content.table.ContentTableUI
- superGenericType='TargetSampleDto, TargetLengthDto'
- abstract="true">
+ superGenericType='TargetSampleDto, TargetLengthDto, TargetSampleUI' abstract="true">
<style source="AbstractSampleUI.jcss"/>
@@ -61,22 +60,16 @@
<ContentTableModel id='tableModel'/>
<!-- le validateur de l'écran -->
- <BeanValidator id='validator'
- beanClass='fr.ird.observe.services.dto.seine.TargetSampleDto'
- errorTableModel='{getErrorTableModel()}'
- context='ui-update'>
+ <BeanValidator id='validator' beanClass='fr.ird.observe.services.dto.seine.TargetSampleDto'
+ errorTableModel='{getErrorTableModel()}' context='ui-update'>
<!-- clef unique -->
<field name="targetLength" component="editorPanel"/>
<field name='comment'/>
</BeanValidator>
<!-- le validateur d'une entrée de tableau -->
- <BeanValidator id='validatorTable'
- autoField='true'
- beanClass='fr.ird.observe.services.dto.seine.TargetLengthDto'
- errorTableModel='{getErrorTableModel()}'
- context='ui-update'
- parentValidator='{validator}'/>
+ <BeanValidator id='validatorTable' autoField='true' beanClass='fr.ird.observe.services.dto.seine.TargetLengthDto'
+ errorTableModel='{getErrorTableModel()}' context='ui-update' parentValidator='{validator}'/>
<ButtonGroup id='acquisitionModeGroup'
onStateChanged='getHandler().updateModeSaisie((ModeSaisieEchantillonEnum) acquisitionModeGroup.getSelectedValue())'/>
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetSampleUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetSampleUIHandler.java
index 818bbd3..20ff998 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetSampleUIHandler.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetSampleUIHandler.java
@@ -26,7 +26,6 @@ import fr.ird.observe.application.swing.db.DataContext;
import fr.ird.observe.application.swing.ui.UIHelper;
import fr.ird.observe.application.swing.ui.content.ContentMode;
import fr.ird.observe.application.swing.ui.content.table.ContentTableModel;
-import fr.ird.observe.application.swing.ui.content.table.ContentTableUI;
import fr.ird.observe.services.dto.Form;
import fr.ird.observe.services.dto.referential.ReferentialDto;
import fr.ird.observe.services.dto.referential.ReferentialReference;
@@ -46,7 +45,11 @@ import org.nuiton.validator.NuitonValidatorScope;
import javax.swing.JComponent;
import javax.swing.JTable;
+import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.table.DefaultTableCellRenderer;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.FocusTraversalPolicy;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
@@ -60,7 +63,7 @@ import static org.nuiton.i18n.I18n.t;
* @author Tony Chemit - chemit(a)codelutin.com
* @since 1.0
*/
-public class TargetSampleUIHandler extends AbstractSampleUIHandler<TargetSampleDto, TargetLengthDto> {
+public class TargetSampleUIHandler extends AbstractSampleUIHandler<TargetSampleDto, TargetLengthDto, TargetSampleUI> {
/** Logger */
private static final Log log = LogFactory.getLog(TargetSampleUIHandler.class);
@@ -73,14 +76,38 @@ public class TargetSampleUIHandler extends AbstractSampleUIHandler<TargetSampleD
*/
protected final boolean discarded;
- public TargetSampleUIHandler(ContentTableUI<TargetSampleDto, TargetLengthDto> ui, boolean discarded) {
+ public TargetSampleUIHandler(TargetSampleUI ui, boolean discarded) {
super(ui);
this.discarded = discarded;
}
@Override
- public TargetSampleUI getUi() {
- return (TargetSampleUI) super.getUi();
+ protected FocusTraversalPolicy createFocusTraversalPolicy(TargetSampleUI ui) {
+ return new LayoutFocusTraversalPolicy() {
+ @Override
+ public Component getComponentBefore(Container aContainer, Component aComponent) {
+ if (aComponent.equals(ui.getAcquisitionModeEffectif())) {
+ return getLastComponent(aContainer);
+ }
+ if (aComponent.equals(ui.getSizeMeasureType().getCombobox().getEditor().getEditorComponent()) && !ui.getAcquisitionModeEffectif().isEnabled()) {
+ return super.getLastComponent(aContainer);
+ }
+ return super.getComponentBefore(aContainer, aComponent);
+ }
+
+ @Override
+ public Component getFirstComponent(Container aContainer) {
+ if (ui.getAcquisitionModeEffectif().isEnabled()) {
+ return ui.getAcquisitionModeEffectif();
+ }
+ return ui.getSizeMeasureType();
+ }
+
+ @Override
+ public Component getLastComponent(Container aContainer) {
+ return getDefaultLastComponent(ui, ui.getComment2());
+ }
+ };
}
@Override
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetSampleUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetSampleUIModel.java
index 8a3ecbb..8e81801 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetSampleUIModel.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/table/impl/seine/TargetSampleUIModel.java
@@ -47,7 +47,7 @@ public class TargetSampleUIModel extends ContentTableUIModel<TargetSampleDto, Ta
private static final long serialVersionUID = 1L;
- public static final String PROPERTY_DEFAULT_SIZE_MEASURE_TYPE="defaultSizeMeasureType";
+ public static final String PROPERTY_DEFAULT_SIZE_MEASURE_TYPE = "defaultSizeMeasureType";
private ReferentialReference<SizeMeasureTypeDto> defaultSizeMeasureType;
@@ -85,7 +85,7 @@ public class TargetSampleUIModel extends ContentTableUIModel<TargetSampleDto, Ta
@Override
protected ContentTableModel<TargetSampleDto, TargetLengthDto> createTableModel(
- ObserveContentTableUI<TargetSampleDto, TargetLengthDto> ui,
+ ObserveContentTableUI<TargetSampleDto, TargetLengthDto, ?> ui,
List<ContentTableMeta<TargetLengthDto>> contentTableMetas) {
return new ContentTableModel<TargetSampleDto, TargetLengthDto>(ui, contentTableMetas) {
private static final long serialVersionUID = 1L;
--
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm(a)codelutin.com>.
1
0
25 Nov '16
This is an automated email from the git hooks/post-receive script.
New commit to branch develop in repository observe.
See https://gitlab.nuiton.org/codelutin/observe.git
commit 9d34e50c74d689c97d15afb2f1d791b6b4a67a97
Author: Tony CHEMIT <chemit(a)codelutin.com>
Date: Tue Nov 8 12:20:37 2016 +0100
Ajout raccourci clavier sur les listes déroulantes
---
.../swing/ui/content/ContentUIInitializer.java | 41 ++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java
index 6cd093c..c2cee31 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/content/ContentUIInitializer.java
@@ -69,7 +69,9 @@ import org.nuiton.jaxx.widgets.gis.absolute.CoordinatesEditor;
import org.nuiton.jaxx.widgets.select.FilterableDoubleList;
import org.nuiton.util.DateUtil;
+import javax.swing.AbstractAction;
import javax.swing.AbstractButton;
+import javax.swing.Action;
import javax.swing.ActionMap;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
@@ -82,6 +84,7 @@ import javax.swing.JSpinner;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JTextField;
+import javax.swing.KeyStroke;
import javax.swing.ListCellRenderer;
import javax.swing.SwingUtilities;
import javax.swing.border.LineBorder;
@@ -89,6 +92,7 @@ import javax.swing.table.TableCellEditor;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
+import java.awt.event.ActionEvent;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.ItemEvent;
@@ -361,6 +365,43 @@ public class ContentUIInitializer<E extends IdDto, UI extends ObserveContentUI<E
}
beanComboBox.setI18nPrefix("observe.common.");
beanComboBox.setMinimumSize(new Dimension(0, 24));
+ beanComboBox.getResetButton().setToolTipText(beanComboBox.getResetButton().getToolTipText() + " (ctrl + D)");
+ beanComboBox.getChangeDecorator().setToolTipText(beanComboBox.getChangeDecorator().getToolTipText() + " (ctrl + F)");
+ JComponent editorComponent = (JComponent) beanComboBox.getCombobox().getEditor().getEditorComponent();
+
+ Action resetAction = new AbstractAction() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ beanComboBox.doActionPerformed__on__resetButton(null);
+ SwingUtilities.invokeLater(beanComboBox::grabFocus);
+ }
+ };
+
+ editorComponent.getInputMap(JComponent.WHEN_FOCUSED).put(KeyStroke.getKeyStroke("ctrl pressed D"), "resetAction");
+ editorComponent.getActionMap().put("resetAction", resetAction);
+
+ Action showPopupAction = new AbstractAction() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if (!beanComboBox.getCombobox().isPopupVisible()) {
+ beanComboBox.getCombobox().showPopup();
+ } else {
+ beanComboBox.setSelectedItem(beanComboBox.getCombobox().getEditor().getItem());
+ beanComboBox.getCombobox().hidePopup();
+ }
+ }
+ };
+ editorComponent.getInputMap(JComponent.WHEN_FOCUSED).put(KeyStroke.getKeyStroke("ENTER"), "showPopupAction");
+ editorComponent.getActionMap().put("showPopupAction", showPopupAction);
+
+ Action showDecoratorPopupAction = new AbstractAction() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ beanComboBox.getPopup().show(beanComboBox, 0, 0);
+ }
+ };
+ editorComponent.getInputMap(JComponent.WHEN_FOCUSED).put(KeyStroke.getKeyStroke("ctrl pressed F"), "showDecoratorPopupAction");
+ editorComponent.getActionMap().put("showDecoratorPopupAction", showDecoratorPopupAction);
Class dtoClass = getDtoClass(beanComboBox);
--
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm(a)codelutin.com>.
1
0
04/32: refs #8554 : changement de la configuration du pool de connections
by codelutin.com scm 25 Nov '16
by codelutin.com scm 25 Nov '16
25 Nov '16
This is an automated email from the git hooks/post-receive script.
New commit to branch develop in repository observe.
See https://gitlab.nuiton.org/codelutin/observe.git
commit 160c3dd34986bb75da4b3da8983696f3870cda89
Author: Tony CHEMIT <chemit(a)codelutin.com>
Date: Fri Nov 25 15:22:11 2016 +0100
refs #8554 : changement de la configuration du pool de connections
---
.../observe/ObserveTopiaApplicationContext.java | 25 ++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/entities/src/main/java/fr/ird/observe/ObserveTopiaApplicationContext.java b/entities/src/main/java/fr/ird/observe/ObserveTopiaApplicationContext.java
index 5a649b9..2efe028 100644
--- a/entities/src/main/java/fr/ird/observe/ObserveTopiaApplicationContext.java
+++ b/entities/src/main/java/fr/ird/observe/ObserveTopiaApplicationContext.java
@@ -32,6 +32,7 @@ import org.apache.commons.logging.LogFactory;
import org.hibernate.HibernateException;
import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
+import org.nuiton.topia.persistence.HibernateAvailableSettings;
import org.nuiton.topia.persistence.TopiaException;
import org.nuiton.topia.persistence.internal.support.TopiaMetadataModelSupportImpl;
import org.nuiton.topia.persistence.jdbc.JdbcH2Helper;
@@ -49,6 +50,7 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.util.LinkedHashSet;
import java.util.Objects;
+import java.util.Properties;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
@@ -65,8 +67,6 @@ public class ObserveTopiaApplicationContext extends AbstractObserveTopiaApplicat
public static final String SQL_BATCH_SERVICE_NAME = "sqlBatch";
- public static final String DB_VERSION = "db.version";
-
private static final String CREATE_SCHEMA_SCRIPT
= "CREATE SCHEMA OBSERVE_COMMON;\n"
+ "CREATE SCHEMA OBSERVE_LONGLINE;\n"
@@ -93,6 +93,23 @@ public class ObserveTopiaApplicationContext extends AbstractObserveTopiaApplicat
this.topiaMetadataModelSupport = new TopiaMetadataModelSupportImpl("fr.ird.observe", "Observe");
this.topiaSqlTablesFactory = new TopiaSqlTablesFactory(getMetadataModel(), this);
this.observeMigrationConfigurationProvider = ObserveMigrationConfigurationProvider.get();
+
+ // La valeur par défaut dans ToPIA est 20 et c'est trop peu
+ //FIXME Il semblerait que l'export d'une marée consome une connection mais ne la rend pas
+ //FIXME On devrait du coup limiter le nombre de marées à exporter (200-300)
+ Properties properties = new Properties();
+ properties.put(HibernateAvailableSettings.C3P0_MAX_SIZE, 500);
+ properties.put(HibernateAvailableSettings.C3P0_MAX_STATEMENTS, 500);
+ properties.put(HibernateAvailableSettings.C3P0_TIMEOUT, 100);
+ getHibernateProvider().getHibernateConfiguration().addProperties(properties);
+
+ }
+
+ @Override
+ public ObserveTopiaPersistenceContext newPersistenceContext() {
+ ObserveTopiaPersistenceContext persistenceContext = super.newPersistenceContext();
+ persistenceContext.setShowSql(getConfiguration().isShowSql());
+ return persistenceContext;
}
@Override
@@ -108,10 +125,6 @@ public class ObserveTopiaApplicationContext extends AbstractObserveTopiaApplicat
this.open = open;
}
- public ObserveMigrationConfigurationProvider getObserveMigrationConfigurationProvider() {
- return observeMigrationConfigurationProvider;
- }
-
public ObserveMigrationEngine getMigrationService() {
return getServices(ObserveMigrationEngine.class).get(MIGRATION_SERVICE_NAME);
}
--
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm(a)codelutin.com>.
1
0
This is an automated email from the git hooks/post-receive script.
New commit to branch develop in repository observe.
See https://gitlab.nuiton.org/codelutin/observe.git
commit 8b5270a0c18ad9fecaf774b7ac17f097e1f20c8a
Author: Tony CHEMIT <chemit(a)codelutin.com>
Date: Fri Nov 25 15:20:11 2016 +0100
refs #8554 Ajout de logs sur le sql
---
.../swing/db/ObserveSwingDataSource.java | 7 +-
.../fr/ird/observe/ObserveTopiaConfiguration.java | 12 ++-
.../observe/ObserveTopiaConfigurationFactory.java | 17 ++--
.../observe/ObserveTopiaPersistenceContext.java | 18 +++-
.../java/fr/ird/observe/RunScriptTopiaSqlWork.java | 11 ++-
.../fr/ird/observe/RunScriptsTopiaSqlWork.java | 6 +-
...ObserveDataSourceConfigurationTopiaSupport.java | 11 +++
.../services/topia/ObserveServiceFactoryTopia.java | 3 -
.../ObserveTopiaApplicationContextFactory.java | 15 ++-
.../topia/service/DataSourceServiceTopia.java | 2 +
.../service/data/ImportTripScriptTopiaSqlWork.java | 14 ++-
.../service/data/TripManagementServiceTopia.java | 9 +-
.../service/sql/SqlScriptProducerServiceTopia.java | 9 +-
.../topia/service/sql/batch/SqlRequests.java | 108 ++++-----------------
.../sql/batch/TopiaSqlBatchServiceImpl.java | 8 +-
.../sql/batch/actions/AbstractSchemaAction.java | 4 +-
.../sql/batch/actions/AbstractSqlAction.java | 15 ++-
.../sql/batch/actions/AbstractSqlRequest.java | 7 --
.../sql/batch/actions/AbstractTablesAction.java | 47 +++++++--
.../sql/batch/actions/CreateSchemaAction.java | 14 ++-
.../sql/batch/actions/DeleteTablesAction.java | 10 +-
.../sql/batch/actions/DropSchemaAction.java | 15 ++-
.../sql/batch/actions/ReplicateTablesAction.java | 6 +-
.../sql/batch/actions/UpdateTablesAction.java | 10 +-
.../sql/batch/tables/TopiaSqlTablesFactory.java | 12 +--
25 files changed, 213 insertions(+), 177 deletions(-)
diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/db/ObserveSwingDataSource.java b/application-swing/src/main/java/fr/ird/observe/application/swing/db/ObserveSwingDataSource.java
index 526da30..482abbb 100644
--- a/application-swing/src/main/java/fr/ird/observe/application/swing/db/ObserveSwingDataSource.java
+++ b/application-swing/src/main/java/fr/ird/observe/application/swing/db/ObserveSwingDataSource.java
@@ -58,6 +58,7 @@ import fr.ird.observe.services.service.DatabaseConnexionNotAuthorizedException;
import fr.ird.observe.services.service.DatabaseDestroyNotAuthorizedException;
import fr.ird.observe.services.service.DatabaseNotFoundException;
import fr.ird.observe.services.service.LastUpdateDateService;
+import fr.ird.observe.services.service.data.NavigationService;
import fr.ird.observe.services.service.referential.ObserveReferentialCache;
import fr.ird.observe.services.service.PingService;
import fr.ird.observe.services.service.referential.ReferentialService;
@@ -451,7 +452,11 @@ public class ObserveSwingDataSource extends AbstractSerializableBean implements
speciesListConfiguration.setSpeciesListSeineObjectSchoolEstimateId(config.getSpeciesListSeineObjectSchoolEstimateId());
speciesListConfiguration.setSpeciesListSeineSchoolEstimateId(config.getSpeciesListSeineSchoolEstimateId());
speciesListConfiguration.setSpeciesListSeineTargetCatchId(config.getSpeciesListSeineTargetCatchId());
-
+ boolean showSql = config.isShowSql();
+ if (showSql && configurationAndConnection.getConfiguration() instanceof ObserveDataSourceConfigurationTopiaSupport) {
+ ObserveDataSourceConfigurationTopiaSupport configuration = (ObserveDataSourceConfigurationTopiaSupport) configurationAndConnection.getConfiguration();
+ configuration.setTraceSql(true);
+ }
return ObserveServiceInitializer.create(
locale,
referentialLocale,
diff --git a/entities/src/main/java/fr/ird/observe/ObserveTopiaConfiguration.java b/entities/src/main/java/fr/ird/observe/ObserveTopiaConfiguration.java
index 165217c..2eb67ef 100644
--- a/entities/src/main/java/fr/ird/observe/ObserveTopiaConfiguration.java
+++ b/entities/src/main/java/fr/ird/observe/ObserveTopiaConfiguration.java
@@ -22,6 +22,7 @@ package fr.ird.observe;
* #L%
*/
+import com.google.common.collect.ImmutableMap;
import org.nuiton.topia.persistence.BeanTopiaConfiguration;
import org.nuiton.topia.persistence.jdbc.JdbcConfiguration;
@@ -35,13 +36,22 @@ public class ObserveTopiaConfiguration extends BeanTopiaConfiguration {
private static final long serialVersionUID = 1L;
protected final boolean h2Configuration;
+ protected final boolean showSql;
- public ObserveTopiaConfiguration(JdbcConfiguration jdbcConfiguration, boolean h2Configuration) {
+ public ObserveTopiaConfiguration(JdbcConfiguration jdbcConfiguration, boolean h2Configuration, boolean showSql) {
super(jdbcConfiguration);
this.h2Configuration = h2Configuration;
+ this.showSql = showSql;
+ if (showSql) {
+ setHibernateExtraConfiguration(ImmutableMap.of("hibernate.show_sql", Boolean.TRUE.toString()));
+ }
}
public boolean isH2Configuration() {
return h2Configuration;
}
+
+ public boolean isShowSql() {
+ return showSql;
+ }
}
diff --git a/entities/src/main/java/fr/ird/observe/ObserveTopiaConfigurationFactory.java b/entities/src/main/java/fr/ird/observe/ObserveTopiaConfigurationFactory.java
index f911347..3f90d08 100644
--- a/entities/src/main/java/fr/ird/observe/ObserveTopiaConfigurationFactory.java
+++ b/entities/src/main/java/fr/ird/observe/ObserveTopiaConfigurationFactory.java
@@ -89,7 +89,8 @@ public class ObserveTopiaConfigurationFactory {
String password,
boolean initSchema,
boolean showMigrationSql,
- boolean showMigrationProgression) {
+ boolean showMigrationProgression,
+ boolean traceSql) {
JdbcConfiguration jdbcConfiguration = JDBC_CONFIGURATION_BUILDER.forPostgresqlDatabase(jdbcUrl, username, password);
@@ -97,7 +98,8 @@ public class ObserveTopiaConfigurationFactory {
initSchema,
showMigrationSql,
showMigrationProgression,
- false);
+ false,
+ traceSql);
if (log.isDebugEnabled()) {
log.debug("PG topia configuration: " + topiaConfiguration);
@@ -112,7 +114,8 @@ public class ObserveTopiaConfigurationFactory {
String password,
boolean initSchema,
boolean showMigrationSql,
- boolean showMigrationProgression) {
+ boolean showMigrationProgression,
+ boolean traceSql) {
String dbPath = new File(dbDirectory, dbName).getPath();
String jdbcUrl = String.format(H2_LOCAL_URL, dbPath);
@@ -123,7 +126,8 @@ public class ObserveTopiaConfigurationFactory {
initSchema,
showMigrationSql,
showMigrationProgression,
- true);
+ true,
+ traceSql);
if (log.isDebugEnabled()) {
log.debug("H2 topia configuration: " + topiaConfiguration);
@@ -136,9 +140,10 @@ public class ObserveTopiaConfigurationFactory {
boolean initSchema,
boolean showMigrationSql,
boolean showMigrationProgression,
- boolean h2Configuration) {
+ boolean h2Configuration,
+ boolean traceSql) {
- ObserveTopiaConfiguration topiaConfiguration = new ObserveTopiaConfiguration(jdbcConfiguration, h2Configuration);
+ ObserveTopiaConfiguration topiaConfiguration = new ObserveTopiaConfiguration(jdbcConfiguration, h2Configuration, traceSql);
topiaConfiguration.setTopiaIdFactoryClass(ObserveTopiaIdFactory.class);
topiaConfiguration.setInitSchema(initSchema);
topiaConfiguration.setValidateSchema(false);
diff --git a/entities/src/main/java/fr/ird/observe/ObserveTopiaPersistenceContext.java b/entities/src/main/java/fr/ird/observe/ObserveTopiaPersistenceContext.java
index cc71057..43ac98d 100644
--- a/entities/src/main/java/fr/ird/observe/ObserveTopiaPersistenceContext.java
+++ b/entities/src/main/java/fr/ird/observe/ObserveTopiaPersistenceContext.java
@@ -46,6 +46,8 @@ public class ObserveTopiaPersistenceContext extends AbstractObserveTopiaPersiste
*/
private static final Log log = LogFactory.getLog(ObserveTopiaPersistenceContext.class);
+ private boolean showSql;
+
public ObserveTopiaPersistenceContext(AbstractTopiaPersistenceContextConstructorParameter parameter) {
super(parameter);
}
@@ -122,6 +124,14 @@ public class ObserveTopiaPersistenceContext extends AbstractObserveTopiaPersiste
}
+ public void setShowSql(boolean showSql) {
+ this.showSql = showSql;
+ }
+
+ public boolean isShowSql() {
+ return showSql;
+ }
+
protected class CountTableSqlWork extends TopiaSqlQuery<Long> {
private final String fullyTableName;
@@ -133,7 +143,9 @@ public class ObserveTopiaPersistenceContext extends AbstractObserveTopiaPersiste
@Override
public PreparedStatement prepareQuery(Connection connection) throws SQLException {
String sql = "SELECT count(*) FROM " + fullyTableName;
-
+ if (showSql) {
+ log.debug(sql);
+ }
return connection.prepareStatement(sql);
}
@@ -145,11 +157,11 @@ public class ObserveTopiaPersistenceContext extends AbstractObserveTopiaPersiste
public void executeSqlScript(byte... content) {
- getSqlSupport().doSqlWork(new RunScriptTopiaSqlWork(1000, content));
+ getSqlSupport().doSqlWork(new RunScriptTopiaSqlWork(1000, showSql, content));
}
public void executeSqlScripts(byte[]... contents) {
- getSqlSupport().doSqlWork(new RunScriptsTopiaSqlWork(1000, contents));
+ getSqlSupport().doSqlWork(new RunScriptsTopiaSqlWork(1000, showSql, contents));
}
}
diff --git a/entities/src/main/java/fr/ird/observe/RunScriptTopiaSqlWork.java b/entities/src/main/java/fr/ird/observe/RunScriptTopiaSqlWork.java
index 778199c..41538b7 100644
--- a/entities/src/main/java/fr/ird/observe/RunScriptTopiaSqlWork.java
+++ b/entities/src/main/java/fr/ird/observe/RunScriptTopiaSqlWork.java
@@ -54,9 +54,11 @@ public class RunScriptTopiaSqlWork implements TopiaSqlWork {
protected final byte[] content;
protected final boolean gzip;
protected final int batchSize;
+ protected final boolean showSql;
- public RunScriptTopiaSqlWork(int batchSize, byte[] content) {
+ public RunScriptTopiaSqlWork(int batchSize, boolean showSql, byte[] content) {
this.batchSize = batchSize;
+ this.showSql = showSql;
this.content = content;
if (content == null || content.length == 0) {
@@ -98,11 +100,10 @@ public class RunScriptTopiaSqlWork implements TopiaSqlWork {
if (trimLine.isEmpty() || trimLine.startsWith("--")) {
continue;
}
-
- statement.addBatch(trimLine);
- if (log.isDebugEnabled()) {
- log.debug("Sql statement: " + trimLine);
+ if (showSql || log.isDebugEnabled()) {
+ log.info(trimLine);
}
+ statement.addBatch(trimLine);
batchSize++;
if (batchSize % this.batchSize == 0) {
diff --git a/entities/src/main/java/fr/ird/observe/RunScriptsTopiaSqlWork.java b/entities/src/main/java/fr/ird/observe/RunScriptsTopiaSqlWork.java
index d32ce14..bf5a3c6 100644
--- a/entities/src/main/java/fr/ird/observe/RunScriptsTopiaSqlWork.java
+++ b/entities/src/main/java/fr/ird/observe/RunScriptsTopiaSqlWork.java
@@ -36,8 +36,8 @@ public class RunScriptsTopiaSqlWork extends RunScriptTopiaSqlWork {
protected final byte[][] contents;
- public RunScriptsTopiaSqlWork(int batchSize, byte[][] contents) {
- super(batchSize, null);
+ public RunScriptsTopiaSqlWork(int batchSize, boolean showSql, byte[][] contents) {
+ super(batchSize, showSql, null);
this.contents = contents;
}
@@ -45,7 +45,7 @@ public class RunScriptsTopiaSqlWork extends RunScriptTopiaSqlWork {
protected void execute0(Connection connection) throws SQLException {
for (byte[] content : contents) {
- new RunScriptTopiaSqlWork(batchSize, content).execute0(connection);
+ new RunScriptTopiaSqlWork(batchSize, showSql, content).execute0(connection);
}
}
diff --git a/services-configuration-topia/src/main/java/fr/ird/observe/services/configuration/topia/ObserveDataSourceConfigurationTopiaSupport.java b/services-configuration-topia/src/main/java/fr/ird/observe/services/configuration/topia/ObserveDataSourceConfigurationTopiaSupport.java
index 4435b8f..085f3ba 100644
--- a/services-configuration-topia/src/main/java/fr/ird/observe/services/configuration/topia/ObserveDataSourceConfigurationTopiaSupport.java
+++ b/services-configuration-topia/src/main/java/fr/ird/observe/services/configuration/topia/ObserveDataSourceConfigurationTopiaSupport.java
@@ -72,6 +72,9 @@ public abstract class ObserveDataSourceConfigurationTopiaSupport implements Obse
private Version modelVersion;
+ /** Pour logger les requetes sql **/
+ private boolean traceSql;
+
public abstract boolean isH2Database();
public abstract boolean isPostgresDatabase();
@@ -152,4 +155,12 @@ public abstract class ObserveDataSourceConfigurationTopiaSupport implements Obse
public ObserveDataSourceType getType() {
return ObserveDataSourceType.SQL;
}
+
+ public boolean isTraceSql() {
+ return traceSql;
+ }
+
+ public void setTraceSql(boolean traceSql) {
+ this.traceSql = traceSql;
+ }
}
diff --git a/services-topia/src/main/java/fr/ird/observe/services/topia/ObserveServiceFactoryTopia.java b/services-topia/src/main/java/fr/ird/observe/services/topia/ObserveServiceFactoryTopia.java
index 8b6da41..7014803 100644
--- a/services-topia/src/main/java/fr/ird/observe/services/topia/ObserveServiceFactoryTopia.java
+++ b/services-topia/src/main/java/fr/ird/observe/services/topia/ObserveServiceFactoryTopia.java
@@ -256,10 +256,8 @@ public class ObserveServiceFactoryTopia extends ObserveServiceFactorySupport {
ObserveTopiaApplicationContext source = serviceContext.getTopiaApplicationContext();
- long t0 = TimeLog.getTime();
try (ObserveTopiaPersistenceContext topiaPersistenceContext = source.newPersistenceContext()) {
-
serviceContext.setTopiaPersistenceContext(topiaPersistenceContext);
Object invoke = invokeMethod(method, args);
@@ -277,7 +275,6 @@ public class ObserveServiceFactoryTopia extends ObserveServiceFactorySupport {
serviceContext.setTopiaPersistenceContext(null);
- TIME_LOG.log(t0, "invokeMethodWithTransaction", method.getName());
}
diff --git a/services-topia/src/main/java/fr/ird/observe/services/topia/ObserveTopiaApplicationContextFactory.java b/services-topia/src/main/java/fr/ird/observe/services/topia/ObserveTopiaApplicationContextFactory.java
index 781df96..e98e0b1 100644
--- a/services-topia/src/main/java/fr/ird/observe/services/topia/ObserveTopiaApplicationContextFactory.java
+++ b/services-topia/src/main/java/fr/ird/observe/services/topia/ObserveTopiaApplicationContextFactory.java
@@ -56,12 +56,9 @@ public class ObserveTopiaApplicationContextFactory {
Optional<ObserveTopiaApplicationContext> optionalTopiaApplicationContext = getTopiaApplicationContextIfPresent(dataSourceConfiguration);
ObserveTopiaApplicationContext topiaApplicationContext;
- if (optionalTopiaApplicationContext.isPresent()) {
- topiaApplicationContext = optionalTopiaApplicationContext.get();
- } else {
- // Si on demande de créer ici une base, on ne fait rien sur le schéma
- topiaApplicationContext = createTopiaApplicationContext(dataSourceConfiguration, false);
- }
+ // Si on demande de créer ici une base, on ne fait rien sur le schéma
+ topiaApplicationContext = optionalTopiaApplicationContext.orElseGet(
+ () -> createTopiaApplicationContext(dataSourceConfiguration, false));
return topiaApplicationContext;
}
@@ -131,7 +128,8 @@ public class ObserveTopiaApplicationContextFactory {
String.valueOf(configuration.getPassword()),
initSchema,
configuration.isShowMigrationSql(),
- configuration.isShowMigrationProgression()
+ configuration.isShowMigrationProgression(),
+ configuration.isTraceSql()
);
if (log.isInfoEnabled()) {
@@ -161,7 +159,8 @@ public class ObserveTopiaApplicationContextFactory {
String.valueOf(configuration.getPassword()),
initSchema,
configuration.isShowMigrationSql(),
- configuration.isShowMigrationProgression()
+ configuration.isShowMigrationProgression(),
+ configuration.isTraceSql()
);
if (log.isInfoEnabled()) {
diff --git a/services-topia/src/main/java/fr/ird/observe/services/topia/service/DataSourceServiceTopia.java b/services-topia/src/main/java/fr/ird/observe/services/topia/service/DataSourceServiceTopia.java
index b857b52..77f66a9 100644
--- a/services-topia/src/main/java/fr/ird/observe/services/topia/service/DataSourceServiceTopia.java
+++ b/services-topia/src/main/java/fr/ird/observe/services/topia/service/DataSourceServiceTopia.java
@@ -143,6 +143,7 @@ public class DataSourceServiceTopia extends ObserveServiceTopia implements DataS
new String(h2DataSourceConfiguration.getPassword()),
false,
false,
+ false,
false);
@@ -168,6 +169,7 @@ public class DataSourceServiceTopia extends ObserveServiceTopia implements DataS
new String(pgDataSourceConfiguration.getPassword()),
false,
false,
+ false,
false);
try {
diff --git a/services-topia/src/main/java/fr/ird/observe/services/topia/service/data/ImportTripScriptTopiaSqlWork.java b/services-topia/src/main/java/fr/ird/observe/services/topia/service/data/ImportTripScriptTopiaSqlWork.java
index 14c7d5b..60b7fb2 100644
--- a/services-topia/src/main/java/fr/ird/observe/services/topia/service/data/ImportTripScriptTopiaSqlWork.java
+++ b/services-topia/src/main/java/fr/ird/observe/services/topia/service/data/ImportTripScriptTopiaSqlWork.java
@@ -25,6 +25,8 @@ package fr.ird.observe.services.topia.service.data;
import com.google.common.collect.ImmutableSet;
import fr.ird.observe.RunScriptTopiaSqlWork;
import fr.ird.observe.services.service.sql.ObserveBlobsContainer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import javax.sql.rowset.serial.SerialBlob;
import java.sql.Connection;
@@ -39,10 +41,13 @@ import java.util.Map;
*/
public class ImportTripScriptTopiaSqlWork extends RunScriptTopiaSqlWork {
+ /** Logger */
+ private static final Log log = LogFactory.getLog(ImportTripScriptTopiaSqlWork.class);
+
private final ImmutableSet<ObserveBlobsContainer> blobsContainers;
- public ImportTripScriptTopiaSqlWork(int batchSize, byte[] content, ImmutableSet<ObserveBlobsContainer> blobsContainers) {
- super(batchSize, content);
+ public ImportTripScriptTopiaSqlWork(int batchSize, boolean showSql, byte[] content, ImmutableSet<ObserveBlobsContainer> blobsContainers) {
+ super(batchSize, showSql, content);
this.blobsContainers = blobsContainers;
}
@@ -57,6 +62,11 @@ public class ImportTripScriptTopiaSqlWork extends RunScriptTopiaSqlWork {
int batchSize = 0;
String sql = String.format("update %s SET %s = ? WHERE topiaId= ?", tableName, columnName);
+ if (showSql) {
+ if (log.isInfoEnabled()) {
+ log.info(sql);
+ }
+ }
try (PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
for (Map.Entry<String, byte[]> containerEntry : blobsContainer.getBlobsById().entrySet()) {
diff --git a/services-topia/src/main/java/fr/ird/observe/services/topia/service/data/TripManagementServiceTopia.java b/services-topia/src/main/java/fr/ird/observe/services/topia/service/data/TripManagementServiceTopia.java
index fff3a98..cd7c876 100644
--- a/services-topia/src/main/java/fr/ird/observe/services/topia/service/data/TripManagementServiceTopia.java
+++ b/services-topia/src/main/java/fr/ird/observe/services/topia/service/data/TripManagementServiceTopia.java
@@ -24,6 +24,7 @@ package fr.ird.observe.services.topia.service.data;
import com.google.common.collect.ImmutableSet;
import fr.ird.observe.ObserveTopiaPersistenceContext;
+import fr.ird.observe.services.dto.IdHelper;
import fr.ird.observe.services.service.data.DeleteTripRequest;
import fr.ird.observe.services.service.data.DeleteTripResult;
import fr.ird.observe.services.service.data.ExportTripRequest;
@@ -31,14 +32,13 @@ import fr.ird.observe.services.service.data.ExportTripResult;
import fr.ird.observe.services.service.data.ImportTripRequest;
import fr.ird.observe.services.service.data.ImportTripResult;
import fr.ird.observe.services.service.data.TripManagementService;
-import fr.ird.observe.services.topia.ObserveServiceContextTopia;
-import fr.ird.observe.services.topia.ObserveServiceTopia;
-import fr.ird.observe.services.dto.IdHelper;
import fr.ird.observe.services.service.sql.AddSqlScriptProducerRequest;
import fr.ird.observe.services.service.sql.AddSqlScriptProducerResult;
import fr.ird.observe.services.service.sql.DeleteSqlScriptProducerRequest;
import fr.ird.observe.services.service.sql.ObserveBlobsContainer;
import fr.ird.observe.services.service.sql.SqlScriptProducerService;
+import fr.ird.observe.services.topia.ObserveServiceContextTopia;
+import fr.ird.observe.services.topia.ObserveServiceTopia;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.StringUtil;
@@ -158,7 +158,8 @@ public class TripManagementServiceTopia extends ObserveServiceTopia implements T
} else {
- persistenceContext.getSqlSupport().doSqlWork(new ImportTripScriptTopiaSqlWork(1000, request.getSqlContent(), blobsContainers));
+ boolean showSql = serviceContext.getTopiaApplicationContext().getConfiguration().isShowSql();
+ persistenceContext.getSqlSupport().doSqlWork(new ImportTripScriptTopiaSqlWork(1000, showSql, request.getSqlContent(), blobsContainers));
}
diff --git a/services-topia/src/main/java/fr/ird/observe/services/topia/service/sql/SqlScriptProducerServiceTopia.java b/services-topia/src/main/java/fr/ird/observe/services/topia/service/sql/SqlScriptProducerServiceTopia.java
index 7f697e9..34cf494 100644
--- a/services-topia/src/main/java/fr/ird/observe/services/topia/service/sql/SqlScriptProducerServiceTopia.java
+++ b/services-topia/src/main/java/fr/ird/observe/services/topia/service/sql/SqlScriptProducerServiceTopia.java
@@ -124,11 +124,14 @@ public class SqlScriptProducerServiceTopia extends ObserveServiceTopia implement
protected SqlRequests sqlRequests(AddSqlScriptProducerRequest request, SqlRequests.Builder builder) {
+ if (serviceContext.getTopiaApplicationContext().getConfiguration().isShowSql()) {
+ builder.showSql();
+ }
+
if (request.isAddSchema()) {
SqlRequests.CreateSchemaRequestBuilder createSchemaRequestBuilder = builder
.createSchemaBuilder()
- .setAddSchema(true)
.setTemporaryPath(serviceContext.getTemporaryDirectoryRoot().toPath());
if (request.isH2()) {
createSchemaRequestBuilder.forH2();
@@ -220,6 +223,10 @@ public class SqlScriptProducerServiceTopia extends ObserveServiceTopia implement
protected SqlRequests sqlRequests(DeleteSqlScriptProducerRequest request, SqlRequests.Builder builder) {
+ if (serviceContext.getTopiaApplicationContext().getConfiguration().isShowSql()) {
+ builder.showSql();
+ }
+
ObserveTopiaApplicationContext topiaApplicationContext = serviceContext.getTopiaApplicationContext();
if (request.isDeleteData()) {
diff --git a/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/SqlRequests.java b/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/SqlRequests.java
index 7742998..5cdf30f 100644
--- a/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/SqlRequests.java
+++ b/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/SqlRequests.java
@@ -23,7 +23,6 @@ package org.nuiton.topia.service.sql.batch;
*/
import com.google.common.collect.ImmutableSet;
-import org.hibernate.dialect.Dialect;
import org.nuiton.topia.persistence.TopiaApplicationContext;
import org.nuiton.topia.persistence.metadata.TopiaMetadataModel;
import org.nuiton.topia.service.sql.batch.actions.AbstractSchemaRequest;
@@ -53,8 +52,11 @@ public class SqlRequests implements Iterable<AbstractSqlRequest> {
protected final ImmutableSet<AbstractSqlRequest> requests;
- protected SqlRequests(ImmutableSet<AbstractSqlRequest> requests) {
+ protected final boolean showSql;
+
+ protected SqlRequests(ImmutableSet<AbstractSqlRequest> requests, boolean showSql) {
this.requests = requests;
+ this.showSql = showSql;
}
public static Builder builder() {
@@ -75,8 +77,14 @@ public class SqlRequests implements Iterable<AbstractSqlRequest> {
return requests.iterator();
}
+ public boolean isShowSql() {
+ return showSql;
+ }
+
public interface Builder extends BuilderAddRequestStep {
+ Builder showSql();
+
Builder from(TopiaApplicationContext sourceTopiaApplicationContext);
Builder to(TopiaApplicationContext targetTopiaApplicationContext);
@@ -97,16 +105,6 @@ public class SqlRequests implements Iterable<AbstractSqlRequest> {
DeleteTablesRequestBuilder deleteTablesBuilder();
- BuilderAddRequestStep addCreateSchema(CreateSchemaRequest request);
-
- BuilderAddRequestStep addDropSchema(DropSchemaRequest request);
-
- BuilderAddRequestStep addReplicateTables(ReplicateTablesRequest request);
-
- BuilderAddRequestStep addUpdateTables(UpdateTablesRequest request);
-
- BuilderAddRequestStep addDeleteTables(DeleteTablesRequest request);
-
<R extends AbstractSqlRequest> BuilderAddRequestStep addRequest(R request);
Builder flush();
@@ -121,6 +119,13 @@ public class SqlRequests implements Iterable<AbstractSqlRequest> {
protected TopiaApplicationContext sourceTopiaApplicationContext;
protected TopiaApplicationContext targetTopiaApplicationContext;
protected Writer writer;
+ private boolean showSql;
+
+ @Override
+ public Builder showSql() {
+ showSql = true;
+ return this;
+ }
@Override
public Builder from(TopiaApplicationContext sourceTopiaApplicationContext) {
@@ -142,7 +147,7 @@ public class SqlRequests implements Iterable<AbstractSqlRequest> {
@Override
public SqlRequests build() {
- return new SqlRequests(requestsBuilder.build());
+ return new SqlRequests(requestsBuilder.build(), showSql);
}
@Override
@@ -181,31 +186,6 @@ public class SqlRequests implements Iterable<AbstractSqlRequest> {
}
@Override
- public BuilderAddRequestStep addCreateSchema(CreateSchemaRequest request) {
- return addRequest(request);
- }
-
- @Override
- public BuilderAddRequestStep addDropSchema(DropSchemaRequest request) {
- return addRequest(request);
- }
-
- @Override
- public BuilderAddRequestStep addReplicateTables(ReplicateTablesRequest request) {
- return addRequest(request);
- }
-
- @Override
- public BuilderAddRequestStep addUpdateTables(UpdateTablesRequest request) {
- return addRequest(request);
- }
-
- @Override
- public BuilderAddRequestStep addDeleteTables(DeleteTablesRequest request) {
- return addRequest(request);
- }
-
- @Override
public Builder flush() {
return this;
}
@@ -221,11 +201,7 @@ public class SqlRequests implements Iterable<AbstractSqlRequest> {
public CreateSchemaRequestBuilder(BuilderImpl builder, CreateSchemaRequest.Builder delegate) {
super(builder, delegate);
- }
-
- public CreateSchemaRequestBuilder setAddSchema(boolean addSchema) {
- delegate.setAddSchema(addSchema);
- return this;
+ delegate.setAddSchema(true);
}
}
@@ -234,11 +210,7 @@ public class SqlRequests implements Iterable<AbstractSqlRequest> {
public DropSchemaRequestBuilder(BuilderImpl builder, DropSchemaRequest.Builder delegate) {
super(builder, delegate);
- }
-
- public DropSchemaRequestBuilder setDropSchema(boolean dropSchema) {
- delegate.setDropSchema(dropSchema);
- return this;
+ delegate.setDropSchema(true);
}
}
@@ -303,31 +275,6 @@ public class SqlRequests implements Iterable<AbstractSqlRequest> {
}
@Override
- public BuilderAddRequestStep addCreateSchema(CreateSchemaRequest request) {
- return flush().addRequest(request);
- }
-
- @Override
- public BuilderAddRequestStep addDropSchema(DropSchemaRequest request) {
- return flush().addRequest(request);
- }
-
- @Override
- public BuilderAddRequestStep addReplicateTables(ReplicateTablesRequest request) {
- return flush().addRequest(request);
- }
-
- @Override
- public BuilderAddRequestStep addUpdateTables(UpdateTablesRequest request) {
- return flush().addRequest(request);
- }
-
- @Override
- public BuilderAddRequestStep addDeleteTables(DeleteTablesRequest request) {
- return addRequest(request);
- }
-
- @Override
public <RR extends AbstractSqlRequest> BuilderAddRequestStep addRequest(RR request) {
return builder.addRequest(request);
}
@@ -343,10 +290,6 @@ public class SqlRequests implements Iterable<AbstractSqlRequest> {
return builder;
}
-// protected BuilderAddRequestStep flushCurrentRequest() {
-// return addRequest(delegate.build());
-// }
-
protected B returnThis() {
return (B) this;
}
@@ -369,11 +312,6 @@ public class SqlRequests implements Iterable<AbstractSqlRequest> {
return returnThis();
}
- public B setDialect(Class<? extends Dialect> dialectType) {
- delegate.setDialect(dialectType);
- return returnThis();
- }
-
public B setTemporaryPath(Path temporaryPath) {
delegate.setTemporaryPath(temporaryPath);
return returnThis();
@@ -392,11 +330,6 @@ public class SqlRequests implements Iterable<AbstractSqlRequest> {
return returnThis();
}
- public B setFetchSize(int fetchSize) {
- delegate.setReadFetchSize(fetchSize);
- return returnThis();
- }
-
public B setSelectArgument(TopiaSqlTableSelectArgument arg) {
delegate.setSelectArgument(arg);
return returnThis();
@@ -404,5 +337,4 @@ public class SqlRequests implements Iterable<AbstractSqlRequest> {
}
-
}
diff --git a/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/TopiaSqlBatchServiceImpl.java b/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/TopiaSqlBatchServiceImpl.java
index 32af6fe..a69332f 100644
--- a/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/TopiaSqlBatchServiceImpl.java
+++ b/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/TopiaSqlBatchServiceImpl.java
@@ -158,7 +158,7 @@ public class TopiaSqlBatchServiceImpl implements TopiaSqlBatchService {
AbstractSqlRequest sqlRequest = sqlRequestIterator.next();
- AbstractSqlAction<?> action = createAction(sqlRequest);
+ AbstractSqlAction<?> action = createAction(sqlRequest, requests.isShowSql());
action.run();
@@ -207,7 +207,7 @@ public class TopiaSqlBatchServiceImpl implements TopiaSqlBatchService {
}
- protected <R extends AbstractSqlRequest, A extends AbstractSqlAction<R>> A createAction(R request) {
+ protected <R extends AbstractSqlRequest, A extends AbstractSqlAction<R>> A createAction(R request, boolean showSql) {
Objects.requireNonNull(request, "Request can't be null");
Class<A> actionType = ACTION_MAPPING.get(request.getClass());
@@ -215,12 +215,12 @@ public class TopiaSqlBatchServiceImpl implements TopiaSqlBatchService {
Constructor<A> constructor;
try {
- constructor = actionType.getConstructor(request.getClass());
+ constructor = actionType.getConstructor(request.getClass(), boolean.class);
} catch (NoSuchMethodException e) {
throw new TopiaException(e);
}
try {
- return constructor.newInstance(request);
+ return constructor.newInstance(request, showSql);
} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
throw new TopiaException(e);
}
diff --git a/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/AbstractSchemaAction.java b/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/AbstractSchemaAction.java
index 3364f08..9d3772e 100644
--- a/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/AbstractSchemaAction.java
+++ b/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/AbstractSchemaAction.java
@@ -36,8 +36,8 @@ import java.sql.SQLException;
*/
public abstract class AbstractSchemaAction<R extends AbstractSchemaRequest> extends AbstractSqlAction<R> {
- protected AbstractSchemaAction(R request) {
- super(request);
+ protected AbstractSchemaAction(R request, boolean showSql) {
+ super(request, showSql);
}
protected abstract String produceSql(Class<? extends Dialect> dialectType, Path temporaryDirectory) throws IOException;
diff --git a/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/AbstractSqlAction.java b/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/AbstractSqlAction.java
index 4bd8a0e..397687c 100644
--- a/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/AbstractSqlAction.java
+++ b/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/AbstractSqlAction.java
@@ -31,7 +31,6 @@ import org.nuiton.topia.persistence.TopiaPersistenceContext;
import org.nuiton.topia.persistence.internal.AbstractTopiaPersistenceContext;
import org.nuiton.topia.persistence.jdbc.JdbcConfiguration;
import org.nuiton.topia.persistence.jdbc.JdbcHelper;
-import org.nuiton.topia.persistence.support.TopiaSqlWork;
import org.nuiton.util.TimeLog;
import java.io.Closeable;
@@ -54,10 +53,9 @@ import java.util.Set;
public abstract class AbstractSqlAction<R extends AbstractSqlRequest> implements Runnable, Closeable {
protected static final TimeLog TIME_LOG = new TimeLog(AbstractSqlAction.class, 50L, 100L);
- /**
- * Logger.
- */
+ /** Logger. */
private static final Log log = LogFactory.getLog(AbstractSqlAction.class);
+
protected final R request;
protected final ImmutableSet<Closeable> closeables;
@@ -72,10 +70,13 @@ public abstract class AbstractSqlAction<R extends AbstractSqlRequest> implements
protected long endTime;
+ protected final boolean showSql;
+
private final Set<BlobsContainer.Builder> blobsContainerBuilders = new LinkedHashSet<>();
- protected AbstractSqlAction(R request) {
+ protected AbstractSqlAction(R request, boolean showSql) {
this.request = request;
+ this.showSql = showSql;
this.closeables = ImmutableSet.<Closeable>builder()
.add(() -> {
@@ -211,10 +212,6 @@ public abstract class AbstractSqlAction<R extends AbstractSqlRequest> implements
}
- protected void executeSqlWork(TopiaSqlWork sqlWork) {
- getSourcePersistenceContext().getSqlSupport().doSqlWork(sqlWork);
- }
-
protected AbstractTopiaPersistenceContext getSourcePersistenceContext() {
if (sourcePersistenceContext == null) {
sourcePersistenceContext = request.getSourceTopiaApplicationContext().newPersistenceContext();
diff --git a/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/AbstractSqlRequest.java b/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/AbstractSqlRequest.java
index 177d3d5..e0a7a02 100644
--- a/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/AbstractSqlRequest.java
+++ b/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/AbstractSqlRequest.java
@@ -23,8 +23,6 @@ package org.nuiton.topia.service.sql.batch.actions;
*/
import com.google.common.base.Preconditions;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.persistence.TopiaApplicationContext;
import java.io.Writer;
@@ -39,11 +37,6 @@ import java.io.Writer;
*/
public abstract class AbstractSqlRequest {
- /**
- * Logger.
- */
- private static final Log log = LogFactory.getLog(AbstractSqlRequest.class);
-
protected TopiaApplicationContext sourceTopiaApplicationContext;
protected TopiaApplicationContext targetTopiaApplicationContext;
diff --git a/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/AbstractTablesAction.java b/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/AbstractTablesAction.java
index a3ee8bc..ad74fe4 100644
--- a/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/AbstractTablesAction.java
+++ b/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/AbstractTablesAction.java
@@ -52,13 +52,11 @@ import java.util.stream.Collectors;
*/
public abstract class AbstractTablesAction<R extends AbstractTablesRequest> extends AbstractSqlAction<R> {
- /**
- * Logger.
- */
+ /** Logger. */
private static final Log log = LogFactory.getLog(AbstractTablesAction.class);
- protected AbstractTablesAction(R request) {
- super(request);
+ protected AbstractTablesAction(R request, boolean showSql) {
+ super(request, showSql);
}
protected abstract TopiaSqlTables getTables();
@@ -73,7 +71,7 @@ public abstract class AbstractTablesAction<R extends AbstractTablesRequest> exte
long startTable = TimeLog.getTime();
TopiaSqlWork sqlWork = new ReadSqlWork(request, table);
- executeSqlWork(sqlWork);
+ getSourcePersistenceContext().getSqlSupport().doSqlWork(sqlWork);
TIME_LOG.log(startTable, "Executed on table.", table.getFullyTableName());
@@ -143,6 +141,21 @@ public abstract class AbstractTablesAction<R extends AbstractTablesRequest> exte
}
+ private static class PreparedStatementWrapper implements AutoCloseable {
+ private final String sqlCode;
+ private final PreparedStatement preparedStatement;
+
+ private PreparedStatementWrapper(String sqlCode, PreparedStatement preparedStatement) {
+ this.sqlCode = sqlCode;
+ this.preparedStatement = preparedStatement;
+ }
+
+ @Override
+ public void close() throws SQLException {
+ preparedStatement.close();
+ }
+ }
+
protected class ReadSqlWork implements TopiaSqlWork {
private final R request;
@@ -156,17 +169,27 @@ public abstract class AbstractTablesAction<R extends AbstractTablesRequest> exte
@Override
public void execute(Connection connection) throws SQLException {
- try (PreparedStatement readStatement = createReadStatement(table, connection)) {
+ try (PreparedStatementWrapper readStatementWrapper = createReadStatement(table, connection)) {
+
+ PreparedStatement readStatement = readStatementWrapper.preparedStatement;
+
+ long t0 = TimeLog.getTime();
readStatement.execute();
+ TIME_LOG.log(t0, "Read statement", readStatementWrapper.sqlCode);
+ t0 = TimeLog.getTime();
+
executeOnTable(request, table, readStatement);
+ TIME_LOG.log(t0, "Execute on table", readStatementWrapper.sqlCode);
+
}
}
- protected PreparedStatement createReadStatement(TopiaSqlTable table, Connection connection) throws SQLException {
+
+ protected PreparedStatementWrapper createReadStatement(TopiaSqlTable table, Connection connection) throws SQLException {
StringBuilder sqlBuilder = new StringBuilder("SELECT " + table.getTableName() + ".*");
@@ -186,14 +209,20 @@ public abstract class AbstractTablesAction<R extends AbstractTablesRequest> exte
}
PreparedStatement statement = connection.prepareStatement(sql);
+ String sqlCode = sql;
if (filter) {
int index = 1;
for (String id : selectArgument.getIds()) {
statement.setString(index++, id);
}
+ sqlCode = sql + " -> " + selectArgument.getIds();
+ }
+ if (showSql) {
+ log.info(sqlCode);
+
}
statement.setFetchSize(request.getReadFetchSize());
- return statement;
+ return new PreparedStatementWrapper(sqlCode, statement);
}
diff --git a/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/CreateSchemaAction.java b/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/CreateSchemaAction.java
index d2cb2fc..5f87059 100644
--- a/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/CreateSchemaAction.java
+++ b/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/CreateSchemaAction.java
@@ -23,6 +23,8 @@ package org.nuiton.topia.service.sql.batch.actions;
*/
import com.google.common.collect.ImmutableSet;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.hibernate.HibernateException;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
@@ -44,10 +46,13 @@ import java.util.Properties;
*/
public class CreateSchemaAction extends AbstractSchemaAction<CreateSchemaRequest> {
+ /** Logger */
+ private static final Log log = LogFactory.getLog(CreateSchemaAction.class);
+
public static final String CREATE_SCHEMA_STATEMENT = "CREATE SCHEMA %s;\n";
- public CreateSchemaAction(CreateSchemaRequest request) {
- super(request);
+ public CreateSchemaAction(CreateSchemaRequest request, boolean showSql) {
+ super(request, showSql);
}
protected String produceSql(Class<? extends Dialect> dialectType, Path temporaryDirectory) throws IOException {
@@ -78,6 +83,11 @@ public class CreateSchemaAction extends AbstractSchemaAction<CreateSchemaRequest
}
sqlStatements += new String(Files.readAllBytes(sqlScriptFile));
+ if (showSql) {
+ if (log.isInfoEnabled()) {
+ log.info(sqlStatements);
+ }
+ }
Files.delete(sqlScriptFile);
return sqlStatements;
diff --git a/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/DeleteTablesAction.java b/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/DeleteTablesAction.java
index 7859c13..f668fa7 100644
--- a/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/DeleteTablesAction.java
+++ b/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/DeleteTablesAction.java
@@ -52,8 +52,8 @@ public class DeleteTablesAction extends AbstractTablesAction<DeleteTablesRequest
*/
private static final Log log = LogFactory.getLog(DeleteTablesAction.class);
- public DeleteTablesAction(DeleteTablesRequest request) {
- super(request);
+ public DeleteTablesAction(DeleteTablesRequest request, boolean showSql) {
+ super(request, showSql);
}
@Override
@@ -113,7 +113,11 @@ public class DeleteTablesAction extends AbstractTablesAction<DeleteTablesRequest
String sql = String.format(deleteStatementSql, topiaId);
writer.append(sql);
-
+ if (showSql) {
+ if (log.isInfoEnabled()) {
+ log.info(sql);
+ }
+ }
} catch (IOException e) {
throw new TopiaException("Could not deleteRow", e);
}
diff --git a/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/DropSchemaAction.java b/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/DropSchemaAction.java
index c50fda4..8153c6e 100644
--- a/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/DropSchemaAction.java
+++ b/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/DropSchemaAction.java
@@ -24,6 +24,8 @@ package org.nuiton.topia.service.sql.batch.actions;
import com.google.common.collect.ImmutableSet;
import org.apache.commons.io.output.WriterOutputStream;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.hibernate.HibernateException;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
@@ -44,10 +46,13 @@ import java.util.Properties;
*/
public class DropSchemaAction extends AbstractSchemaAction<DropSchemaRequest> {
+ /** Logger */
+ private static final Log log = LogFactory.getLog(DropSchemaAction.class);
+
public static final String DROP_SCHEMA_STATEMENT = "\nDROP SCHEMA %s;";
- public DropSchemaAction(DropSchemaRequest request) {
- super(request);
+ public DropSchemaAction(DropSchemaRequest request, boolean showSql) {
+ super(request, showSql);
}
@Override
@@ -82,7 +87,11 @@ public class DropSchemaAction extends AbstractSchemaAction<DropSchemaRequest> {
sqlContent += String.format(DROP_SCHEMA_STATEMENT, schemaName);
}
}
-
+ if (showSql) {
+ if (log.isInfoEnabled()) {
+ log.info(sqlContent);
+ }
+ }
return sqlContent;
} catch (HibernateException eee) {
diff --git a/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/ReplicateTablesAction.java b/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/ReplicateTablesAction.java
index d7b2096..5a2954f 100644
--- a/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/ReplicateTablesAction.java
+++ b/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/ReplicateTablesAction.java
@@ -62,8 +62,8 @@ public class ReplicateTablesAction extends AbstractTablesAction<ReplicateTablesR
*/
private static final Log log = LogFactory.getLog(ReplicateTablesAction.class);
- public ReplicateTablesAction(ReplicateTablesRequest request) {
- super(request);
+ public ReplicateTablesAction(ReplicateTablesRequest request, boolean showSql) {
+ super(request, showSql);
}
@Override
@@ -203,7 +203,7 @@ public class ReplicateTablesAction extends AbstractTablesAction<ReplicateTablesR
if (columnValue == null) {
continue;
}
-
+
InputStream stream;
int size;
if (columnValue instanceof Long) {
diff --git a/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/UpdateTablesAction.java b/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/UpdateTablesAction.java
index 1b5202e..4eea197 100644
--- a/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/UpdateTablesAction.java
+++ b/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/actions/UpdateTablesAction.java
@@ -53,8 +53,8 @@ public class UpdateTablesAction extends AbstractTablesAction<UpdateTablesRequest
*/
private static final Log log = LogFactory.getLog(UpdateTablesAction.class);
- public UpdateTablesAction(UpdateTablesRequest request) {
- super(request);
+ public UpdateTablesAction(UpdateTablesRequest request, boolean showSql) {
+ super(request, showSql);
}
protected TopiaSqlTables getTables() {
@@ -121,7 +121,11 @@ public class UpdateTablesAction extends AbstractTablesAction<UpdateTablesRequest
String arguments = generateArguments(columnNames, readResultSet);
String sql = String.format(updateStatementSql, arguments, topiaId);
writer.append(sql);
-
+ if (showSql) {
+ if (log.isInfoEnabled()) {
+ log.info(sql + " -> " + arguments);
+ }
+ }
} catch (IOException e) {
throw new RuntimeException("Could not updateRow", e);
}
diff --git a/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/tables/TopiaSqlTablesFactory.java b/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/tables/TopiaSqlTablesFactory.java
index 8202553..a1d30d2 100644
--- a/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/tables/TopiaSqlTablesFactory.java
+++ b/topia-extension/src/main/java/org/nuiton/topia/service/sql/batch/tables/TopiaSqlTablesFactory.java
@@ -43,9 +43,7 @@ import java.util.Set;
*/
public class TopiaSqlTablesFactory {
- /**
- * Logger.
- */
+ /** Logger. */
private static final Log log = LogFactory.getLog(TopiaSqlTablesFactory.class);
protected final TopiaMetadataModel model;
@@ -114,7 +112,7 @@ public class TopiaSqlTablesFactory {
boolean added = dones.add(metadataEntity);
if (added) {
- log.info("E → " + metadataEntity.getType());
+ log.debug("E → " + metadataEntity.getType());
TopiaEntityEnum entityEnum = entityEnumProvider.getEntityEnum(metadataEntity.getType());
builder = (builder == null ? TopiaSqlTables.builder(metadataModel, metadataEntity) : builder).addMainTable(entityEnum);
@@ -127,7 +125,7 @@ public class TopiaSqlTablesFactory {
public void visitEntiyEnd(TopiaMetadataModel metadataModel, TopiaMetadataEntity metadataEntity) {
if (dones.contains(metadataEntity)) {
- log.info("E ← " + metadataEntity.getType());
+ log.debug("E ← " + metadataEntity.getType());
}
}
@@ -139,7 +137,7 @@ public class TopiaSqlTablesFactory {
TopiaEntityEnum entityEnum = entityEnumProvider.getEntityEnum(propertyType.getType());
boolean withShell = propertyType.withShell();
- log.info(metadataEntity.getType() + "/" + propertyName + "→" + propertyType.getType() + " (withShell: " + withShell + ")");
+ log.debug(metadataEntity.getType() + "/" + propertyName + "→" + propertyType.getType() + " (withShell: " + withShell + ")");
if (withShell) {
builder = builder.addAndEnterReverseJoinTable(entityEnum);
@@ -157,7 +155,7 @@ public class TopiaSqlTablesFactory {
TopiaEntityEnum entityEnum = entityEnumProvider.getEntityEnum(propertyType.getType());
boolean withShell = propertyType.withShell();
- log.info(metadataEntity.getType() + "/" + propertyName + "→" + propertyType.getType() + " (withShell: " + withShell + ")");
+ log.debug(metadataEntity.getType() + "/" + propertyName + "→" + propertyType.getType() + " (withShell: " + withShell + ")");
if (withShell) {
builder = builder.addAndEnterJoinTable(entityEnum);
--
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm(a)codelutin.com>.
1
0
This is an automated email from the git hooks/post-receive script.
New commit to branch develop in repository observe.
See https://gitlab.nuiton.org/codelutin/observe.git
commit 82b701f6b21e574cec0c06bd9e015985b6c7429a
Author: Tony CHEMIT <chemit(a)codelutin.com>
Date: Fri Nov 25 10:33:34 2016 +0100
Suppression d'une api obsolète
---
.../topia/entity/BasketEntitiesExtractor.java | 59 ----
.../topia/entity/BranchlineEntitiesExtractor.java | 66 -----
.../services/topia/entity/EntitiesExtractor.java | 76 -----
.../services/topia/entity/EntitiesSetFactory.java | 310 ---------------------
.../topia/entity/SectionEntitiesExtractor.java | 47 ----
.../topia/entity/SpeciesListEntitiesExtractor.java | 59 ----
.../entity/SpeciesListOceanEntitiesExtractor.java | 58 ----
.../data}/TripMapDtoFactory.java | 24 +-
.../data/longline/TripLonglineServiceTopia.java | 4 +-
.../service/data/seine/TripSeineServiceTopia.java | 4 +-
10 files changed, 15 insertions(+), 692 deletions(-)
diff --git a/services-topia/src/main/java/fr/ird/observe/services/topia/entity/BasketEntitiesExtractor.java b/services-topia/src/main/java/fr/ird/observe/services/topia/entity/BasketEntitiesExtractor.java
deleted file mode 100644
index 0823988..0000000
--- a/services-topia/src/main/java/fr/ird/observe/services/topia/entity/BasketEntitiesExtractor.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package fr.ird.observe.services.topia.entity;
-
-/*-
- * #%L
- * ObServe :: Services ToPIA Implementation
- * %%
- * Copyright (C) 2008 - 2016 IRD, Code Lutin, Tony Chemit
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import com.google.common.collect.Sets;
-import fr.ird.observe.ObserveTopiaPersistenceContext;
-import fr.ird.observe.entities.longline.Basket;
-import fr.ird.observe.entities.longline.Section;
-import fr.ird.observe.entities.longline.SetLongline;
-
-import java.util.Collection;
-import java.util.LinkedHashSet;
-import java.util.Map;
-
-/**
- * @author Sylvain Bavencoff - bavencoff(a)codelutin.com
- */
-public class BasketEntitiesExtractor extends EntitiesExtractor<Basket> {
-
- protected BasketEntitiesExtractor() {
- super(Basket.class, null);
- }
-
- @Override
- protected Collection<Basket> getEntitiesSetBase(ObserveTopiaPersistenceContext persistenceContext, Map<String, Object> requestContext) {
-
- SetLongline setLongline = (SetLongline) requestContext.get(Section.PROPERTY_SET_LONGLINE);
-
- LinkedHashSet<Basket> baskets = Sets.newLinkedHashSet();
-
- for (Section section : setLongline.getSection()) {
-
- baskets.addAll(section.getBasket());
-
- }
-
- return baskets;
- }
-}
diff --git a/services-topia/src/main/java/fr/ird/observe/services/topia/entity/BranchlineEntitiesExtractor.java b/services-topia/src/main/java/fr/ird/observe/services/topia/entity/BranchlineEntitiesExtractor.java
deleted file mode 100644
index 966a5e6..0000000
--- a/services-topia/src/main/java/fr/ird/observe/services/topia/entity/BranchlineEntitiesExtractor.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package fr.ird.observe.services.topia.entity;
-
-/*-
- * #%L
- * ObServe :: Services ToPIA Implementation
- * %%
- * Copyright (C) 2008 - 2016 IRD, Code Lutin, Tony Chemit
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import com.google.common.collect.Sets;
-import fr.ird.observe.ObserveTopiaPersistenceContext;
-import fr.ird.observe.entities.longline.Basket;
-import fr.ird.observe.entities.longline.Branchline;
-import fr.ird.observe.entities.longline.Section;
-import fr.ird.observe.entities.longline.SetLongline;
-
-import java.util.Collection;
-import java.util.LinkedHashSet;
-import java.util.Map;
-
-/**
- * @author Sylvain Bavencoff - bavencoff(a)codelutin.com
- */
-public class BranchlineEntitiesExtractor extends EntitiesExtractor<Branchline> {
-
- protected BranchlineEntitiesExtractor() {
- super(Branchline.class, null);
- }
-
- @Override
- protected Collection<Branchline> getEntitiesSetBase(ObserveTopiaPersistenceContext persistenceContext, Map<String, Object> requestContext) {
-
- SetLongline setLongline = (SetLongline) requestContext.get(Section.PROPERTY_SET_LONGLINE);
-
- LinkedHashSet<Branchline> branchlines = Sets.newLinkedHashSet();
-
- for (Section section : setLongline.getSection()) {
-
- for (Basket basket : section.getBasket()) {
-
- branchlines.addAll(basket.getBranchline());
-
- }
-
- }
-
- return branchlines;
- }
-
-
-}
diff --git a/services-topia/src/main/java/fr/ird/observe/services/topia/entity/EntitiesExtractor.java b/services-topia/src/main/java/fr/ird/observe/services/topia/entity/EntitiesExtractor.java
deleted file mode 100644
index b403b56..0000000
--- a/services-topia/src/main/java/fr/ird/observe/services/topia/entity/EntitiesExtractor.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package fr.ird.observe.services.topia.entity;
-
-/*-
- * #%L
- * ObServe :: Services ToPIA Implementation
- * %%
- * Copyright (C) 2008 - 2016 IRD, Code Lutin, Tony Chemit
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import fr.ird.observe.ObserveTopiaPersistenceContext;
-import fr.ird.observe.entities.ObserveEntity;
-import org.nuiton.topia.persistence.TopiaDao;
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.function.Predicate;
-import java.util.stream.Collectors;
-
-/**
- * Cette classe permet d'extraire dynamiquement un ensemble d'entitiées de la base de données.
- * cet emsenble est definit par un ensemble extrait de la base, definit dans getEntitiesSetBase
- * Sur cet ensemble on applique le filtre definit l'attribut optionalFilter
- *
- * @author Sylvain Bavencoff - bavencoff(a)codelutin.com
- */
-public class EntitiesExtractor<E extends ObserveEntity> {
-
- /**
- * Le type de l'entité dont on cherche des éléments.
- */
- protected final Class<E> entityType;
-
- /**
- * Un prédicat de filtrage optionnel.
- */
- protected final Predicate<E> optionalFilter;
-
- protected EntitiesExtractor(Class<E> entityType, Predicate<E> optionalFilter) {
- this.entityType = entityType;
- this.optionalFilter = optionalFilter;
- }
-
- public Iterable<E> getEntities(ObserveTopiaPersistenceContext persistenceContext, Map<String, Object> requestContext) {
- Collection<E> result = getEntitiesSetBase(persistenceContext, requestContext);
- Predicate<E> filter = getFilter(requestContext);
- if (filter != null) {
- result = result.stream().filter(filter).collect(Collectors.toSet());
- }
- return result;
- }
-
- protected Collection<E> getEntitiesSetBase(ObserveTopiaPersistenceContext persistenceContext, Map<String, Object> requestContext) {
- TopiaDao<E> dao = persistenceContext.getDao(entityType);
- return dao.findAll();
- }
-
- protected Predicate<E> getFilter(Map<String, Object> requestContext) {
- return optionalFilter == null ? null : optionalFilter;
- }
-
-}
diff --git a/services-topia/src/main/java/fr/ird/observe/services/topia/entity/EntitiesSetFactory.java b/services-topia/src/main/java/fr/ird/observe/services/topia/entity/EntitiesSetFactory.java
deleted file mode 100644
index fcac8f2..0000000
--- a/services-topia/src/main/java/fr/ird/observe/services/topia/entity/EntitiesSetFactory.java
+++ /dev/null
@@ -1,310 +0,0 @@
-package fr.ird.observe.services.topia.entity;
-
-/*-
- * #%L
- * ObServe :: Services ToPIA Implementation
- * %%
- * Copyright (C) 2008 - 2016 IRD, Code Lutin, Tony Chemit
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import com.google.common.collect.ImmutableMap;
-import fr.ird.observe.entities.Entities;
-import fr.ird.observe.entities.ObserveEntity;
-import fr.ird.observe.entities.longline.Basket;
-import fr.ird.observe.entities.longline.Branchline;
-import fr.ird.observe.entities.longline.CatchLongline;
-import fr.ird.observe.entities.longline.Encounter;
-import fr.ird.observe.entities.longline.Section;
-import fr.ird.observe.entities.longline.Tdr;
-import fr.ird.observe.entities.longline.TripLongline;
-import fr.ird.observe.entities.referentiel.ObserveReferentialEntities;
-import fr.ird.observe.entities.referentiel.ObserveReferentialEntity;
-import fr.ird.observe.entities.referentiel.Person;
-import fr.ird.observe.entities.referentiel.Persons;
-import fr.ird.observe.entities.referentiel.Species;
-import fr.ird.observe.entities.referentiel.Vessel;
-import fr.ird.observe.entities.referentiel.Vessels;
-import fr.ird.observe.entities.seine.NonTargetCatch;
-import fr.ird.observe.entities.seine.ObjectObservedSpecies;
-import fr.ird.observe.entities.seine.ObjectSchoolEstimate;
-import fr.ird.observe.entities.seine.SchoolEstimate;
-import fr.ird.observe.entities.seine.TargetCatch;
-import fr.ird.observe.entities.seine.TargetCatchImpl;
-import fr.ird.observe.entities.seine.TripSeine;
-import fr.ird.observe.services.dto.ObserveSpeciesListConfiguration;
-
-import java.util.Objects;
-import java.util.function.Predicate;
-
-/**
- * Une usine de {@link EntitiesExtractor}.
- *
- * Created on 18/10/15.
- *
- * @author Tony Chemit - chemit(a)codelutin.com
- */
-public class EntitiesSetFactory {
-
- protected final ImmutableMap<String, EntitiesExtractor> cache;
-
- public EntitiesSetFactory(ObserveSpeciesListConfiguration speciesListConfiguration) {
-
- ImmutableMap.Builder<String, EntitiesExtractor> builder = ImmutableMap.builder();
-
- // TripSeine
- registerReferentialEntitiesExtractor(builder,
- TripSeine.class,
- TripSeine.PROPERTY_CAPTAIN,
- Person.class,
- Persons.CAPTAIN_PREDICATE);
- registerReferentialEntitiesExtractor(builder,
- TripSeine.class,
- TripSeine.PROPERTY_OBSERVER,
- Person.class,
- Persons.OBSERVER_PREDICATE);
- registerReferentialEntitiesExtractor(builder,
- TripSeine.class,
- TripSeine.PROPERTY_DATA_ENTRY_OPERATOR,
- Person.class,
- Persons.DATA_ENTRY_OPERATOR_PREDICATE);
- registerReferentialEntitiesExtractor(builder,
- TripSeine.class,
- TripSeine.PROPERTY_VESSEL,
- Vessel.class,
- Vessels.newVesselSeinePredicate());
-
- // TripLongLine
- registerReferentialEntitiesExtractor(builder,
- TripLongline.class,
- TripLongline.PROPERTY_CAPTAIN,
- Person.class,
- Persons.CAPTAIN_PREDICATE);
- registerReferentialEntitiesExtractor(builder,
- TripLongline.class,
- TripLongline.PROPERTY_OBSERVER,
- Person.class,
- Persons.OBSERVER_PREDICATE);
- registerReferentialEntitiesExtractor(builder,
- TripLongline.class,
- TripLongline.PROPERTY_DATA_ENTRY_OPERATOR,
- Person.class,
- Persons.DATA_ENTRY_OPERATOR_PREDICATE);
- registerReferentialEntitiesExtractor(builder,
- TripLongline.class,
- TripLongline.PROPERTY_VESSEL,
- Vessel.class,
- Vessels.newVesselLonglinePredicate());
-
- // ObjectSchoolEstimate
- registerSpeciesListEntitiesExtractor(builder,
- ObjectSchoolEstimate.class,
- ObjectSchoolEstimate.PROPERTY_SPECIES,
- speciesListConfiguration.getSpeciesListSeineObjectSchoolEstimateId());
-
- // ObjectObservedSpecies
- registerSpeciesListEntitiesExtractor(builder,
- ObjectObservedSpecies.class,
- ObjectObservedSpecies.PROPERTY_SPECIES,
- speciesListConfiguration.getSpeciesListSeineObjectObservedSpeciesId());
-
- // SchoolEstimate
- registerSpeciesListEntitiesExtractor(builder,
- SchoolEstimate.class,
- SchoolEstimate.PROPERTY_SPECIES,
- speciesListConfiguration.getSpeciesListSeineSchoolEstimateId());
-
- // TargetCatch
- registerSpeciesListOceanEntitiesExtractor(builder,
- TargetCatch.class,
- TargetCatchImpl.PROPERTY_SPECIES,
- speciesListConfiguration.getSpeciesListSeineTargetCatchId());
-
- // NonTargetCatch
- registerSpeciesListEntitiesExtractor(builder,
- NonTargetCatch.class,
- NonTargetCatch.PROPERTY_SPECIES,
- speciesListConfiguration.getSpeciesListSeineNonTargetCatchId());
-
- // Encounter
- registerSpeciesListEntitiesExtractor(builder,
- Encounter.class,
- Encounter.PROPERTY_SPECIES,
- speciesListConfiguration.getSpeciesListLonglineEncounterId());
-
- // CatchLongline
- registerSpeciesListEntitiesExtractor(builder,
- CatchLongline.class,
- CatchLongline.PROPERTY_SPECIES_CATCH,
- speciesListConfiguration.getSpeciesListLonglineCatchId());
-
- registerSpeciesListEntitiesExtractor(builder,
- CatchLongline.class,
- CatchLongline.PROPERTY_PREDATOR,
- speciesListConfiguration.getSpeciesListLonglineDepredatorId());
-
- registerSectionEntitiesExtractor(builder,
- CatchLongline.class,
- CatchLongline.PROPERTY_SECTION);
-
- registerBasketEntitiesExtractor(builder,
- CatchLongline.class,
- CatchLongline.PROPERTY_BASKET);
-
- registerBranchlineEntitiesExtractor(builder,
- CatchLongline.class,
- CatchLongline.PROPERTY_BRANCHLINE);
-
- // CatchLongline
- registerSpeciesListEntitiesExtractor(builder,
- Tdr.class,
- Tdr.PROPERTY_SPECIES,
- speciesListConfiguration.getSpeciesListLonglineCatchId());
-
- registerSectionEntitiesExtractor(builder,
- Tdr.class,
- Tdr.PROPERTY_SECTION);
-
- registerBasketEntitiesExtractor(builder,
- Tdr.class,
- Tdr.PROPERTY_BASKET);
-
- registerBranchlineEntitiesExtractor(builder,
- Tdr.class,
- Tdr.PROPERTY_BRANCHLINE);
-
-
- this.cache = builder.build();
-
- }
-
- public <P extends ObserveEntity, C extends ObserveEntity> EntitiesExtractor<C> newEntitiesSet(Class<P> parentType,
- Class<C> propertyType,
- String propertyName) {
-
- Objects.requireNonNull(parentType, "Parent type is required");
- Objects.requireNonNull(propertyName, "Property name is required");
- Objects.requireNonNull(propertyType, "Property type is required");
-
- String key = buildKey(parentType, propertyName);
- EntitiesExtractor<C> entitiesExtractor = cache.get(key);
-
- if (entitiesExtractor == null) {
-
- // Pas de filtre spécifique trouvé, on en construit un générique
-
- if (Entities.isReferentielClass(propertyType)) {
-
- // On veut tous les référentiels sauf ceux qui sont désactivés
- entitiesExtractor = new EntitiesExtractor<>(propertyType, (Predicate) ObserveReferentialEntities.IS_ACTIF_PREDICATE);
-
- } else {
-
- // On veut toutes les entités
- entitiesExtractor = new EntitiesExtractor<>(propertyType, null);
-
- }
-
- }
-
- return entitiesExtractor;
-
- }
-
- protected <P extends ObserveEntity> String buildKey(Class<P> parentType, String propertyName) {
- return parentType.getName() + "#" + propertyName;
- }
-
- protected <P extends ObserveEntity, C extends ObserveReferentialEntity> void registerReferentialEntitiesExtractor(
- ImmutableMap.Builder<String, EntitiesExtractor> builder,
- Class<P> parentType,
- String propertyName,
- Class<C> propertyType,
- Predicate<C> filter) {
-
- Predicate<C> predicate = (Predicate) ObserveReferentialEntities.IS_ACTIF_PREDICATE;
- Predicate<C> newFilter = f -> filter.test(f) && predicate.test(f);
-
- EntitiesExtractor<C> entitiesExtractor = new EntitiesExtractor<>(propertyType, newFilter);
- registerEntitiesExtractor(builder, parentType, propertyName, entitiesExtractor);
-
- }
-
- protected <P extends ObserveEntity> void registerSpeciesListEntitiesExtractor(
- ImmutableMap.Builder<String, EntitiesExtractor> builder,
- Class<P> parentType,
- String propertyName,
- String speciesListId) {
-
- EntitiesExtractor<Species> entitiesExtractor = new SpeciesListEntitiesExtractor(speciesListId);
- registerEntitiesExtractor(builder, parentType, propertyName, entitiesExtractor);
-
- }
-
- protected <P extends ObserveEntity> void registerSpeciesListOceanEntitiesExtractor(
- ImmutableMap.Builder<String, EntitiesExtractor> builder,
- Class<P> parentType,
- String propertyName,
- String speciesListId) {
-
- EntitiesExtractor<Species> entitiesExtractor = new SpeciesListOceanEntitiesExtractor(speciesListId);
- registerEntitiesExtractor(builder, parentType, propertyName, entitiesExtractor);
-
- }
-
- protected <P extends ObserveEntity> void registerSectionEntitiesExtractor(
- ImmutableMap.Builder<String, EntitiesExtractor> builder,
- Class<P> parentType,
- String propertyName) {
-
- EntitiesExtractor<Section> entitiesExtractor = new SectionEntitiesExtractor();
- registerEntitiesExtractor(builder, parentType, propertyName, entitiesExtractor);
-
- }
-
- protected <P extends ObserveEntity> void registerBasketEntitiesExtractor(
- ImmutableMap.Builder<String, EntitiesExtractor> builder,
- Class<P> parentType,
- String propertyName) {
-
- EntitiesExtractor<Basket> entitiesExtractor = new BasketEntitiesExtractor();
- registerEntitiesExtractor(builder, parentType, propertyName, entitiesExtractor);
-
- }
-
- protected <P extends ObserveEntity> void registerBranchlineEntitiesExtractor(
- ImmutableMap.Builder<String, EntitiesExtractor> builder,
- Class<P> parentType,
- String propertyName) {
-
- EntitiesExtractor<Branchline> entitiesExtractor = new BranchlineEntitiesExtractor();
- registerEntitiesExtractor(builder, parentType, propertyName, entitiesExtractor);
-
- }
-
- protected <P extends ObserveEntity, C extends ObserveEntity> void registerEntitiesExtractor(
- ImmutableMap.Builder<String, EntitiesExtractor> builder,
- Class<P> parentType,
- String propertyName,
- EntitiesExtractor<C> entitiesExtractor) {
-
- String key = buildKey(parentType, propertyName);
- builder.put(key, entitiesExtractor);
-
- }
-
-}
diff --git a/services-topia/src/main/java/fr/ird/observe/services/topia/entity/SectionEntitiesExtractor.java b/services-topia/src/main/java/fr/ird/observe/services/topia/entity/SectionEntitiesExtractor.java
deleted file mode 100644
index 1c5db10..0000000
--- a/services-topia/src/main/java/fr/ird/observe/services/topia/entity/SectionEntitiesExtractor.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package fr.ird.observe.services.topia.entity;
-
-/*-
- * #%L
- * ObServe :: Services ToPIA Implementation
- * %%
- * Copyright (C) 2008 - 2016 IRD, Code Lutin, Tony Chemit
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import fr.ird.observe.ObserveTopiaPersistenceContext;
-import fr.ird.observe.entities.longline.Section;
-import fr.ird.observe.entities.longline.SetLongline;
-
-import java.util.Collection;
-import java.util.Map;
-
-/**
- * @author Sylvain Bavencoff - bavencoff(a)codelutin.com
- */
-public class SectionEntitiesExtractor extends EntitiesExtractor<Section> {
-
- protected SectionEntitiesExtractor() {
- super(Section.class, null);
- }
-
- @Override
- protected Collection<Section> getEntitiesSetBase(ObserveTopiaPersistenceContext persistenceContext, Map<String, Object> requestContext) {
- SetLongline setLongline = (SetLongline) requestContext.get(Section.PROPERTY_SET_LONGLINE);
-
- return setLongline.getSection();
- }
-}
diff --git a/services-topia/src/main/java/fr/ird/observe/services/topia/entity/SpeciesListEntitiesExtractor.java b/services-topia/src/main/java/fr/ird/observe/services/topia/entity/SpeciesListEntitiesExtractor.java
deleted file mode 100644
index 1ddef0b..0000000
--- a/services-topia/src/main/java/fr/ird/observe/services/topia/entity/SpeciesListEntitiesExtractor.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package fr.ird.observe.services.topia.entity;
-
-/*-
- * #%L
- * ObServe :: Services ToPIA Implementation
- * %%
- * Copyright (C) 2008 - 2016 IRD, Code Lutin, Tony Chemit
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import fr.ird.observe.ObserveTopiaPersistenceContext;
-import fr.ird.observe.entities.referentiel.ObserveReferentialEntities;
-import fr.ird.observe.entities.referentiel.Species;
-import fr.ird.observe.entities.referentiel.SpeciesList;
-import fr.ird.observe.entities.referentiel.SpeciesListTopiaDao;
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.function.Predicate;
-
-/**
- * Extraction des list d'espèces definit dans le référentiel "liste d'èspéce"
- *
- * @author Sylvain Bavencoff - bavencoff(a)codelutin.com
- */
-public class SpeciesListEntitiesExtractor extends EntitiesExtractor<Species> {
-
- /**
- * L'id de la liste d'espèces à utiliser.
- */
- protected final String speciesListId;
-
- public SpeciesListEntitiesExtractor(String speciesListId) {
- super(Species.class, (Predicate) ObserveReferentialEntities.IS_ACTIF_PREDICATE);
- this.speciesListId = speciesListId;
- }
-
- @Override
- protected Collection<Species> getEntitiesSetBase(ObserveTopiaPersistenceContext persistenceContext, Map<String, Object> requestContext) {
- SpeciesListTopiaDao speciesListDao = persistenceContext.getSpeciesListDao();
- SpeciesList speciesList = speciesListDao.forTopiaIdEquals(speciesListId).findUnique();
- return speciesList.getSpecies();
- }
-
-}
diff --git a/services-topia/src/main/java/fr/ird/observe/services/topia/entity/SpeciesListOceanEntitiesExtractor.java b/services-topia/src/main/java/fr/ird/observe/services/topia/entity/SpeciesListOceanEntitiesExtractor.java
deleted file mode 100644
index 23a8a29..0000000
--- a/services-topia/src/main/java/fr/ird/observe/services/topia/entity/SpeciesListOceanEntitiesExtractor.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package fr.ird.observe.services.topia.entity;
-
-/*-
- * #%L
- * ObServe :: Services ToPIA Implementation
- * %%
- * Copyright (C) 2008 - 2016 IRD, Code Lutin, Tony Chemit
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import fr.ird.observe.entities.referentiel.Ocean;
-import fr.ird.observe.entities.referentiel.Species;
-import fr.ird.observe.entities.referentiel.Species2;
-
-import java.util.Map;
-import java.util.function.Predicate;
-
-/**
- * Extraction des list d'espèces definit dans le référentiel "liste d'èspéce" et présent dans un océan
- *
- * @author Sylvain Bavencoff - bavencoff(a)codelutin.com
- */
-public class SpeciesListOceanEntitiesExtractor extends SpeciesListEntitiesExtractor {
-
- public SpeciesListOceanEntitiesExtractor(String speciesListId) {
- super(speciesListId);
- }
-
- @Override
- protected Predicate<Species> getFilter(Map<String, Object> requestContext) {
-
- Predicate<Species> filter = super.getFilter(requestContext);
-
- Ocean ocean = (Ocean) requestContext.get(Species.PROPERTY_OCEAN);
-
- if (ocean != null) {
-
- filter = filter.and(Species2.newSpeciesByOceanPredicate(ocean));
-
- }
-
- return filter;
- }
-}
diff --git a/services-topia/src/main/java/fr/ird/observe/services/topia/entity/TripMapDtoFactory.java b/services-topia/src/main/java/fr/ird/observe/services/topia/service/data/TripMapDtoFactory.java
similarity index 75%
rename from services-topia/src/main/java/fr/ird/observe/services/topia/entity/TripMapDtoFactory.java
rename to services-topia/src/main/java/fr/ird/observe/services/topia/service/data/TripMapDtoFactory.java
index 4d9c7bb..ba2cde5 100644
--- a/services-topia/src/main/java/fr/ird/observe/services/topia/entity/TripMapDtoFactory.java
+++ b/services-topia/src/main/java/fr/ird/observe/services/topia/service/data/TripMapDtoFactory.java
@@ -1,4 +1,4 @@
-package fr.ird.observe.services.topia.entity;
+package fr.ird.observe.services.topia.service.data;
/*-
* #%L
@@ -22,8 +22,6 @@ package fr.ird.observe.services.topia.entity;
* #L%
*/
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Sets;
import fr.ird.observe.entities.TripMapPoint;
import fr.ird.observe.services.dto.TripMapDto;
import fr.ird.observe.services.dto.TripMapPointDto;
@@ -31,7 +29,7 @@ import fr.ird.observe.services.dto.constants.TripMapPointType;
import java.util.LinkedHashSet;
import java.util.Set;
-import java.util.function.Function;
+import java.util.stream.Collectors;
/**
* Created on 09/01/16.
@@ -40,20 +38,20 @@ import java.util.function.Function;
*/
public class TripMapDtoFactory {
- protected static final Function<TripMapPoint, TripMapPointDto> TRIP_MAP_POINT_TRIP_MAP_POINT_DTO_FUNCTION = tripMapPoint -> {
+ public static TripMapDto of(String tripId, Set<TripMapPoint> points) {
+ TripMapDto tripMapDto = new TripMapDto();
+ tripMapDto.setId(tripId);
+ LinkedHashSet<TripMapPointDto> pointDtos = points.stream().map(TripMapDtoFactory::of).collect(Collectors.toCollection(LinkedHashSet::new));
+ tripMapDto.setPoints(pointDtos);
+ return tripMapDto;
+ }
+
+ private static TripMapPointDto of(TripMapPoint tripMapPoint) {
TripMapPointDto result = new TripMapPointDto();
result.setLatitude(tripMapPoint.getLatitude());
result.setLongitude(tripMapPoint.getLongitude());
result.setTime(tripMapPoint.getTime());
result.setType(TripMapPointType.valueOf(tripMapPoint.getType().name()));
return result;
- };
-
- public static TripMapDto newTripMapDto(String tripId, Set<TripMapPoint> points) {
- TripMapDto tripMapDto = new TripMapDto();
- tripMapDto.setId(tripId);
- LinkedHashSet<TripMapPointDto> pointDtos = Sets.newLinkedHashSet(Iterables.transform(points, TRIP_MAP_POINT_TRIP_MAP_POINT_DTO_FUNCTION::apply));
- tripMapDto.setPoints(pointDtos);
- return tripMapDto;
}
}
diff --git a/services-topia/src/main/java/fr/ird/observe/services/topia/service/data/longline/TripLonglineServiceTopia.java b/services-topia/src/main/java/fr/ird/observe/services/topia/service/data/longline/TripLonglineServiceTopia.java
index 18455ad..09dbd0e 100644
--- a/services-topia/src/main/java/fr/ird/observe/services/topia/service/data/longline/TripLonglineServiceTopia.java
+++ b/services-topia/src/main/java/fr/ird/observe/services/topia/service/data/longline/TripLonglineServiceTopia.java
@@ -48,7 +48,7 @@ import fr.ird.observe.services.dto.referential.ReferentialReference;
import fr.ird.observe.services.dto.referential.SpeciesDto;
import fr.ird.observe.services.dto.referential.SpeciesListDto;
import fr.ird.observe.services.dto.result.SaveResultDto;
-import fr.ird.observe.services.topia.entity.TripMapDtoFactory;
+import fr.ird.observe.services.topia.service.data.TripMapDtoFactory;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.DateUtil;
@@ -118,7 +118,7 @@ public class TripLonglineServiceTopia extends ObserveServiceTopia implements Tri
LinkedHashSet<TripMapPoint> points = getDao().extractTripMapActivityPoints(tripLonglineId);
- return TripMapDtoFactory.newTripMapDto(tripLonglineId, points);
+ return TripMapDtoFactory.of(tripLonglineId, points);
}
diff --git a/services-topia/src/main/java/fr/ird/observe/services/topia/service/data/seine/TripSeineServiceTopia.java b/services-topia/src/main/java/fr/ird/observe/services/topia/service/data/seine/TripSeineServiceTopia.java
index ebe73f1..8ba2d61 100644
--- a/services-topia/src/main/java/fr/ird/observe/services/topia/service/data/seine/TripSeineServiceTopia.java
+++ b/services-topia/src/main/java/fr/ird/observe/services/topia/service/data/seine/TripSeineServiceTopia.java
@@ -47,7 +47,7 @@ import fr.ird.observe.services.dto.seine.TripSeineDto;
import fr.ird.observe.services.service.data.seine.TripSeineService;
import fr.ird.observe.services.topia.ObserveServiceTopia;
import fr.ird.observe.services.topia.binder.referential.ReferentialBinderSupport;
-import fr.ird.observe.services.topia.entity.TripMapDtoFactory;
+import fr.ird.observe.services.topia.service.data.TripMapDtoFactory;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.DateUtil;
@@ -147,7 +147,7 @@ public class TripSeineServiceTopia extends ObserveServiceTopia implements TripSe
LinkedHashSet<TripMapPoint> points = getDao().extractTripMapActivityPoints(tripSeineId);
- return TripMapDtoFactory.newTripMapDto(tripSeineId, points);
+ return TripMapDtoFactory.of(tripSeineId, points);
}
--
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm(a)codelutin.com>.
1
0
This is an automated email from the git hooks/post-receive script.
New change to branch feature/8429 in repository observe.
See https://gitlab.nuiton.org/codelutin/observe.git
was 905a69b [iso] clean code
This change permanently discards the following revisions:
discards 905a69b [iso] clean code
discards e67fb09 refs #8429 fix referential access
discards 6804ee8 refs #8554 Ajout de logs sur le sql
discards abd3d69 refs #8429 meilleure gestion du focus dans les assistants de base + suppression code mort
discards 2d34b2d ajout API getChild pour remplacer l'API findNodeById
discards e25e7ae meilleure gestion de l'affichage des nœuds
discards 5682241 gestion des nœuds de création
discards b1782db meilleure remontée de données
discards 628c272 refs #8429 continue les adaptations sur les arbres
discards 946c8f9 refs #8429 revue des nœud de chargement et utilisation de NavigationService
discards a2957b3 refs #8429 Ajout méthodes utiles
discards 7c376d4 refs #8429 Ajout service pour charger l'arbre de navigation
discards bed31c0 ne pas pas afficher les erreurs sur la base locale si cela n'est pas important
discards fe96e92 refs #8429 : réusinage des arbres
discards ec6c26c Amélioration paquetage de binders
discards 67e39b8 On repasse en sélection automatique sinon l'arbre ne se charge plus bien (en attendant de revoir l'API d'arbre)
discards 090748a Clean code
discards 6035bd0 Ajout de Program.tripCount pour optimiser le chargement dans l'arbre de naigation
discards 8357698 meilleure gestion du faction, réusinage des actions, ajout des actions globales
discards 21627b9 clean code + ne plus étendre l'arbre automatiquement
discards 946b44c Ajout de raccourci clavier sur les actions des formulaires
discards 6781948 Introduction de ObserveFocusManager et réusinage des ui (amélioration de la généricité + nouvel héritage pour les référentiels i18n)
discards f3617cd Gestion du focus sur les écrans d'édition (reste juste le référentiel à faire)
discards 9d34e50 Ajout raccourci clavier sur les listes déroulantes
discards 160c3dd refs #8554 : changement de la configuration du pool de connections
discards 8b5270a refs #8554 Ajout de logs sur le sql
discards 82b701f Suppression d'une api obsolète
discards 150fc03 Gérer les associations ordonnées (avec colonne _idx) lors de la réplication des entités
--
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm(a)codelutin.com>.
1
0