| ... |
... |
@@ -27,6 +27,7 @@ import fr.ird.observe.client.configuration.ClientConfig; |
|
27
|
27
|
import fr.ird.observe.client.db.ClientDataContext;
|
|
28
|
28
|
import fr.ird.observe.client.db.ObserveSwingDataSource;
|
|
29
|
29
|
import fr.ird.observe.client.ui.actions.UIActionSupport;
|
|
|
30
|
+import fr.ird.observe.client.ui.actions.main.global.ChangeFocusGlobalUIAction;
|
|
30
|
31
|
import fr.ird.observe.client.ui.content.ContentUI;
|
|
31
|
32
|
import fr.ird.observe.client.ui.content.ContentUIManager;
|
|
32
|
33
|
import fr.ird.observe.client.ui.content.ObserveActionMap;
|
| ... |
... |
@@ -441,36 +442,12 @@ public class ObserveMainUIInitializer { |
|
441
|
442
|
init(ui.getNavigationUI().getTree());
|
|
442
|
443
|
|
|
443
|
444
|
ui.getNavigationView().setRightDecoration(ui.getNavigationUI().getToolbar());
|
|
444
|
|
-// ui.getNavigationView().addComponentListener(new ComponentAdapter() {
|
|
445
|
|
-//
|
|
446
|
|
-// @Override
|
|
447
|
|
-// public void componentResized(ComponentEvent e) {
|
|
448
|
|
-//
|
|
449
|
|
-// JComponent source = (JComponent) e.getSource();
|
|
450
|
|
-//
|
|
451
|
|
-// NavigationTreeHeader actions = ui.getNavigationUI();
|
|
452
|
|
-//
|
|
453
|
|
-// Dimension preferredLayoutSize = actions.getLayout().preferredLayoutSize(actions);
|
|
454
|
|
-//
|
|
455
|
|
-// Dimension showLonglineSize = actions.getShowLongline().getSize();
|
|
456
|
|
-// Dimension showSeineSize = actions.getShowSeine().getSize();
|
|
457
|
|
-// Dimension showReferential = actions.getShowReferential().getSize();
|
|
458
|
|
-// Dimension showEmpty = actions.getShowEmptyProgram().getSize();
|
|
459
|
|
-// int minWidth = 18 + (int) Math.max(showLonglineSize.getWidth() + showSeineSize.getWidth(), showReferential.getWidth() + showEmpty.getWidth());
|
|
460
|
|
-// source.setMinimumSize(new Dimension(minWidth, (int) source.getSize().getHeight()));
|
|
461
|
|
-// log.debug("Header resized to minumun: " + source.getMinimumSize());
|
|
462
|
|
-//
|
|
463
|
|
-// int maxWidth = ui.getNavigationView().getWidth() - 10;
|
|
464
|
|
-//
|
|
465
|
|
-// int currentWidth = (int) preferredLayoutSize.getWidth();
|
|
466
|
|
-// int height = 32;
|
|
467
|
|
-// if (currentWidth > maxWidth) {
|
|
468
|
|
-// height += 32;
|
|
469
|
|
-// }
|
|
470
|
|
-// actions.setPreferredSize(new Dimension(maxWidth, height));
|
|
471
|
|
-//
|
|
472
|
|
-// }
|
|
473
|
|
-// });
|
|
|
445
|
+ ChangeFocusGlobalUIAction action = (ChangeFocusGlobalUIAction) Objects.requireNonNull(actionMap.get(ChangeFocusGlobalUIAction.ACTION_NAME));
|
|
|
446
|
+
|
|
|
447
|
+ // register this action since there is no editor on which attach this action
|
|
|
448
|
+ ui.getRootPane().getActionMap().put(ChangeFocusGlobalUIAction.ACTION_NAME, action);
|
|
|
449
|
+ ui.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(action.getAcceleratorKey(), ChangeFocusGlobalUIAction.ACTION_NAME);
|
|
|
450
|
+
|
|
474
|
451
|
}
|
|
475
|
452
|
|
|
476
|
453
|
protected void init(ObserveActionMap actionMap, AbstractButton editor) {
|