1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 09:16:02 +02:00

Bug 511057 - Number format breaks if debug starts with view pinned

Change-Id: I340cf916e46d92f44ae7f3c51e1e53f619bb7795
This commit is contained in:
Marc Khouzam 2017-01-25 13:54:44 -05:00 committed by Gerrit Code Review @ Eclipse.org
parent 90ad016967
commit 0f2acb0221

View file

@ -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.