Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Khouzam2017-01-25 13:54:44 -0500
committerMarc Khouzam2017-02-14 11:35:10 -0500
commit5b09d85d7671621ba77a13afe0b0d6c144cc8af7 (patch)
treea262db84017519517c34e6f26e82c715b3c0d336
parent45a4c5e568ee3f36c076c5212bf0082d6c900de3 (diff)
downloadorg.eclipse.cdt-5b09d85d7671621ba77a13afe0b0d6c144cc8af7.tar.gz
org.eclipse.cdt-5b09d85d7671621ba77a13afe0b0d6c144cc8af7.tar.xz
org.eclipse.cdt-5b09d85d7671621ba77a13afe0b0d6c144cc8af7.zip
Bug 511057 - Number format breaks if debug starts with view pinned
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/ElementNumberFormatProvider.java12
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 437f544d85..8dde00921e 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.

Back to the top