diff options
author | Marc Khouzam | 2017-01-25 18:54:44 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2017-02-03 20:47:26 +0000 |
commit | 0f2acb0221efbe6ab71321c7fe1d9faa5d0a3a31 (patch) | |
tree | eac6ab3ce14aa932b96b3c26c4a0640b5fa6194a /dsf/org.eclipse.cdt.dsf.ui/src/org | |
parent | 90ad016967e39bfa50269f40ac5927eade927b7b (diff) | |
download | org.eclipse.cdt-0f2acb0221efbe6ab71321c7fe1d9faa5d0a3a31.tar.gz org.eclipse.cdt-0f2acb0221efbe6ab71321c7fe1d9faa5d0a3a31.tar.xz org.eclipse.cdt-0f2acb0221efbe6ab71321c7fe1d9faa5d0a3a31.zip |
Bug 511057 - Number format breaks if debug starts with view pinned
Change-Id: I340cf916e46d92f44ae7f3c51e1e53f619bb7795
Diffstat (limited to 'dsf/org.eclipse.cdt.dsf.ui/src/org')
-rw-r--r-- | dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/ElementNumberFormatProvider.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/ElementNumberFormatProvider.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/ElementNumberFormatProvider.java index 437f544d85e..8dde00921ee 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/ElementNumberFormatProvider.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/ElementNumberFormatProvider.java @@ -43,6 +43,7 @@ import org.eclipse.core.runtime.Status; import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; import org.eclipse.jface.viewers.TreePath; import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.IWorkbenchPart2; import org.osgi.framework.Filter; import org.osgi.framework.InvalidSyntaxException; @@ -78,8 +79,15 @@ public class ElementNumberFormatProvider implements IElementFormatProvider // Note that although each view, including cloned ones, has its own presentation context, // the presentation context id returned by getPresentationContext().getId() is the // same for cloned views even though the presentation context itself is different. - // To get a unique id for each cloned view we can use the title of the view. - provider = part.getTitle(); + // So we cannot use getPresentationContext().getId() as an unique id. + // Using the title of the view is also problematic as that title can + // be modified by a pin action (bug 511057) + // To get a fixed unique id for each cloned view we can use the name of the part + if (part instanceof IWorkbenchPart2) { + provider = ((IWorkbenchPart2)part).getPartName(); + } else { + provider = part.getTitle(); + } } else { // In some cases, we are not dealing with a part, e.g., the hover. // In this case, use the presentation context id directly. |