diff options
author | Sarika Sinha | 2017-05-16 09:18:51 +0000 |
---|---|---|
committer | Sarika Sinha | 2017-05-16 10:58:15 +0000 |
commit | 6482547f32daf3eeb76c95b8a80914e0666fe8f4 (patch) | |
tree | ee31241f3ae29b72e17c88a6a4971306c68bbfb5 | |
parent | b0b6f7be5f0e7fba59f637c573de628ce7965da6 (diff) | |
download | eclipse.jdt.debug-6482547f32daf3eeb76c95b8a80914e0666fe8f4.tar.gz eclipse.jdt.debug-6482547f32daf3eeb76c95b8a80914e0666fe8f4.tar.xz eclipse.jdt.debug-6482547f32daf3eeb76c95b8a80914e0666fe8f4.zip |
Bug 516374 - [variables] Hide "Logical Structure" overlay when logicalS4_7_0_RC1I20170522-2000I20170522-0800I20170521-2000I20170521-0800I20170520-1500I20170518-1030I20170518-0830I20170518-0500I20170517-2000I20170517-0800I20170516-2000
structures are disabled
Change-Id: Ibea62493959f260e7aecb65ba0523f435156e3dd
-rw-r--r-- | org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIModelPresentation.java | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIModelPresentation.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIModelPresentation.java index 71350fff1..57501614b 100644 --- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIModelPresentation.java +++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIModelPresentation.java @@ -36,6 +36,7 @@ import org.eclipse.debug.core.sourcelookup.containers.LocalFileStorage; import org.eclipse.debug.core.sourcelookup.containers.ZipEntryStorage; import org.eclipse.debug.internal.ui.DebugUIPlugin; import org.eclipse.debug.internal.ui.DefaultLabelProvider; +import org.eclipse.debug.internal.ui.views.variables.VariablesView; import org.eclipse.debug.ui.DebugUITools; import org.eclipse.debug.ui.IDebugModelPresentation; import org.eclipse.debug.ui.IDebugModelPresentationExtension; @@ -97,6 +98,8 @@ import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; import org.eclipse.ui.IEditorDescriptor; import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PartInitException; import org.eclipse.ui.PlatformUI; @@ -1146,9 +1149,25 @@ public class JDIModelPresentation extends LabelProvider implements IDebugModelPr try { IValue value= ((IVariable) element).getValue(); ILogicalStructureType[] types = DebugPlugin.getLogicalStructureTypes(value); - if (types.length > 0) { - return flags |= JDIImageDescriptor.LOGICAL_STRUCTURE; + if (types.length == 0) { + return flags; // no logical structure is defined for the value type } + ILogicalStructureType enabledType = DebugPlugin.getDefaultStructureType(types); + if (enabledType == null) { + return flags; // no logical structure is enabled for this type + } + IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); + for (IWorkbenchWindow window : windows) { + IWorkbenchPage page = window.getActivePage(); + IViewPart viewPart = page.findView(IDebugUIConstants.ID_VARIABLE_VIEW); + if (viewPart instanceof VariablesView) { + if (((VariablesView) viewPart).isShowLogicalStructure()) { + // a logical structure is enabled for this type and global toggle to show logical structure is on + return flags |= JDIImageDescriptor.LOGICAL_STRUCTURE; + } + return flags; + } + } }catch (DebugException e) { DebugUIPlugin.log(e.getStatus()); } |