diff options
author | Dean Roberts | 2011-09-20 15:54:13 +0000 |
---|---|---|
committer | Remy Suen | 2011-09-20 15:54:13 +0000 |
commit | 3f4f91b76e12039dfc898b47f51ff70dd62437cb (patch) | |
tree | 82032f769766baed6b5ae87442795acf1b976ba4 | |
parent | 0b7cafe4c5a1c8686bb9d4492bbd70c2016939d4 (diff) | |
download | eclipse.platform.ui-3f4f91b76e12039dfc898b47f51ff70dd62437cb.tar.gz eclipse.platform.ui-3f4f91b76e12039dfc898b47f51ff70dd62437cb.tar.xz eclipse.platform.ui-3f4f91b76e12039dfc898b47f51ff70dd62437cb.zip |
Bug 339130 Unable to save perspective
2 files changed, 8 insertions, 9 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java index dc1b3a3f142..d6e876be69e 100644 --- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java +++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java @@ -253,9 +253,11 @@ public class ModelServiceImpl implements EModelService { MUIElement clone = (MUIElement) EcoreUtil.copy(eObj); if (snippetContainer != null) { + MUIElement snippet = findSnippet(snippetContainer, element.getElementId()); + if (snippet != null) + snippetContainer.getSnippets().remove(snippet); snippetContainer.getSnippets().add(clone); } - return clone; } diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java index fa3e3d53bda..4a35f4ec167 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2011 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 @@ -118,13 +118,10 @@ public class PerspectiveRegistry implements IPerspectiveRegistry, IExtensionChan } private MUIElement removeSnippet(MSnippetContainer snippetContainer, String id) { - List<MUIElement> snippets = snippetContainer.getSnippets(); - for (int i = 0; i < snippets.size(); i++) { - if (snippets.get(i).getElementId().equals(id)) { - return snippets.remove(i); - } - } - return null; + MUIElement snippet = modelService.findSnippet(snippetContainer, id); + if (snippet != null) + snippetContainer.getSnippets().remove(snippet); + return snippet; } /** |