diff options
author | Pierrick MARIE | 2012-07-04 09:35:49 -0400 |
---|---|---|
committer | Benjamin Cabé | 2012-07-04 09:35:49 -0400 |
commit | 05cc70ebdced6dc2c6dd9ca51633460cf9a09366 (patch) | |
tree | 207f033721aa294316367f115d9fb218065c7b34 | |
parent | cc382df5edb112aeb53702f4e6ac231b10f75aee (diff) | |
download | org.eclipse.koneki.simulators-05cc70ebdced6dc2c6dd9ca51633460cf9a09366.zip org.eclipse.koneki.simulators-05cc70ebdced6dc2c6dd9ca51633460cf9a09366.tar.gz org.eclipse.koneki.simulators-05cc70ebdced6dc2c6dd9ca51633460cf9a09366.tar.xz |
Fix bug during opening the editor
-rw-r--r-- | omadm/bundles/org.eclipse.koneki.simulators.omadm.editor/src/org/eclipse/koneki/simulators/omadm/editor/internal/configuration/ConfigurationPage.java | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/omadm/bundles/org.eclipse.koneki.simulators.omadm.editor/src/org/eclipse/koneki/simulators/omadm/editor/internal/configuration/ConfigurationPage.java b/omadm/bundles/org.eclipse.koneki.simulators.omadm.editor/src/org/eclipse/koneki/simulators/omadm/editor/internal/configuration/ConfigurationPage.java index d304795..3728d69 100644 --- a/omadm/bundles/org.eclipse.koneki.simulators.omadm.editor/src/org/eclipse/koneki/simulators/omadm/editor/internal/configuration/ConfigurationPage.java +++ b/omadm/bundles/org.eclipse.koneki.simulators.omadm.editor/src/org/eclipse/koneki/simulators/omadm/editor/internal/configuration/ConfigurationPage.java @@ -72,10 +72,15 @@ public class ConfigurationPage extends AbstractEmfFormPage { public Object convert(Object value) { Device device = editor.getOMADMSimulation().getDevice(); AuthenticationType auth = AuthenticationType.get(value.toString()); - device.setAuthentication(auth); + + if (auth != device.getAuthentication()) { + device.setAuthentication(auth); + } Node authPref = NodeHelpers.findFirstNode(NodeHelpers.getNode(device.getTree(), "./DMAcc"), "AuthPref"); - authPref.setData(auth.getName()); + if (!authPref.getData().equals(auth.getName())) { + authPref.setData(auth.getName()); + } return auth; } @@ -87,10 +92,16 @@ public class ConfigurationPage extends AbstractEmfFormPage { public Object convert(Object value) { Device device = editor.getOMADMSimulation().getDevice(); - AuthenticationType auth = device.getAuthentication(); - authenticationType.setSelection(new StructuredSelection(auth)); + AuthenticationType deviceAuth = device.getAuthentication(); + + AuthenticationType newAuth = AuthenticationType.get(value.toString()); + + if (deviceAuth.getValue() != newAuth.getValue()) { + authenticationType.setSelection(new StructuredSelection(newAuth)); + } + + return newAuth; - return auth; } }; @@ -167,7 +178,8 @@ public class ConfigurationPage extends AbstractEmfFormPage { authenticationType = toolkit.createTitleLabelAndComboViewer(serverSettingsComposite, Messages.ConfigurationPage_AuthenticationType, SWT.DEFAULT); authenticationType.add(AuthenticationType.values()); - authenticationType.setSelection(new StructuredSelection(AuthenticationType.NONE)); + + authenticationType.setSelection(new StructuredSelection(editor.getOMADMSimulation().getDevice().getAuthentication())); GridDataFactory.fillDefaults().grab(false, false).span(0, 0).applyTo(authenticationType.getControl()); // The association button |