Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
ea9c3120
by Tony CHEMIT at 2017-08-01T14:35:36+02:00
3 changed files:
- client/src/main/java/fr/ird/observe/client/ui/UIHelper.java
- client/src/main/java/fr/ird/observe/client/ui/actions/storage/UseRemoteConfigurationUIAction.java
- client/src/main/java/fr/ird/observe/client/ui/actions/storage/UseServerConfigurationUIAction.java
Changes:
| ... | ... | @@ -23,12 +23,12 @@ package fr.ird.observe.client.ui; |
| 23 | 23 |
|
| 24 | 24 |
import fr.ird.observe.client.ObserveSwingApplicationContext;
|
| 25 | 25 |
import fr.ird.observe.client.ObserveSwingTechnicalException;
|
| 26 |
-import fr.ird.observe.services.decoration.DecoratorService;
|
|
| 27 |
-import fr.ird.observe.services.decoration.ObserveI18nDecoratorHelper;
|
|
| 28 | 26 |
import fr.ird.observe.client.ui.actions.menu.storage.ChangeStorageAction;
|
| 29 | 27 |
import fr.ird.observe.client.ui.actions.menu.storage.CloseStorageAction;
|
| 30 | 28 |
import fr.ird.observe.client.ui.actions.menu.storage.ReloadStorageAction;
|
| 31 | 29 |
import fr.ird.observe.client.ui.util.table.ObserveBooleanTableCellRenderer;
|
| 30 |
+import fr.ird.observe.services.decoration.DecoratorService;
|
|
| 31 |
+import fr.ird.observe.services.decoration.ObserveI18nDecoratorHelper;
|
|
| 32 | 32 |
import fr.ird.observe.services.dto.DataDto;
|
| 33 | 33 |
import fr.ird.observe.services.dto.DataFileDto;
|
| 34 | 34 |
import fr.ird.observe.services.dto.IdDto;
|
| ... | ... | @@ -637,8 +637,9 @@ public class UIHelper extends SwingUtil { |
| 637 | 637 |
if (component == null) {
|
| 638 | 638 |
return;
|
| 639 | 639 |
}
|
| 640 |
- boolean canAcquireFocus = ObserveSwingApplicationContext.get().getMainUI().getModel().canAcquireFocus();
|
|
| 641 |
- if (canAcquireFocus) {
|
|
| 640 |
+ if (ObserveSwingApplicationContext.get().getMainUI() == null) {
|
|
| 641 |
+ SwingUtilities.invokeLater(component::requestFocus);
|
|
| 642 |
+ } else if (ObserveSwingApplicationContext.get().getMainUI().getModel().canAcquireFocus()) {
|
|
| 642 | 643 |
SwingUtilities.invokeLater(component::requestFocusInWindow);
|
| 643 | 644 |
}
|
| 644 | 645 |
}
|
| ... | ... | @@ -79,7 +79,9 @@ public class UseRemoteConfigurationUIAction extends AbstractUIAction { |
| 79 | 79 |
configUI.getTestRemoteAction().doClick();
|
| 80 | 80 |
if (ConnexionStatus.SUCCESS == configUI.getModel().getConnexionStatus()) {
|
| 81 | 81 |
parentContainer.getNextAction().doClick();
|
| 82 |
- parentContainer.getApplyAction().doClick();
|
|
| 82 |
+ if (getMainUI() != null) {
|
|
| 83 |
+ parentContainer.getApplyAction().doClick();
|
|
| 84 |
+ }
|
|
| 83 | 85 |
}
|
| 84 | 86 |
});
|
| 85 | 87 |
}
|
| ... | ... | @@ -80,7 +80,9 @@ public class UseServerConfigurationUIAction extends AbstractUIAction { |
| 80 | 80 |
configUI.getTestRemoteAction().doClick();
|
| 81 | 81 |
if (ConnexionStatus.SUCCESS == configUI.getModel().getConnexionStatus()) {
|
| 82 | 82 |
parentContainer.getNextAction().doClick();
|
| 83 |
- parentContainer.getApplyAction().doClick();
|
|
| 83 |
+ if (getMainUI() != null) {
|
|
| 84 |
+ parentContainer.getApplyAction().doClick();
|
|
| 85 |
+ }
|
|
| 84 | 86 |
}
|
| 85 | 87 |
});
|
| 86 | 88 |
|