Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
b34346ed
by Tony Chemit at 2024-08-29T16:05:04+02:00
2 changed files:
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/DataSourceEditorHandler.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/ContentUIHandler.java
Changes:
| ... | ... | @@ -88,6 +88,7 @@ public class DataSourceEditorHandler implements UIHandler<DataSourceEditor>, Wit |
| 88 | 88 | contentAdjusting = true;
|
| 89 | 89 | try {
|
| 90 | 90 | log.info(String.format("Content ui changed from: %s to %s", previousContentUI == null ? null : previousContentUI.getModel().getPrefix(), contentUI == null ? null : contentUI.getModel().getPrefix()));
|
| 91 | + swingSessionHelper.save();
|
|
| 91 | 92 | if (previousContentUI != null) {
|
| 92 | 93 | log.info(String.format("[%s] Will destroy previous content ui", previousContentUI.getClass().getSimpleName()));
|
| 93 | 94 | previousContentUI.destroy();
|
| ... | ... | @@ -131,7 +132,6 @@ public class DataSourceEditorHandler implements UIHandler<DataSourceEditor>, Wit |
| 131 | 132 | log.info(String.format("%sWill open ui", contentUI.getModel().getPrefix()));
|
| 132 | 133 | contentUI.open();
|
| 133 | 134 | swingSessionHelper.addComponent(contentUI, true);
|
| 134 | - swingSessionHelper.save();
|
|
| 135 | 135 | contentUI.onOpened();
|
| 136 | 136 | updateContentSize();
|
| 137 | 137 | log.info(String.format("%s opened", contentUI.getModel().getPrefix()));
|
| ... | ... | @@ -149,6 +149,9 @@ public abstract class ContentUIHandler<U extends ContentUI> implements ObserveSe |
| 149 | 149 | throw new IllegalStateException("Can't init twice " + this);
|
| 150 | 150 | }
|
| 151 | 151 | init = true;
|
| 152 | + // always set the class name as name of the top component, otherwise when saving via SwingSession we can not
|
|
| 153 | + // distinguish the UI from another one
|
|
| 154 | + ui.setName(ui.getClass().getName());
|
|
| 152 | 155 | this.contentOpen = Objects.requireNonNull(createContentOpen(ui));
|
| 153 | 156 | |
| 154 | 157 | ContentUIModel model = ui.getModel();
|