Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
a76c2911
by Tony Chemit at 2020-06-24T19:04:50+02:00
5 changed files:
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/ContentUIHandler.java
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/data/edit/ContentEditUI.jaxx
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/data/edit/actions/SaveActionSupport.java
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/data/open/ContentOpenableUI.jaxx
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/ref/ContentReferenceUI.jaxx
Changes:
| ... | ... | @@ -459,7 +459,14 @@ public abstract class ContentUIHandler<U extends ContentUI> implements ObserveSe |
| 459 | 459 |
// dettach all validators
|
| 460 | 460 |
uninstallValidators();
|
| 461 | 461 |
}
|
| 462 |
- |
|
| 462 |
+ public void resetFromPreviousUi(U ui) {
|
|
| 463 |
+ if (tabbedPaneValidator != null) {
|
|
| 464 |
+ JTabbedPane mainTabbedPane = (JTabbedPane) ui.getObjectById(JaxxObjectInitializer.MAIN_TABBED_PANE);
|
|
| 465 |
+ if (mainTabbedPane != null) {
|
|
| 466 |
+ SwingUtilities.invokeLater(() -> ((JTabbedPane) this.ui.getObjectById(JaxxObjectInitializer.MAIN_TABBED_PANE)).setSelectedIndex((mainTabbedPane).getSelectedIndex()));
|
|
| 467 |
+ }
|
|
| 468 |
+ }
|
|
| 469 |
+ }
|
|
| 463 | 470 |
final void destroyUI() {
|
| 464 | 471 |
if (ui == null) {
|
| 465 | 472 |
return;
|
| ... | ... | @@ -42,6 +42,10 @@ |
| 42 | 42 |
@Override
|
| 43 | 43 |
public abstract ObserveSwingValidator<D> getValidator();
|
| 44 | 44 |
|
| 45 |
+public void resetFromPreviousUi(U previousUi) {
|
|
| 46 |
+ getHandler().resetFromPreviousUi(previousUi);
|
|
| 47 |
+}
|
|
| 48 |
+ |
|
| 45 | 49 |
]]>
|
| 46 | 50 |
</script>
|
| 47 | 51 |
|
| ... | ... | @@ -24,6 +24,7 @@ package fr.ird.observe.client.datasource.editor.content.data.edit.actions; |
| 24 | 24 |
|
| 25 | 25 |
import fr.ird.observe.client.datasource.api.ObserveDataSourcesManagerApplicationComponent;
|
| 26 | 26 |
import fr.ird.observe.client.datasource.editor.content.ContentMode;
|
| 27 |
+import fr.ird.observe.client.datasource.editor.content.ContentUI;
|
|
| 27 | 28 |
import fr.ird.observe.client.datasource.editor.content.actions.ContentUIActionSupport;
|
| 28 | 29 |
import fr.ird.observe.client.datasource.editor.content.data.edit.ContentEditUI;
|
| 29 | 30 |
import fr.ird.observe.client.datasource.editor.content.data.edit.ContentEditUIModel;
|
| ... | ... | @@ -116,6 +117,9 @@ public abstract class SaveActionSupport<D extends DataDto, R extends DataDtoRefe |
| 116 | 117 |
|
| 117 | 118 |
// on sélectionne le nouveau noeud
|
| 118 | 119 |
tree.selectSafeNode(node);
|
| 120 |
+ @SuppressWarnings({"RedundantExplicitVariableType", "unchecked"}) U newUi = (U) getDataSourceEditor().getContentUIManager().getSelectedContentUI();
|
|
| 121 |
+ newUi.resetFromPreviousUi(ui);
|
|
| 122 |
+ |
|
| 119 | 123 |
} else {
|
| 120 | 124 |
|
| 121 | 125 |
// on repaint le noeud et ses enfants
|
| ... | ... | @@ -43,6 +43,10 @@ |
| 43 | 43 |
@Override
|
| 44 | 44 |
public abstract ObserveSwingValidator<D> getValidator();
|
| 45 | 45 |
|
| 46 |
+public void resetFromPreviousUi(U previousUi) {
|
|
| 47 |
+ getHandler().resetFromPreviousUi(previousUi);
|
|
| 48 |
+}
|
|
| 49 |
+ |
|
| 46 | 50 |
]]>
|
| 47 | 51 |
</script>
|
| 48 | 52 |
|
| ... | ... | @@ -77,6 +77,10 @@ public abstract NormalTextEditor getUri(); |
| 77 | 77 |
@Override
|
| 78 | 78 |
public abstract ContentReferenceUIHandler<E, R, U> getHandler();
|
| 79 | 79 |
|
| 80 |
+public void resetFromPreviousUi(U previousUi) {
|
|
| 81 |
+ getHandler().resetFromPreviousUi(previousUi);
|
|
| 82 |
+}
|
|
| 83 |
+ |
|
| 80 | 84 |
public void decorateUniqueKeyTable(JTable table,
|
| 81 | 85 |
TableCellRenderer renderer,
|
| 82 | 86 |
JScrollPane pane) {
|