diff options
author | Sarika Sinha | 2016-11-29 09:26:34 +0000 |
---|---|---|
committer | Sarika Sinha | 2016-12-01 10:05:51 +0000 |
commit | 20e7f1bfc2337343856efea1b092bd951d71b8ea (patch) | |
tree | 7f0b416a5861480de1ad91878b78875ae6c78614 /org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views | |
parent | 97be8772a897b47a48b2d4b6ef33b46811408b7f (diff) | |
download | eclipse.platform.debug-20e7f1bfc2337343856efea1b092bd951d71b8ea.tar.gz eclipse.platform.debug-20e7f1bfc2337343856efea1b092bd951d71b8ea.tar.xz eclipse.platform.debug-20e7f1bfc2337343856efea1b092bd951d71b8ea.zip |
Bug 498426 - Breakpoints view: Allow to sort by breakpoints creationY20161201-1000I20161201-2000I20161201-0800
time
Change-Id: I1a8b30f4d174fcb6538a827e78ebff95e70088f1
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views')
4 files changed, 25 insertions, 10 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java index b6cfeb3c2..565ff4855 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java @@ -20,7 +20,6 @@ import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.Platform; - import org.eclipse.debug.core.model.IBreakpoint; import org.eclipse.debug.internal.ui.breakpoints.provisional.IBreakpointContainer; import org.eclipse.debug.internal.ui.breakpoints.provisional.IBreakpointOrganizer; @@ -30,7 +29,6 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta; import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate; import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta; - import org.eclipse.debug.ui.IDebugUIConstants; /** @@ -293,7 +291,7 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap childDelta = rootDelta.addNode(container, fChildContainers.indexOf(container), IModelDelta.INSERTED|IModelDelta.INSTALL, -1); } else { - childDelta = rootDelta.addNode(container, fChildContainers.indexOf(container), IModelDelta.STATE, -1); + childDelta = rootDelta.addNode(container, fChildContainers.indexOf(container), IModelDelta.STATE, -1); } container.addBreakpoint(breakpoint, childDelta); @@ -362,7 +360,7 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap public static void copyOrganizers(BreakpointContainer destContainer, BreakpointContainer sourceContainer) { destContainer.fNesting = sourceContainer.fNesting; destContainer.fOrganizer = sourceContainer.fOrganizer; - destContainer.fCategory = sourceContainer.fCategory; + destContainer.fCategory = sourceContainer.fCategory; } /** diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java index e29b2aaef..368ae3243 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java @@ -505,6 +505,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager // update the presentation context organizer viewer.getPresentationContext().setProperty(IBreakpointUIConstants.PROP_BREAKPOINTS_ORGANIZERS, fOrganizers); } + System.out.println(); } /** diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ElementComparator.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ElementComparator.java index ab81f41b1..8537258b4 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ElementComparator.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ElementComparator.java @@ -1,5 +1,5 @@ /***************************************************************** - * Copyright (c) 2009, 2013 Texas Instruments and others + * Copyright (c) 2009, 2016 Texas Instruments and others * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -21,6 +21,7 @@ import org.eclipse.debug.core.model.IBreakpoint; import org.eclipse.debug.core.model.ILineBreakpoint; import org.eclipse.debug.internal.core.IInternalDebugCoreConstants; import org.eclipse.debug.internal.ui.DebugUIPlugin; +import org.eclipse.debug.internal.ui.IInternalDebugUIConstants; import org.eclipse.debug.internal.ui.breakpoints.provisional.IBreakpointContainer; import org.eclipse.debug.internal.ui.breakpoints.provisional.OtherBreakpointCategory; import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; @@ -97,14 +98,31 @@ public class ElementComparator implements Comparator<Object> { * @return */ private int doCompare(IBreakpoint b1, IBreakpoint b2) { + int sortingOrder = DebugUIPlugin.getDefault().getPreferenceStore().getInt(IInternalDebugUIConstants.PREF_BREAKPOINT_SORTING_ORDER); + IMarker marker1 = b1.getMarker(); + IMarker marker2 = b2.getMarker(); + if (sortingOrder == IInternalDebugUIConstants.BREAKPOINT_SORTING_ORDER_CREATION_TIME) { + // The most relevant/ new ones to be shown on top + try { + long b1CreationTime = marker1.getCreationTime(); + long b2CreationTime = marker2.getCreationTime(); + if (b1CreationTime > b2CreationTime) { + return -1; + } else if (b1CreationTime < b2CreationTime) { + return 1; + } + } catch (CoreException e) { + e.printStackTrace(); + } + + } String text1 = IInternalDebugCoreConstants.EMPTY_STRING; String text2 = IInternalDebugCoreConstants.EMPTY_STRING; text1 += b1.getModelIdentifier(); text2 += b2.getModelIdentifier(); - IMarker marker1 = b1.getMarker(); - IMarker marker2 = b2.getMarker(); + try { if (marker1.exists() && marker2.exists()) { text1 += SPACE + marker1.getType(); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java index d0158505c..928c937be 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java @@ -14,7 +14,6 @@ package org.eclipse.debug.internal.ui.views.launch; import org.eclipse.core.runtime.IAdapterFactory; - import org.eclipse.debug.core.IExpressionManager; import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.ILaunchManager; @@ -86,7 +85,6 @@ import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousLabelAdapt import org.eclipse.debug.internal.ui.viewers.update.DefaultModelProxyFactory; import org.eclipse.debug.internal.ui.viewers.update.DefaultModelSelectionPolicyFactory; import org.eclipse.debug.internal.ui.views.memory.renderings.MemorySegment; - import org.eclipse.debug.ui.sourcelookup.ISourceDisplay; /** @@ -128,7 +126,7 @@ public class DebugElementAdapterFactory implements IAdapterFactory { private static IElementContentProvider fgCPMemoryRetrieval = new MemoryRetrievalContentProvider(); private static IElementContentProvider fgCPMemoryBlock = new MemoryBlockContentProvider(); private static IElementContentProvider fgCPBreakpointManager = new BreakpointManagerContentProvider(); - private static IElementContentProvider fgCPBreakpoint = new BreakpointContentProvider(); + private static IElementContentProvider fgCPBreakpoint = new BreakpointContentProvider(); private static IElementMementoProvider fgMPFrame = new StackFrameMementoProvider(); private static IElementMementoProvider fgMPVariable = new VariableMementoProvider(); |