[Git][ultreiaio/ird-observe][develop-7.x] Review synchro ref advanced actions keystrokes and when they can be accessible
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe Commits: 125a9994 by tchemit at 2020-03-26T11:12:41+01:00 Review synchro ref advanced actions keystrokes and when they can be accessible - - - - - 4 changed files: - client-core/src/main/java/fr/ird/observe/client/ui/ObserveKeyStrokes.java - client-core/src/main/java/fr/ird/observe/client/ui/actions/admin/ObtainLeftSourceUIAction.java - client-core/src/main/java/fr/ird/observe/client/ui/actions/admin/ObtainRightSourceUIAction.java - client-core/src/main/java/fr/ird/observe/client/ui/admin/synchronize/referential/ng/ReferentialSynchroUIHandler.java Changes: ===================================== client-core/src/main/java/fr/ird/observe/client/ui/ObserveKeyStrokes.java ===================================== @@ -76,9 +76,10 @@ public abstract class ObserveKeyStrokes { public static final KeyStroke KEY_STROKE_SHOW_EMPTY_PROGRAM = KeyStroke.getKeyStroke("ctrl pressed F5"); public static final KeyStroke KEY_STROKE_CONFIGURE_LOCAL_SOURCE = KeyStroke.getKeyStroke("ctrl pressed L"); public static final KeyStroke KEY_STROKE_CONFIGURE_REMOTE_SOURCE = KeyStroke.getKeyStroke("ctrl pressed R"); - public static final KeyStroke KEY_STROKE_CONFIGURE_SYNCHRO_FROM_LEFT = KeyStroke.getKeyStroke("ctrl pressed A"); - public static final KeyStroke KEY_STROKE_CONFIGURE_SYNCHRO_FROM_RIGHT = KeyStroke.getKeyStroke("ctrl pressed B"); - public static final KeyStroke KEY_STROKE_CONFIGURE_SYNCHRO_FROM_BOTH = KeyStroke.getKeyStroke("ctrl pressed C"); + public static final KeyStroke KEY_STROKE_CONFIGURE_SYNCHRO_FROM_LEFT = KeyStroke.getKeyStroke("pressed F1"); + public static final KeyStroke KEY_STROKE_CONFIGURE_SYNCHRO_FROM_RIGHT = KeyStroke.getKeyStroke("pressed F2"); + public static final KeyStroke KEY_STROKE_CONFIGURE_SYNCHRO_FROM_BOTH = KeyStroke.getKeyStroke("pressed F3"); + public static final KeyStroke KEY_STROKE_CONFIGURE_SYNCHRO_SHOW_PROPERTIES = KeyStroke.getKeyStroke("pressed F4"); public static final KeyStroke KEY_STROKE_SAVE_TABLE_ENTRY = KeyStroke.getKeyStroke("ctrl pressed S"); public static final KeyStroke KEY_STROKE_PRESSED_ENTER = KeyStroke.getKeyStroke("pressed ENTER"); ===================================== client-core/src/main/java/fr/ird/observe/client/ui/actions/admin/ObtainLeftSourceUIAction.java ===================================== @@ -56,12 +56,14 @@ public class ObtainLeftSourceUIAction extends UIActionSupport { @Override public void actionPerformed(ActionEvent e) { + AdminUIModel model = ui.getModel(); + if (model.isWasStarted()) { + return; + } log.info("start obtain left connexion"); StorageUIModel sourceModel = ui.getLocalSourceModel(); StorageUILauncher.obtainConnexion(ui, ui.getParentContainer(Window.class), sourceModel); - log.debug("After modifiy source model isValid : " + sourceModel.isValid() + " / " + sourceModel.isValidStep()); - - AdminUIModel model = ui.getModel(); + log.debug(String.format("After modify source model isValid : %s / %s", sourceModel.isValid(), sourceModel.isValidStep())); model.getConfigModel().removeLocalSource(); model.getConfigModel().getLocalSourceModel().validate(); model.validate(); ===================================== client-core/src/main/java/fr/ird/observe/client/ui/actions/admin/ObtainRightSourceUIAction.java ===================================== @@ -57,10 +57,14 @@ public class ObtainRightSourceUIAction extends UIActionSupport { @Override public void actionPerformed(ActionEvent e) { + AdminUIModel model = ui.getModel(); + if (model.isWasStarted()) { + return; + } log.info("start obtain right connexion"); StorageUIModel sourceModel = ui.getCentralSourceModel(); StorageUILauncher.obtainConnexion(ui, ui.getParentContainer(Window.class), sourceModel); - AdminUIModel model = ui.getModel(); + log.debug(String.format("After modify source model isValid : %s / %s", sourceModel.isValid(), sourceModel.isValidStep())); model.getConfigModel().removeCentralSource(); model.getConfigModel().getCentralSourceModel().validate(StorageStep.CONFIG); model.validate(); ===================================== client-core/src/main/java/fr/ird/observe/client/ui/admin/synchronize/referential/ng/ReferentialSynchroUIHandler.java ===================================== @@ -87,27 +87,47 @@ public class ReferentialSynchroUIHandler extends AdminTabUIHandler<ReferentialSy configUI.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(ObserveKeyStrokes.KEY_STROKE_CONFIGURE_SYNCHRO_FROM_LEFT, "fromLeft"); configUI.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(ObserveKeyStrokes.KEY_STROKE_CONFIGURE_SYNCHRO_FROM_RIGHT, "fromRight"); configUI.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(ObserveKeyStrokes.KEY_STROKE_CONFIGURE_SYNCHRO_FROM_BOTH, "fromBoth"); + configUI.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(ObserveKeyStrokes.KEY_STROKE_CONFIGURE_SYNCHRO_SHOW_PROPERTIES, "showProperties"); configUI.getActionMap().put("fromLeft", new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { + if (getModel().isWasStarted()) { + return; + } extraConfig.getLEFT_TO_RIGHT().doClick(); } }); configUI.getActionMap().put("fromRight", new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { + if (getModel().isWasStarted()) { + return; + } extraConfig.getRIGHT_TO_LEFT().doClick(); } }); configUI.getActionMap().put("fromBoth", new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { + if (getModel().isWasStarted()) { + return; + } extraConfig.getBOTH().doClick(); } }); + configUI.getActionMap().put("showProperties", new AbstractAction() { + @Override + public void actionPerformed(ActionEvent e) { + if (getModel().isWasStarted()) { + return; + } + extraConfig.getShowProperties().doClick(); + } + }); ObserveKeyStrokes.addKeyStroke(extraConfig.getLEFT_TO_RIGHT(), ObserveKeyStrokes.KEY_STROKE_CONFIGURE_SYNCHRO_FROM_LEFT); ObserveKeyStrokes.addKeyStroke(extraConfig.getRIGHT_TO_LEFT(), ObserveKeyStrokes.KEY_STROKE_CONFIGURE_SYNCHRO_FROM_RIGHT); ObserveKeyStrokes.addKeyStroke(extraConfig.getBOTH(), ObserveKeyStrokes.KEY_STROKE_CONFIGURE_SYNCHRO_FROM_BOTH); + ObserveKeyStrokes.addKeyStroke(extraConfig.getShowProperties(), ObserveKeyStrokes.KEY_STROKE_CONFIGURE_SYNCHRO_SHOW_PROPERTIES); super.afterInit(this.ui); View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/125a9994870d96381a8ca338f9... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/125a9994870d96381a8ca338f9... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT