Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
60a3ac0a
by Tony CHEMIT at 2017-08-04T09:16:05+02:00
4 changed files:
- client/src/main/java/fr/ird/observe/client/ui/content/ContentUI.jaxx
- client/src/main/java/fr/ird/observe/client/ui/content/ContentUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/ContentUIManager.java
- client/src/main/java/fr/ird/observe/client/ui/content/impl/seine/FloatingObjectUIHandler.java
Changes:
| ... | ... | @@ -92,6 +92,10 @@ public void open() { |
| 92 | 92 |
getHandler().openUI();
|
| 93 | 93 |
}
|
| 94 | 94 |
|
| 95 |
+public void opened() {
|
|
| 96 |
+ getHandler().openedUI();
|
|
| 97 |
+}
|
|
| 98 |
+ |
|
| 95 | 99 |
public boolean close() {
|
| 96 | 100 |
return getHandler().closeUI();
|
| 97 | 101 |
}
|
| ... | ... | @@ -1186,6 +1186,9 @@ public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U |
| 1186 | 1186 |
popup.show(button, x, y);
|
| 1187 | 1187 |
}
|
| 1188 | 1188 |
|
| 1189 |
+ protected void openedUI() {
|
|
| 1190 |
+ |
|
| 1191 |
+ }
|
|
| 1189 | 1192 |
protected ObserveServicesProvider getServicesProvider() {
|
| 1190 | 1193 |
return ObserveSwingDataSource.MAIN;
|
| 1191 | 1194 |
}
|
| ... | ... | @@ -111,8 +111,8 @@ public class ContentUIManager { |
| 111 | 111 |
log.debug("Will open ui [" + constraints + "] : " + content.getClass());
|
| 112 | 112 |
}
|
| 113 | 113 |
|
| 114 |
- // on ouvre l'ui
|
|
| 115 | 114 |
try {
|
| 115 |
+ |
|
| 116 | 116 |
content.open();
|
| 117 | 117 |
|
| 118 | 118 |
ObserveSwingSessionHelper swingSessionHelper = ObserveSwingApplicationContext.get().getSwingSessionHelper();
|
| ... | ... | @@ -124,8 +124,9 @@ public class ContentUIManager { |
| 124 | 124 |
} finally {
|
| 125 | 125 |
|
| 126 | 126 |
getLayout().show(getLayoutContent(), constraints);
|
| 127 |
- |
|
| 128 | 127 |
getMainUI().getHandler().updateContentSize(25);
|
| 128 |
+ |
|
| 129 |
+ content.opened();
|
|
| 129 | 130 |
}
|
| 130 | 131 |
|
| 131 | 132 |
}
|
| ... | ... | @@ -168,7 +168,6 @@ public class FloatingObjectUIHandler extends ContentUIHandler<FloatingObjectDto, |
| 168 | 168 |
}
|
| 169 | 169 |
floatingObjectReference = Optional.empty();
|
| 170 | 170 |
|
| 171 |
- getUi().getMainTabbedPane().setSelectedIndex(0);
|
|
| 172 | 171 |
} else {
|
| 173 | 172 |
|
| 174 | 173 |
// update mode
|
| ... | ... | @@ -195,6 +194,14 @@ public class FloatingObjectUIHandler extends ContentUIHandler<FloatingObjectDto, |
| 195 | 194 |
getUi().startEdit(null);
|
| 196 | 195 |
}
|
| 197 | 196 |
|
| 197 |
+ }
|
|
| 198 |
+ |
|
| 199 |
+ @Override
|
|
| 200 |
+ protected void openedUI() {
|
|
| 201 |
+ if (getModel().isCreatingMode()) {
|
|
| 202 |
+ getUi().getMainTabbedPane().setSelectedIndex(0);
|
|
| 203 |
+ }
|
|
| 204 |
+ |
|
| 198 | 205 |
SwingUtilities.invokeLater(this::forceGrabFocusOnForm);
|
| 199 | 206 |
}
|
| 200 | 207 |
|