Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: bf756391 by Tony CHEMIT at 2017-08-01T13:50:16+02:00 Speed up connection opening (See #805) (focus on first widget) - - - - - 1 changed file: - client/src/main/java/fr/ird/observe/client/ui/storage/StorageUIHandler.java Changes: ===================================== client/src/main/java/fr/ird/observe/client/ui/storage/StorageUIHandler.java ===================================== --- a/client/src/main/java/fr/ird/observe/client/ui/storage/StorageUIHandler.java +++ b/client/src/main/java/fr/ird/observe/client/ui/storage/StorageUIHandler.java @@ -33,7 +33,6 @@ import fr.ird.observe.client.configuration.constants.CreationMode; import fr.ird.observe.client.configuration.constants.DbMode; import fr.ird.observe.client.db.ObserveSwingDataSource; import fr.ird.observe.client.db.constants.ConnexionStatus; -import fr.ird.observe.services.decoration.DecoratorService; import fr.ird.observe.client.ui.ObserveKeyStrokes; import fr.ird.observe.client.ui.ObserveMainUI; import fr.ird.observe.client.ui.UIHelper; @@ -48,6 +47,7 @@ import fr.ird.observe.services.configuration.ObserveDataSourceInformation; import fr.ird.observe.services.configuration.rest.ObserveDataSourceConfigurationRest; import fr.ird.observe.services.configuration.topia.ObserveDataSourceConfigurationTopiaH2; import fr.ird.observe.services.configuration.topia.ObserveDataSourceConfigurationTopiaPG; +import fr.ird.observe.services.decoration.DecoratorService; import fr.ird.observe.services.dto.ObserveDbUserDto; import fr.ird.observe.services.dto.source.DataSourceCreateConfigurationDto; import fr.ird.observe.services.service.sql.AddSqlScriptProducerRequest; @@ -105,7 +105,7 @@ public class StorageUIHandler implements UIHandler<StorageUI> { SwingUtilities.invokeLater(() -> { JComponent focusOwner = getFocusComponent(ui.getModel().getStep()); if (focusOwner != null) { - focusOwner.grabFocus(); + UIHelper.askFocus(focusOwner); } }); @@ -113,7 +113,7 @@ public class StorageUIHandler implements UIHandler<StorageUI> { ui.setVisible(true); } - public JComponent getFocusComponent(StorageStep newStep) { + private JComponent getFocusComponent(StorageStep newStep) { DbMode dbMode = ui.getModel().getDbMode(); JComponent focusOwner; @@ -198,7 +198,7 @@ public class StorageUIHandler implements UIHandler<StorageUI> { return focusOwner; } - public void onStepChanged(StorageStep oldStep, StorageStep newStep) { + void onStepChanged(StorageStep oldStep, StorageStep newStep) { if (newStep == null) { return; } @@ -292,14 +292,13 @@ public class StorageUIHandler implements UIHandler<StorageUI> { } - JComponent focusComponent = getFocusComponent(newStep); if (focusComponent != null) { - focusComponent.requestFocusInWindow(); + UIHelper.askFocus(focusComponent); } } - public void launchApply() { + void launchApply() { ui.getModel().setAlreadyApplied(true); @@ -329,7 +328,7 @@ public class StorageUIHandler implements UIHandler<StorageUI> { } } - public void launchCancel() { + void launchCancel() { Runnable action = WizardUILancher.CANCEL_DEF.getContextValue(ui); @@ -587,7 +586,7 @@ public class StorageUIHandler implements UIHandler<StorageUI> { * @param dumpProducerService le service de dump * @param dst le fichier de sauvegarde */ - public void backupLocalDatabase(SqlScriptProducerService dumpProducerService, File dst) { + private void backupLocalDatabase(SqlScriptProducerService dumpProducerService, File dst) { if (dst == null) { throw new IllegalArgumentException( "file where to backup can not be null"); @@ -709,7 +708,7 @@ public class StorageUIHandler implements UIHandler<StorageUI> { model.init(ui, dataSourceConfiguration); } - protected void initSelectData(StorageUI ui) { + private void initSelectData(StorageUI ui) { StorageUIModel model = ui.getModel(); @@ -777,7 +776,7 @@ public class StorageUIHandler implements UIHandler<StorageUI> { } } - protected void updateSecurity(StorageUIModel model, RolesTableModel roleModel) { + private void updateSecurity(StorageUIModel model, RolesTableModel roleModel) { SecurityModel security = model.getSecurityModel(); @@ -817,7 +816,7 @@ public class StorageUIHandler implements UIHandler<StorageUI> { } - protected String computeReport(StorageStep step) { + private String computeReport(StorageStep step) { if (log.isDebugEnabled()) { log.debug("Build report from step " + step); } View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/bf756391ccec24ea3435e104119f... --- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/bf756391ccec24ea3435e104119f... You're receiving this email because of your account on gitlab.com.