From fd257e196b8e3a5c0e97432dd4582802ccd5319c Mon Sep 17 00:00:00 2001 From: David McKnight Date: Wed, 17 Mar 2010 19:19:29 +0000 Subject: [PATCH] [306187] cancel in properties of remote system view doesn't work --- .../ui/widgets/services/RSEModelServiceElement.java | 10 ++++++++-- .../ServerLauncherPropertiesServiceElement.java | 10 +++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/RSEModelServiceElement.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/RSEModelServiceElement.java index 4562ff20b3c..c1e21a11813 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/RSEModelServiceElement.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/RSEModelServiceElement.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2006 IBM Corporation. All rights reserved. + * Copyright (c) 2006, 2010 IBM Corporation. All rights reserved. * This program and the accompanying materials are made available under the terms * of the Eclipse Public License v1.0 which accompanies this distribution, and is * available at http://www.eclipse.org/legal/epl-v10.html @@ -11,7 +11,7 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * David McKnight (IBM) - [306187] cancel in properties of remote system view doesn't work ********************************************************************************/ package org.eclipse.rse.ui.widgets.services; @@ -124,13 +124,19 @@ public abstract class RSEModelServiceElement extends ServiceElement public void revert() { PropertySetServiceElement[] sets = getPropertySets(); + IPropertySet[] origSets = new IPropertySet[sets.length]; for (int i = 0; i < sets.length; i++) { IPropertySet newSet = sets[i].getPropertySet(); IPropertySet originalSet = sets[i].getOriginalProperySet(); + origSets[i] = originalSet; + _modelObject.removePropertySet(newSet.getName()); _modelObject.addPropertySet(originalSet); } + _propertySetElements = null; + _propertySets = origSets; + getPropertySets(); } public void refreshProperties() diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServerLauncherPropertiesServiceElement.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServerLauncherPropertiesServiceElement.java index c91653d7e89..584ec1de5d8 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServerLauncherPropertiesServiceElement.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/services/ServerLauncherPropertiesServiceElement.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2007 IBM Corporation and others. + * Copyright (c) 2006, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -12,7 +12,7 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * David McKnight (IBM) - [306187] cancel in properties of remote system view doesn't work *******************************************************************************/ package org.eclipse.rse.ui.widgets.services; @@ -82,7 +82,11 @@ public class ServerLauncherPropertiesServiceElement extends RSEModelServiceEleme public void revert() { - super.revert(); + super.revert(); + + _launcherProperties = _launcherProperties.getConnectorService().getRemoteServerLauncherProperties(); + _launcherProperties.restoreFromProperties(); + _launcherProperties.commit(); } public IServerLauncherProperties getServerLauncherProperties()