Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe Commits: aa84cc6f by Tony Chemit at 2020-05-10T11:50:07+02:00 Report form v8 : * Dans le gestionnaire de connexions, un bouton 'dupliquer le profil' serait pratique - Closes #1477 * Quelques améliorations dans le gestionnaire de connexion - Closes #1479 * L'écran de gestion des connexions pourrait être présenté en partage horizontal - Closes #1480 - - - - - 14 changed files: - client-core/src/main/i18n/getters/java.getter - client-core/src/main/java/fr/ird/observe/client/ui/ObserveKeyStrokes.java - client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/CancelRemoteUIAction.java - client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/CancelServerUIAction.java - client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/DeleteRemoteUIAction.java - client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/DeleteServerUIAction.java - + client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/DuplicateRemoteUIAction.java - + client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/DuplicateServerUIAction.java - client-core/src/main/java/fr/ird/observe/client/ui/storage/presets/RemotePresetsUI.jaxx - client-core/src/main/java/fr/ird/observe/client/ui/storage/presets/RemotePresetsUI.jcss - client-core/src/main/java/fr/ird/observe/client/ui/storage/presets/RemotePresetsUIHandler.java - observe-i18n/src/main/i18n/translations/observe_en_GB.properties - observe-i18n/src/main/i18n/translations/observe_es_ES.properties - observe-i18n/src/main/i18n/translations/observe_fr_FR.properties Changes: ===================================== client-core/src/main/i18n/getters/java.getter ===================================== @@ -44,6 +44,9 @@ observe.action.delete.remote.tip observe.action.delete.server.tip observe.action.delete.tip observe.action.detail +observe.action.duplicate +observe.action.duplicate.remote.tip +observe.action.duplicate.server.tip observe.action.exit observe.action.exit.tip observe.action.floatingObjectPresets ===================================== client-core/src/main/java/fr/ird/observe/client/ui/ObserveKeyStrokes.java ===================================== @@ -86,6 +86,7 @@ public abstract class ObserveKeyStrokes { public static final KeyStroke KEY_STROKE_RESET_DATA = KeyStroke.getKeyStroke("pressed F7"); public static final KeyStroke KEY_STROKE_NEW_NEXT_DATA = KeyStroke.getKeyStroke("pressed F4"); public static final KeyStroke KEY_STROKE_DELETE_DATA_GLOBAL = KeyStroke.getKeyStroke("pressed F6"); + public static final KeyStroke KEY_STROKE_DUPLICATE = KeyStroke.getKeyStroke("pressed F2"); public static final KeyStroke KEY_STROKE_OPEN_DATA = KeyStroke.getKeyStroke("pressed F2"); public static final KeyStroke KEY_STROKE_CLOSE_DATA = KeyStroke.getKeyStroke("pressed F3"); public static final KeyStroke KEY_STROKE_SAVE_DATA = KeyStroke.getKeyStroke("pressed F5"); ===================================== client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/CancelRemoteUIAction.java ===================================== @@ -57,6 +57,8 @@ public class CancelRemoteUIAction extends PresetsUIActionSupport { ObserveSwingApplicationContext.get().getConfig().removeRemoteDataSourceConfiguration(configuration); ui.getModel().setRemoteDataSourceConfiguration(null); ui.getModel().setRemoteCreateMode(false); + int newConfiguration = configurations.isEmpty() ? -1 : 0; + ui.getRemoteConfigurations().setSelectedIndex(newConfiguration); } } ===================================== client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/CancelServerUIAction.java ===================================== @@ -57,6 +57,8 @@ public class CancelServerUIAction extends PresetsUIActionSupport { ObserveSwingApplicationContext.get().getConfig().removeServerDataSourceConfiguration(configuration); ui.getModel().setServerDataSourceConfiguration(null); ui.getModel().setServerCreateMode(false); + int newConfiguration = configurations.isEmpty() ? -1 : 0; + ui.getServerConfigurations().setSelectedIndex(newConfiguration); } } ===================================== client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/DeleteRemoteUIAction.java ===================================== @@ -69,6 +69,8 @@ public class DeleteRemoteUIAction extends PresetsUIActionSupport { ui.getModel().setRemoteDataSourceConfigurations(configurations); ObserveSwingApplicationContext.get().getConfig().removeRemoteDataSourceConfiguration(configuration); ui.getModel().setRemoteDataSourceConfiguration(null); + int newConfiguration = configurations.isEmpty() ? -1 : 0; + ui.getRemoteConfigurations().setSelectedIndex(newConfiguration); } } } ===================================== client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/DeleteServerUIAction.java ===================================== @@ -71,6 +71,8 @@ public class DeleteServerUIAction extends PresetsUIActionSupport { ui.getModel().setServerDataSourceConfigurations(configurations); ObserveSwingApplicationContext.get().getConfig().removeServerDataSourceConfiguration(configuration); ui.getModel().setServerDataSourceConfiguration(null); + int newConfiguration = configurations.isEmpty() ? -1 : 0; + ui.getServerConfigurations().setSelectedIndex(newConfiguration); } } ===================================== client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/DuplicateRemoteUIAction.java ===================================== @@ -0,0 +1,61 @@ +package fr.ird.observe.client.ui.actions.storage.presets; + +/*- + * #%L + * ObServe :: Client core + * %% + * Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import fr.ird.observe.client.ui.ObserveKeyStrokes; +import fr.ird.observe.client.ui.ObserveMainUI; +import fr.ird.observe.client.ui.storage.presets.RemotePresetsUI; +import fr.ird.observe.dto.presets.RemoteDataSourceConfiguration; + +import java.util.ArrayList; +import java.util.List; + +import static io.ultreia.java4all.i18n.I18n.n; + +public class DuplicateRemoteUIAction extends PresetsUIActionSupport { + + public static final String ACTION_NAME = DuplicateRemoteUIAction.class.getName(); + + public DuplicateRemoteUIAction(ObserveMainUI mainUI) { + super(mainUI, ACTION_NAME, n("observe.action.duplicate"), n("observe.action.duplicate.remote.tip"), "mode-create", ObserveKeyStrokes.KEY_STROKE_DUPLICATE); + } + + @Override + protected void doActionPerformed(RemotePresetsUI ui) { + + RemoteDataSourceConfiguration incomingConfiguration = ui.getModel().getRemoteDataSourceConfiguration(); + + RemoteDataSourceConfiguration configuration = new RemoteDataSourceConfiguration(); + + configuration.setLogin(incomingConfiguration.getLogin()); + configuration.setPassword(incomingConfiguration.getPassword()); + configuration.setName(incomingConfiguration.getName() + " (Copie)"); + configuration.setUrl(incomingConfiguration.getUrl()); + + List<RemoteDataSourceConfiguration> configurations = new ArrayList<>(ui.getModel().getRemoteDataSourceConfigurations()); + configurations.add(configuration); + ui.getModel().setRemoteDataSourceConfigurations(configurations); + ui.getModel().setRemoteCreateMode(true); + ui.getRemoteConfigurations().setSelectedValue(configuration, true); + } +} ===================================== client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/DuplicateServerUIAction.java ===================================== @@ -0,0 +1,62 @@ +package fr.ird.observe.client.ui.actions.storage.presets; + +/*- + * #%L + * ObServe :: Client core + * %% + * Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import fr.ird.observe.client.ui.ObserveKeyStrokes; +import fr.ird.observe.client.ui.ObserveMainUI; +import fr.ird.observe.client.ui.storage.presets.RemotePresetsUI; +import fr.ird.observe.dto.presets.ServerDataSourceConfiguration; + +import java.util.ArrayList; +import java.util.List; + +import static io.ultreia.java4all.i18n.I18n.n; + +public class DuplicateServerUIAction extends PresetsUIActionSupport { + + public static final String ACTION_NAME = DuplicateServerUIAction.class.getName(); + + public DuplicateServerUIAction(ObserveMainUI mainUI) { + super(mainUI, ACTION_NAME, n("observe.action.duplicate"), n("observe.action.duplicate.server.tip"), "mode-create", ObserveKeyStrokes.KEY_STROKE_DUPLICATE); + } + + @Override + protected void doActionPerformed(RemotePresetsUI ui) { + + ServerDataSourceConfiguration incomingConfiguration = ui.getModel().getServerDataSourceConfiguration(); + ServerDataSourceConfiguration configuration = new ServerDataSourceConfiguration(); + + configuration.setDatabaseName(incomingConfiguration.getDatabaseName()); + configuration.setLogin(incomingConfiguration.getLogin()); + configuration.setPassword(incomingConfiguration.getPassword()); + configuration.setName(incomingConfiguration.getName() + " (Copie)"); + configuration.setUrl(incomingConfiguration.getUrl()); + + List<ServerDataSourceConfiguration> configurations = new ArrayList<>(ui.getModel().getServerDataSourceConfigurations()); + configurations.add(configuration); + ui.getModel().setServerDataSourceConfigurations(configurations); + ui.getModel().setServerCreateMode(true); + ui.getServerConfigurations().setSelectedValue(configuration, true); + + } +} ===================================== client-core/src/main/java/fr/ird/observe/client/ui/storage/presets/RemotePresetsUI.jaxx ===================================== @@ -19,7 +19,7 @@ <http://www.gnu.org/licenses/gpl-3.0.html>. #L% --> -<JPanel layout="{new BorderLayout()}"> +<org.jdesktop.swingx.JXTitledPanel id="dataSourcePresets"> <import> fr.ird.observe.dto.presets.RemoteDataSourceConfiguration @@ -28,6 +28,8 @@ fr.ird.observe.client.ui.actions.storage.presets.CreatePresetUIAction fr.ird.observe.client.ui.actions.storage.presets.DeleteRemoteUIAction fr.ird.observe.client.ui.actions.storage.presets.DeleteServerUIAction + fr.ird.observe.client.ui.actions.storage.presets.DuplicateRemoteUIAction + fr.ird.observe.client.ui.actions.storage.presets.DuplicateServerUIAction fr.ird.observe.client.ui.actions.storage.presets.QuitPresetsUIAction fr.ird.observe.client.ui.actions.storage.presets.CancelRemoteUIAction fr.ird.observe.client.ui.actions.storage.presets.ResetRemoteUIAction @@ -39,24 +41,26 @@ fr.ird.observe.client.ui.actions.storage.presets.TestServerUIAction org.nuiton.jaxx.widgets.select.BeanComboBox - + java.awt.CardLayout </import> <RemotePresetsUIModel id="model" initializer="getContextValue(RemotePresetsUIModel.class)"/> <JTabbedPane id='tabs' constraints='BorderLayout.CENTER'> <tab id='remoteTab' title="observe.storage.remote.presets.title"> - <JSplitPane id="remotePanel"> - <JList id='remoteConfigurations' genericType="RemoteDataSourceConfiguration"/> - <JPanel id="remoteContentPanel" layout="{new BorderLayout()}"> - <JLabel id="noRemoteSelected" constraints='BorderLayout.CENTER'/> - <Table id="remoteForm" constraints='BorderLayout.SOUTH' fill="both"> + <JPanel id="remotePanel" layout="{new BorderLayout()}"> + <JScrollPane id='remoteConfigurationsPane' constraints='BorderLayout.CENTER'> + <JList id='remoteConfigurations' genericType="RemoteDataSourceConfiguration"/> + </JScrollPane> + <JPanel id="remoteContentPanel" layout="{new CardLayout()}" constraints='BorderLayout.SOUTH' border='{new TitledBorder("")}'> + <JLabel id="noRemoteSelected" constraints='"empty"'/> + <Table id="remoteForm" constraints='"form"' fill="both"> <row> <cell anchor='west'> <JLabel text='observe.storage.remote.name'/> </cell> <cell weightx='1' fill="both" anchor='east'> - <JTextField id="remoteName" onKeyReleased="model.setRemoteModified(true);"/> + <JTextField id="remoteName" onKeyReleased="handler.setRemoteModified(event);"/> </cell> </row> <row> @@ -64,7 +68,7 @@ <JLabel text='observe.storage.remote.url'/> </cell> <cell weightx='1' fill="both" anchor='east'> - <JTextField id="remoteUrl" onKeyReleased="model.setRemoteModified(true);"/> + <JTextField id="remoteUrl" onKeyReleased="handler.setRemoteModified(event);"/> </cell> </row> <row> @@ -72,7 +76,7 @@ <JLabel text='observe.storage.remote.login'/> </cell> <cell weightx='1' fill="both" anchor='east'> - <JTextField id="remoteLogin" onKeyReleased="model.setRemoteModified(true);"/> + <JTextField id="remoteLogin" onKeyReleased="handler.setRemoteModified(event);"/> </cell> </row> <row> @@ -80,7 +84,7 @@ <JLabel text='observe.storage.remote.password'/> </cell> <cell weightx='1' fill="both" anchor='east'> - <JTextField id="remotePassword" onKeyReleased="model.setRemoteModified(true);"/> + <JTextField id="remotePassword" onKeyReleased="handler.setRemoteModified(event);"/> </cell> </row> <row> @@ -97,26 +101,29 @@ <JButton id="saveRemoteAction"/> <JButton id="deleteRemoteAction"/> <JButton id="testRemoteAction"/> + <JButton id="duplicateRemoteAction"/> </JPanel> </cell> </row> </Table> </JPanel> - </JSplitPane> + </JPanel> </tab> <tab id='serverTab' title="observe.storage.server.presets.title"> - <JSplitPane id="serverPanel"> - <JList id='serverConfigurations' genericType="ServerDataSourceConfiguration"/> - <JPanel id="serverContentPanel" layout="{new BorderLayout()}"> - <JLabel id="noServerSelected" constraints='BorderLayout.CENTER'/> - <Table id="serverForm" constraints='BorderLayout.SOUTH' fill="both"> + <JPanel id="serverPanel" layout="{new BorderLayout()}" > + <JScrollPane id='serverConfigurationsPane' constraints='BorderLayout.CENTER'> + <JList id='serverConfigurations' genericType="ServerDataSourceConfiguration"/> + </JScrollPane> + <JPanel id="serverContentPanel" layout="{new CardLayout()}" constraints='BorderLayout.SOUTH' border='{new TitledBorder("")}'> + <JLabel id="noServerSelected" constraints='"empty"'/> + <Table id="serverForm" constraints='"form"' fill="both"> <row> <cell anchor='west'> <JLabel text='observe.storage.remote.name'/> </cell> <cell weightx='1' fill="both" anchor='east'> - <JTextField id="serverName" onKeyReleased="model.setServerModified(true);"/> + <JTextField id="serverName" onKeyReleased="handler.setServerModified(event);"/> </cell> </row> <row> @@ -124,7 +131,7 @@ <JLabel text='observe.storage.remote.url'/> </cell> <cell weightx='1' fill="both" anchor='east'> - <JTextField id="serverUrl" onKeyReleased="model.setServerModified(true);"/> + <JTextField id="serverUrl" onKeyReleased="handler.setServerModified(event);"/> </cell> </row> <row> @@ -132,7 +139,7 @@ <JLabel text='observe.storage.remote.login'/> </cell> <cell weightx='1' fill="both" anchor='east'> - <JTextField id="serverLogin" onKeyReleased="model.setServerModified(true);"/> + <JTextField id="serverLogin" onKeyReleased="handler.setServerModified(event);"/> </cell> </row> <row> @@ -140,7 +147,7 @@ <JLabel text='observe.storage.remote.password'/> </cell> <cell weightx='1' fill="both" anchor='east'> - <JTextField id="serverPassword" onKeyReleased="model.setServerModified(true);"/> + <JTextField id="serverPassword" onKeyReleased="handler.setServerModified(event);"/> </cell> </row> <row> @@ -148,7 +155,7 @@ <JLabel id="serverDataBaseLabel" text='observe.storage.server.dataBase'/> </cell> <cell weightx='1' fill="both" anchor='east'> - <JTextField id="serverDataBase" onKeyReleased="model.setServerModified(true);"/> + <JTextField id="serverDataBase" onKeyReleased="handler.setServerModified(event);"/> </cell> </row> @@ -160,12 +167,13 @@ <JButton id="saveServerAction"/> <JButton id="deleteServerAction"/> <JButton id="testServerAction"/> + <JButton id="duplicateServerAction"/> </JPanel> </cell> </row> </Table> </JPanel> - </JSplitPane> + </JPanel> </tab> </JTabbedPane> @@ -174,4 +182,4 @@ <JButton id="quitAction"/> </JPanel> -</JPanel> +</org.jdesktop.swingx.JXTitledPanel> ===================================== client-core/src/main/java/fr/ird/observe/client/ui/storage/presets/RemotePresetsUI.jcss ===================================== @@ -21,15 +21,10 @@ */ #noRemoteSelected { - visible: true; text:"observe.storage.presets.no.selected"; horizontalAlignment: center; } -#remoteForm { - visible: false; -} - #remoteName { text:{SwingUtil.getStringValue(model.getRemoteDataSourceConfiguration().getName())}; } @@ -52,15 +47,10 @@ } #noServerSelected { - visible: true; text:"observe.storage.presets.no.selected"; horizontalAlignment: center; } -#serverForm { - visible: false; -} - #serverName { text:{SwingUtil.getStringValue(model.getServerDataSourceConfiguration().getName())}; } @@ -87,6 +77,7 @@ #resetRemoteAction { _observeAction:{ResetRemoteUIAction.ACTION_NAME}; + enabled:{model.isRemoteModified()}; } #saveRemoteAction { @@ -98,6 +89,10 @@ _observeAction:{DeleteRemoteUIAction.ACTION_NAME}; } +#duplicateRemoteAction { + _observeAction:{DuplicateRemoteUIAction.ACTION_NAME}; +} + #testRemoteAction { _observeAction:{TestRemoteUIAction.ACTION_NAME}; } @@ -120,6 +115,10 @@ _observeAction:{DeleteServerUIAction.ACTION_NAME}; } +#duplicateServerAction { + _observeAction:{DuplicateServerUIAction.ACTION_NAME}; +} + #testServerAction { _observeAction:{TestServerUIAction.ACTION_NAME}; } ===================================== client-core/src/main/java/fr/ird/observe/client/ui/storage/presets/RemotePresetsUIHandler.java ===================================== @@ -44,7 +44,7 @@ import javax.swing.JPanel; import javax.swing.JSplitPane; import javax.swing.KeyStroke; import javax.swing.SwingUtilities; -import java.awt.BorderLayout; +import java.awt.CardLayout; import java.awt.event.KeyEvent; import java.util.List; import java.util.Objects; @@ -105,6 +105,7 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> { ui.getModel().setRemoteModified(false); } else { ui.getModel().setRemoteDataSourceConfiguration(ui.getRemoteConfigurations().getSelectedValue()); + ui.getRemoteName().requestFocusInWindow(); } }); @@ -124,17 +125,12 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> { ui.getModel().addPropertyChangeListener("remoteDataSourceConfiguration", evt -> { RemoteDataSourceConfiguration oldValue = (RemoteDataSourceConfiguration) evt.getOldValue(); - if (ui.getModel().getRemoteDataSourceConfiguration() == null) { - ui.getRemoteContentPanel().remove(ui.getRemoteForm()); - ui.getRemoteContentPanel().add(ui.getNoRemoteSelected(), BorderLayout.CENTER); - UIHelper.askFocus(ui.getCreateAction()); + ((CardLayout) ui.getRemoteContentPanel().getLayout()).show(ui.getRemoteContentPanel(), "empty"); + ui.getCreateAction().requestFocusInWindow(); } else { if (oldValue == null) { - ui.getRemoteForm().setVisible(true); - ui.getRemoteContentPanel().remove(ui.getNoRemoteSelected()); - ui.getRemoteContentPanel().add(ui.getRemoteForm(), BorderLayout.CENTER); - UIHelper.askFocus(ui.getRemoteName()); + ((CardLayout) ui.getRemoteContentPanel().getLayout()).show(ui.getRemoteContentPanel(), "form"); } ui.getModel().setRemoteModified(false); } @@ -146,10 +142,12 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> { if ((Boolean) evt.getNewValue()) { remoteActions.remove(ui.getResetRemoteAction()); remoteActions.remove(ui.getDeleteRemoteAction()); + remoteActions.remove(ui.getDuplicateRemoteAction()); remoteActions.add(ui.getCancelRemoteAction(), 0); } else { remoteActions.add(ui.getResetRemoteAction(), 0); remoteActions.add(ui.getDeleteRemoteAction(), 2); + remoteActions.add(ui.getDuplicateRemoteAction()); remoteActions.remove(ui.getCancelRemoteAction()); } }); @@ -169,6 +167,7 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> { ui.getModel().setServerModified(false); } else { ui.getModel().setServerDataSourceConfiguration(ui.getServerConfigurations().getSelectedValue()); + ui.getServerName().requestFocusInWindow(); } }); @@ -190,15 +189,11 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> { ServerDataSourceConfiguration oldValue = (ServerDataSourceConfiguration) evt.getOldValue(); if (ui.getModel().getServerDataSourceConfiguration() == null) { - ui.getServerContentPanel().remove(ui.getServerForm()); - ui.getServerContentPanel().add(ui.getNoServerSelected(), BorderLayout.CENTER); - UIHelper.askFocus(ui.getCreateAction()); + ((CardLayout) ui.getServerContentPanel().getLayout()).show(ui.getServerContentPanel(), "empty"); + ui.getCreateAction().requestFocusInWindow(); } else { if (oldValue == null) { - ui.getServerForm().setVisible(true); - ui.getServerContentPanel().remove(ui.getNoServerSelected()); - ui.getServerContentPanel().add(ui.getServerForm(), BorderLayout.CENTER); - UIHelper.askFocus(ui.getServerName()); + ((CardLayout) ui.getServerContentPanel().getLayout()).show(ui.getServerContentPanel(), "form"); } ui.getModel().setServerModified(false); } @@ -210,11 +205,13 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> { if ((Boolean) evt.getNewValue()) { serverActions.remove(ui.getResetServerAction()); serverActions.remove(ui.getDeleteServerAction()); + serverActions.remove(ui.getDuplicateServerAction()); serverActions.add(ui.getCancelServerAction(), 0); } else { serverActions.add(ui.getResetServerAction(), 0); serverActions.add(ui.getDeleteServerAction(), 2); + serverActions.add(ui.getDuplicateServerAction()); serverActions.remove(ui.getCancelServerAction()); } }); @@ -222,6 +219,13 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> { ui.getServerActions().remove(0); UIHelper.askFocus(ui.getCreateAction()); + if (ui.getRemoteConfigurations().getModel().getSize()>0) { + ui.getRemoteConfigurations().setSelectedIndex(0); + } + + if (ui.getServerConfigurations().getModel().getSize()>0) { + ui.getServerConfigurations().setSelectedIndex(0); + } } protected void init(JSplitPane editor) { @@ -243,8 +247,33 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> { log.debug("init common action " + actionId); } + if (actionId.contains("Remote")) { + inputMap = ui.getRemoteContentPanel().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); + actionMap = ui.getRemoteContentPanel().getActionMap(); + } else if (actionId.contains("Server")) { + inputMap = ui.getServerContentPanel().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); + actionMap = ui.getServerContentPanel().getActionMap(); + } else { + inputMap = ui.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); + actionMap = ui.getActionMap(); + } action.initForMainUi(editor, inputMap, actionMap); editor.putClientProperty(UIActionSupport.CLIENT_PROPERTY_UI, ui); } + + protected void setServerModified(KeyEvent event) { + if (event.isActionKey()) { + return; + } + ui.getModel().setServerModified(true); + } + + protected void setRemoteModified(KeyEvent event) { + if (event.isActionKey()) { + return; + } + ui.getModel().setRemoteModified(true); + } + } ===================================== observe-i18n/src/main/i18n/translations/observe_en_GB.properties ===================================== @@ -72,6 +72,9 @@ observe.action.delete.tip=Delete observe.action.detail=Details observe.action.do.backup=Backup local database observe.action.do.backup.tip=Make a backup of local database before applying modifications. +observe.action.duplicate=Duplicate +observe.action.duplicate.remote.tip=Duplicate remote +observe.action.duplicate.server.tip=Duplicate server observe.action.exit=Quit observe.action.exit.tip=quit Observe observe.action.floatingObjectPresets=Floating Object references ===================================== observe-i18n/src/main/i18n/translations/observe_es_ES.properties ===================================== @@ -72,6 +72,9 @@ observe.action.delete.tip=Eliminar observe.action.detail=Ver detalles observe.action.do.backup=Guardar la base local observe.action.do.backup.tip=Hacer copia de seguridad de la base local antes de aplicar los cambios +observe.action.duplicate=Duplicate \#TODO +observe.action.duplicate.remote.tip=Duplicate remote \#TODO +observe.action.duplicate.server.tip=Duplicate server \#TODO observe.action.exit=Salir observe.action.exit.tip=Salir de ObServe observe.action.floatingObjectPresets=Referencias de objetos flotantes ===================================== observe-i18n/src/main/i18n/translations/observe_fr_FR.properties ===================================== @@ -72,6 +72,9 @@ observe.action.delete.tip=Supprimer observe.action.detail=Voir les détails observe.action.do.backup=Sauver la base locale observe.action.do.backup.tip=Effectuer une sauvegarde de la base locale avant d'appliquer les changements +observe.action.duplicate=Dupliquer +observe.action.duplicate.remote.tip=Duplicate la connexion distante +observe.action.duplicate.server.tip=Duplicate la connexion server observe.action.exit=Quitter observe.action.exit.tip=Quitter ObServe observe.action.floatingObjectPresets=Objets flottants de références View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/aa84cc6fdd6ed6c4b5ba88d49e... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/aa84cc6fdd6ed6c4b5ba88d49e... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT