Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
1ad00f06
by Tony Chemit at 2024-12-10T16:39:40+01:00
-
a5305eba
by Tony Chemit at 2024-12-10T17:08:44+01:00
-
3774d827
by Tony Chemit at 2024-12-10T17:11:33+01:00
2 changed files:
- client/core/src/main/java/fr/ird/observe/client/main/body/ClientConfigUI.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/referential/ContentReferentialUIHandler.java
Changes:
| ... | ... | @@ -414,7 +414,7 @@ public class ClientConfigUI extends JXTitledPanel implements WithClientUIContext |
| 414 | 414 | helper.addOption(ClientConfigOption.H2_CAN_MIGRATE).setOptionCallBack("application");
|
| 415 | 415 | helper.addOption(ClientConfigOption.OBSTUNA_CAN_MIGRATE).setOptionCallBack("application");
|
| 416 | 416 | helper.addOption(ClientConfigOption.H2_SERVER_PORT).setOptionCallBack("application");
|
| 417 | - helper.addOption(ClientConfigOption.H2_CAN_EDIT_REFERENTIAL).setOptionCallBack("ui");
|
|
| 417 | + helper.addOption(ClientConfigOption.H2_CAN_EDIT_REFERENTIAL).setOptionCallBack("db");
|
|
| 418 | 418 | helper.addOption(ClientConfigOption.AVDTH_FORCE_IMPORT).setOptionCallBack("ui");
|
| 419 | 419 | |
| 420 | 420 | helper.addOption(ClientConfigOption.SHOW_SQL);
|
| ... | ... | @@ -207,6 +207,23 @@ public class ContentReferentialUIHandler<D extends ReferentialDto, R extends Ref |
| 207 | 207 | }
|
| 208 | 208 | };
|
| 209 | 209 | ChangeMode<U> changeMode = new ChangeMode<>(request, changeModeProducer, null) {
|
| 210 | + @Override
|
|
| 211 | + protected void rebuildTitle(U ui, ContentMode newValue) {
|
|
| 212 | + if (Objects.equals(newValue, ContentMode.READ) ) {
|
|
| 213 | + ContentReferentialUIModelStates<D, R> states = ui.getModel().getStates();
|
|
| 214 | + boolean editable = states.isEditable();
|
|
| 215 | + String titleSuffix;
|
|
| 216 | + if (editable) {
|
|
| 217 | + titleSuffix = I18n.t("observe.Common.action.updating");
|
|
| 218 | + } else {
|
|
| 219 | + titleSuffix = I18n.t("observe.Common.action.notEditable");
|
|
| 220 | + }
|
|
| 221 | + String contentTitle = states.getContentTitle() + " - " + titleSuffix;
|
|
| 222 | + ui.setTitle(contentTitle);
|
|
| 223 | + return;
|
|
| 224 | + }
|
|
| 225 | + super.rebuildTitle(ui, newValue);
|
|
| 226 | + }
|
|
| 210 | 227 | |
| 211 | 228 | protected void rebuildAction(U ui, ContentMode newValue) {
|
| 212 | 229 | boolean editable;
|
| ... | ... | @@ -230,7 +247,7 @@ public class ContentReferentialUIHandler<D extends ReferentialDto, R extends Ref |
| 230 | 247 | editable = states.isEditable();
|
| 231 | 248 | if (editable) {
|
| 232 | 249 | tip = I18n.n("observe.data.Openable.action.editable.tip");
|
| 233 | - icon = UIHelper.getContentActionIcon("locked");
|
|
| 250 | + icon = UIHelper.getContentActionIcon("unlocked");
|
|
| 234 | 251 | } else {
|
| 235 | 252 | tip = I18n.n("observe.data.Openable.action.notEditable.tip");
|
| 236 | 253 | icon = UIHelper.getContentActionIcon("not-editable");
|