diff options
author | Thanh Liem PHAN | 2017-08-25 13:43:32 +0000 |
---|---|---|
committer | Ansgar Radermacher | 2017-09-03 21:15:29 +0000 |
commit | 57af836c6627bfaeec2336096b0abb22ba72547b (patch) | |
tree | 74e885a28f4a7733f0d89285941928f35cae9bee | |
parent | 51664ecfa6d4ab67269b2a4aff4dbd354507a782 (diff) | |
download | org.eclipse.papyrus-streams/2.0-maintenance.tar.gz org.eclipse.papyrus-streams/2.0-maintenance.tar.xz org.eclipse.papyrus-streams/2.0-maintenance.zip |
Bug 521353: [Test][Diagram] Edit part selection is not restored afterstreams/2.0-maintenance
reloading diagram
https://bugs.eclipse.org/bugs/show_bug.cgi?id=521353
- Call setFofus to initialize the graphical viewer before restoring an
editor part. This ensure the selection of the edit part of current
editor to be restored correctly.
Change-Id: Ibccb7d5ec0f9357880f483e4e7836978c4c27721
Signed-off-by: Thanh Liem PHAN <thanhliem.phan@all4tec.net>
(cherry picked from commit ec4f46fe7a166e5bb0ef71b80210aa61e499bca0)
(cherry picked from commit 6e49019e94036a776c9db4865862c732361ab579)
-rw-r--r-- | plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/editor/reload/DelegatingReloadContext.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/editor/reload/DelegatingReloadContext.java b/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/editor/reload/DelegatingReloadContext.java index 386e1722ff2..4fb24b7cf89 100644 --- a/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/editor/reload/DelegatingReloadContext.java +++ b/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/editor/reload/DelegatingReloadContext.java @@ -1,5 +1,5 @@ -/* - * Copyright (c) 2014 CEA and others. +/***************************************************************************** + * Copyright (c) 2014, 2017 CEA and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -8,12 +8,13 @@ * * Contributors: * Christian W. Damus (CEA) - Initial API and implementation - * - */ + * Thanh Liem PHAN (ALL4TEC) thanhliem.phan@all4tec.net - Bug 521353 + *****************************************************************************/ package org.eclipse.papyrus.infra.ui.editor.reload; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.papyrus.infra.core.utils.AdapterUtils; +import org.eclipse.ui.part.EditorPart; /** @@ -53,6 +54,12 @@ public class DelegatingReloadContext implements IDisposableReloadContext, IAdapt if (delegate != null) { IReloadContextProvider provider = AdapterUtils.adapt(reloadContextProvider, IReloadContextProvider.class, null); if (provider != null) { + // Call setFocus to initialize the graphical viewer before restoring element of the current editor + // This assures that the selected edit part of the current editor is properly initialized + // Please see bug 519107 and 521353 for more details + if (reloadContextProvider instanceof EditorPart) { + ((EditorPart) reloadContextProvider).setFocus(); + } provider.restore(delegate); } } |