Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
134fef94
by Tony Chemit at 2022-06-10T11:56:42+02:00
-
5465fa21
by Tony Chemit at 2022-06-10T12:16:20+02:00
-
7555318a
by Tony Chemit at 2022-06-10T12:22:02+02:00
3 changed files:
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/navigation/NavigationTree.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/navigation/NavigationTreeModel.java
- pom.xml
Changes:
| ... | ... | @@ -215,39 +215,19 @@ public class NavigationTree extends JXTree implements WithClientUIContextApi { |
| 215 | 215 | * Select initial node when data source just opened.
|
| 216 | 216 | */
|
| 217 | 217 | public void reselectInitialNode(String[] paths) {
|
| 218 | - NavigationNode node = paths == null ? null : getModel().getNodeFromPath(paths, true);
|
|
| 219 | - if (node == null) {
|
|
| 220 | - selectInitialNode();
|
|
| 221 | - } else {
|
|
| 222 | - selectSafeNode(node);
|
|
| 218 | + try {
|
|
| 219 | + NavigationNode node = paths == null ? null : getModel().getNodeFromPath(paths, true);
|
|
| 220 | + if (node == null) {
|
|
| 221 | + selectInitialNode();
|
|
| 222 | + } else {
|
|
| 223 | + selectSafeNode(node);
|
|
| 224 | + }
|
|
| 225 | + } catch (Exception e) {
|
|
| 226 | + log.error("Could not re select initial node", e);
|
|
| 223 | 227 | }
|
| 224 | -// RootNavigationNode root = getRootNode();
|
|
| 225 | -// if (!root.isLeaf()) {
|
|
| 226 | -// try {
|
|
| 227 | -// NavigationNode nodeFromRoot = root.findNodeFromPreviousSelectedNode(selectedNode);
|
|
| 228 | -// if (nodeFromRoot == null) {
|
|
| 229 | -// selectInitialNode();
|
|
| 230 | -// } else {
|
|
| 231 | -// selectSafeNode(nodeFromRoot);
|
|
| 232 | -// }
|
|
| 233 | -// } catch (Exception e) {
|
|
| 234 | -// // can't reselect this node
|
|
| 235 | -// selectFirstNode();
|
|
| 236 | -// }
|
|
| 237 | -// }
|
|
| 238 | 228 | SwingUtilities.invokeLater(this::requestFocusInWindow);
|
| 239 | 229 | }
|
| 240 | 230 | |
| 241 | -// public void addUnsavedNode(NavigationNode parentNode, NavigationNode result) {
|
|
| 242 | -// parentNode.add(result);
|
|
| 243 | -// // refresh parent node (renderResource of parent can have changed)
|
|
| 244 | -// parentNode.nodeChangedDeep();
|
|
| 245 | -// // Fix bug (if no child in parent node, it will not expand...)
|
|
| 246 | -// fireTreeExpanded(new TreePath(result.getPath()));
|
|
| 247 | -// // Select new node
|
|
| 248 | -// selectSafeNode(result);
|
|
| 249 | -// }
|
|
| 250 | - |
|
| 251 | 231 | public RootNavigationNode getRootNode() {
|
| 252 | 232 | return getModel().getRoot();
|
| 253 | 233 | }
|
| ... | ... | @@ -117,7 +117,13 @@ public class NavigationTreeModel extends DefaultTreeModel implements WithClientU |
| 117 | 117 | NavigationNode selectedNode = null;
|
| 118 | 118 | RootNavigationNode rootNode = getRoot();
|
| 119 | 119 | for (SelectNodeStrategy selectNodeStrategy : getSelectNodeStrategies(rootNode.getInitializer().getRequest())) {
|
| 120 | - Optional<NavigationNode> optionalSelectedNode = selectNodeStrategy.apply(rootNode);
|
|
| 120 | + Optional<NavigationNode> optionalSelectedNode;
|
|
| 121 | + try {
|
|
| 122 | + optionalSelectedNode = selectNodeStrategy.apply(rootNode);
|
|
| 123 | + } catch (Exception e) {
|
|
| 124 | + log.error("can't get initial node from strategy: " + selectNodeStrategy, e);
|
|
| 125 | + optionalSelectedNode = Optional.empty();
|
|
| 126 | + }
|
|
| 121 | 127 | if (optionalSelectedNode.isPresent()) {
|
| 122 | 128 | selectedNode = optionalSelectedNode.get();
|
| 123 | 129 | break;
|
| ... | ... | @@ -23,7 +23,7 @@ |
| 23 | 23 | <parent>
|
| 24 | 24 | <groupId>io.ultreia.maven</groupId>
|
| 25 | 25 | <artifactId>pom</artifactId>
|
| 26 | - <version>2022.60</version>
|
|
| 26 | + <version>2022.62</version>
|
|
| 27 | 27 | </parent>
|
| 28 | 28 | <groupId>fr.ird.observe</groupId>
|
| 29 | 29 | <artifactId>ird-observe</artifactId>
|
| ... | ... | @@ -111,7 +111,7 @@ |
| 111 | 111 | <!-- build timestamp configuration -->
|
| 112 | 112 | <maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format>
|
| 113 | 113 | <buildDate>${maven.build.timestamp}</buildDate>
|
| 114 | - <lib.version.toolkit>6.1.4</lib.version.toolkit>
|
|
| 114 | + <lib.version.toolkit>6.1.5-SNAPSHOT</lib.version.toolkit>
|
|
| 115 | 115 | <lib.version.ognl>3.1.29</lib.version.ognl>
|
| 116 | 116 | <!-- FIXME <lib.version.ognl>3.3.2</lib.version.ognl>-->
|
| 117 | 117 | <lib.version.h2>1.4.196</lib.version.h2>
|