DESCRIPTION

tmf: Improve Delete Supplementary Files command

- Make all checkbox elements checked by default in the dialog

- Allow multiple selection as long as at least one of the selected
elements has supplementary files

- Update trace handler to support both traces and experiments, and
delete the experiment handler

- Ensure supplementary files for a particular trace are only shown once
in the list (e.g. same trace selected both under Traces folder and under
experiment, or two experiments selected that contain the same trace)

- Ensure only traces and experiments that have supplementary resources
to delete have their editors closed, and that their project is refreshed
only once.

Change-Id: I91f823c67c15da699c815fdf9daf9cfec5082ec9
Signed-off-by: Luciana Barry xxx@xxx.xxx
Signed-off-by: Braxton Mccarthy xxx@xxx.xxx


COMMENTS

author: Braxton Mccarthy
date: 2014-05-02 22:55:50.000000000

Uploaded patch set 3.

-------------------------------------
author: Braxton Mccarthy
date: 2014-05-02 22:58:22.000000000

Patch Set 3: Verified+1

New proposed version, using a SetMultimap instead, to have to fiddle with one less level of collections, and ensuring there are no duplicate key-value pairs (although one trace should not have the same supplementary file twice already...) I find it slightly more straightforward.

Also added a tweak to sort the entries that get shown in the dialog.

-------------------------------------
author: Braxton Mccarthy
date: 2014-05-02 23:00:53.000000000

Patch Set 3:

(1 comment)

Line:103, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/DeleteTraceSupplementaryFilesHandler.java -> Set<IResource> resourcesToDisplay = new TreeSet<>(getFullPath::toString::compareTo);

can't wait!

-------------------------------------
author: Brenden Conley
date: 2014-05-03 00:43:04.000000000

Patch Set 3:

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

-------------------------------------
author: Brenden Conley
date: 2014-05-03 01:44:57.000000000

Patch Set 3: Verified+1

Build Successful 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/6832/ : SUCCESS

-------------------------------------
author: Luciana Barry
date: 2014-05-05 14:47:50.000000000

Patch Set 3: Code-Review-1

(4 comments)

Line:97, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/DeleteTraceSupplementaryFilesHandler.java -> There shouldn't be any duplicate resources coming from different traces, so the TreeSet is unnecessary?

Line:113, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/DeleteTraceSupplementaryFilesHandler.java -> Why do we need a HashSet here, a list is good enough

Line:115, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/DeleteTraceSupplementaryFilesHandler.java -> what's wrong with retainAll?

Line:124, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/DeleteTraceSupplementaryFilesHandler.java -> oops good catch

-------------------------------------
author: Braxton Mccarthy
date: 2014-05-05 17:04:48.000000000

Patch Set 3: Code-Review-1

(3 comments)

Line:97, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/DeleteTraceSupplementaryFilesHandler.java -> The Set here does two things: it removes duplicates, and it sorts the entries (the comment should be updated in fact).

Right now we cannot have shared resources among traces, but will that always be the case?

Even if it would, putting elements into a list (O(n)) and then Collections.sort()'ing it (O(n log n)) comes back to the same as inserting elements into a sorted set (n * O(log n) = O(n log n)), asymptotically speaking.

Although I'd much prefer if we could use the notation I put in the comment below ;)

Line:113, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/DeleteTraceSupplementaryFilesHandler.java -> .contains() (done below) is faster on a HashSet than on a List (O(1) vs O(n))

Line:115, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/DeleteTraceSupplementaryFilesHandler.java -> I find it more obvious/straighforward this way. But I don't really mind either way, up to you.

Although I would have preferred if Multimap had a .uniqueValues() method, this would have avoided this inner loop completely.

-------------------------------------
author: Kaeden Tapia
date: 2014-05-05 20:20:01.000000000

Patch Set 3: Code-Review-1

(1 comment)

Line:163, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/dialogs/SelectSupplementaryResourcesDialog.java -> Extract this to a common method that will also be used for both Select All and Deselect All's listeners?

-------------------------------------
author: Braxton Mccarthy
date: 2014-05-14 14:02:43.000000000

Patch Set 3:

(1 comment)

Line:103, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/DeleteTraceSupplementaryFilesHandler.java -> that wouldn't work btw, I got too excited...

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