DESCRIPTION

lttng: Sort the entries in the Resources View

Make the ResourcesEntry Comparable, so that the view can specify
how they should be sorted when entries are added to the list.

This also works for entries that are being added while the trace
is being read ("live" reading).

Change-Id: I5a99652b5b755ea9f2e76e32167ad0d15b76a320
Signed-off-by: Braxton Mccarthy xxx@xxx.xxx


COMMENTS

author: Braxton Mccarthy
date: 2014-05-22 15:18:46.000000000

Uploaded patch set 2.

-------------------------------------
author: Brenden Conley
date: 2014-05-22 15:18:52.000000000

Patch Set 2:

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/7076/

-------------------------------------
author: Brenden Conley
date: 2014-05-22 15:21:17.000000000

Patch Set 2: Verified-1

Build Failed 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/7076/ : FAILURE

-------------------------------------
author: Luciana Barry
date: 2014-05-22 18:01:06.000000000

Patch Set 2:

(2 comments)

Line:25, lttng/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesEntry.java -> Would it be preferable to implement Comparable<ResourcesEntry>?

Line:163, lttng/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesEntry.java -> I don't think there's any benefit of doing this check over letting it throw a ClassCastException?

-------------------------------------
author: Braxton Mccarthy
date: 2014-05-22 18:36:26.000000000

Patch Set 2:

(3 comments)

Line:170, lttng/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesEntry.java -> (answer to comment on other patchset)

We don't use this.setParent(), we call it on another object. So we don't have access to the protected method. I'd have thought otherwise too, but apparently not...

Line:25, lttng/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesEntry.java -> Short-term would be a bit more succinct. But if we plan to make ITimeGraphEntry Comparable<ITimeGraphEntry> in the future, this makes the transition easier ;)

Line:163, lttng/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesEntry.java -> It specifies a bit more what the expected behavior is. If we get a class cast exception, it doesn't tell us if the problem is that we don't support TimeGraphEntry and we should, or that somebody sends a TimeGraphEntry to this method and shouldn't.

This should be temporary anyway, once TimeGraphEntry is Comparable, the .compareTo below will work directly.

-------------------------------------
author: Braxton Mccarthy
date: 2014-05-23 21:57:02.000000000

Patch Set 3: Patch Set 2 was rebased

-------------------------------------
