DESCRIPTION

tmf: Support folders in tracing projects

- Modify TmfTraceFolder to allow child TmfTraceFolder

- Create TmfTracesFolder sub-class for the unique traces folder

- Add ITmfTrace.initTrace() signature to support trace name

- Use element path for trace name

- Add New Folder command that applies to all trace folders

- Support Rename and Delete command on trace folders

- Update Rename Trace and Delete Trace commands to support traces under
trace folders

- Move Rename Trace workspace handling from dialog to handler class

- Update Select Traces command and its dialog to support traces under
trace folders

- Update Events editor initialization to support traces under trace
folders

- Update editor link helper to support traces under trace folders

- Refactor getProject() method on project model elements

- Update navigator label provider to show element path for traces under
experiments

- Create TmfViewerSorter to prioritize folders over traces and traces
over analyses

- Change Select Supplementary Files dialog to show element path

- Change supplementary folder handling to support traces under trace
folders and to create folders only if necessary

Change-Id: I3b68bb389b5e0b0bf894eb34affada98b117fb31
Signed-off-by: Luciana Barry xxx@xxx.xxx


COMMENTS

author: Kaeden Tapia
date: 2014-04-28 19:56:30.000000000

Uploaded patch set 4.

-------------------------------------
author: Brenden Conley
date: 2014-04-28 19:56:36.000000000

Patch Set 4:

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

-------------------------------------
author: Brenden Conley
date: 2014-04-28 20:48:51.000000000

Patch Set 4: Verified+1

Build Successful 

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

-------------------------------------
author: Kaeden Tapia
date: 2014-04-29 21:47:41.000000000

Patch Set 4: Code-Review-1

(23 comments)

Line:141, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/RenameFolderDialog.java -> findMember can be used instead of both

Line:37, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/DeleteFolderHandler.java -> those tags are not valid in java 8 javadoc, they should be strong and em

Line:65, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/DeleteFolderHandler.java -> getActiveWorkbenchWindow() was already called above and stored in a local

Line:70, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/DeleteFolderHandler.java -> HandlerUtil.getCurrentSelection instead of going through the active part. I've actually seen a cool platform bug recently that changed the active part right before the command was executed. https://bugs.eclipse.org/bugs/show_bug.cgi?id=432751

Line:88, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/DeleteFolderHandler.java -> This is a costly operation, it should have a progress monitor. Could we use a WorkspaceModifyOperation here?

Line:124, lttng/org.eclipse.linuxtools.tmf.ui/plugin.properties -> This needs the "..." because it opens a dialog.

Line:126, lttng/org.eclipse.linuxtools.tmf.ui/plugin.properties -> Needs a longer description, like "Creates a new trace folder"

Line:135, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/NewFolderDialog.java -> findMember can be used so that both folder and file are checked at the same time.

Line:171, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/NewFolderDialog.java -> scheduling rule?

Line:40, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/RenameFolderHandler.java -> Wrong tags for java 8

Line:85, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/RenameFolderHandler.java -> We should revisit all WorkspaceModifyOperation in a subsequent patch. They should use a scheduling rule when possible to avoid locking the whole workspace.

Line:102, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/RenameFolderHandler.java -> pass monitor?

Line:181, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfExperimentElement.java -> It should be possible to use IResource.accept(IResourceProxyVisitor) here instead of doing this recursively on real resources.

Line:114, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceFolder.java -> We should call isDirectoryTrace here, as seen in Meredith Scott patch. Or else a CTF trace shows as a Trace folder when using the legacy Import, etc.

Line:43, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/RenameTraceHandler.java -> invalid javadoc 8 tags.

Line:45, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/RenameTraceHandler.java -> remove me please?

Line:103, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/RenameTraceHandler.java -> this line can be moved inside the if

Line:112, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/RenameTraceHandler.java -> pass monitor?

Line:114, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/RenameTraceHandler.java -> pass monitor?

Line:252, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfProjectModelElement.java -> I think this should pass a progress monitor

Line:29, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/NewFolderHandler.java -> wrong tags for java 8

Line:53, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/NewFolderHandler.java -> HandlerUtil?

Line:143, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/RenameTraceDialog.java -> findMember can be used instead of both

-------------------------------------
author: Luciana Barry
date: 2014-04-30 14:52:28.000000000

Patch Set 4:

(21 comments)

Line:141, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/RenameFolderDialog.java -> Done

Line:37, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/DeleteFolderHandler.java -> Done

Line:65, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/DeleteFolderHandler.java -> Done

Line:70, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/DeleteFolderHandler.java -> Done

Line:88, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/DeleteFolderHandler.java -> Done

Line:124, lttng/org.eclipse.linuxtools.tmf.ui/plugin.properties -> Done

Line:126, lttng/org.eclipse.linuxtools.tmf.ui/plugin.properties -> Done, but I have no idea where these descriptions actually appear?

Line:135, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/NewFolderDialog.java -> Done

Line:40, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/RenameFolderHandler.java -> Done

Line:102, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/RenameFolderHandler.java -> Done

Line:181, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfExperimentElement.java -> Done

Line:114, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceFolder.java -> I'm hesitant to handle this problem here, as I wouldn't want to execute validate() for possibly multiple trace types in this refresh method. When it is really just a folder, the validation would be redone every time.

Line:43, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/RenameTraceHandler.java -> Done

Line:45, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/RenameTraceHandler.java -> Done

Line:103, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/RenameTraceHandler.java -> Done

Line:112, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/RenameTraceHandler.java -> Done

Line:114, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/RenameTraceHandler.java -> Done

Line:252, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfProjectModelElement.java -> Perhaps. However it's called from many places that don't have access to an existing monitor, and all the other supplementary folder methods here do not handle receiving monitors either. I suggest to tackle this in a separate patch.

Line:29, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/NewFolderHandler.java -> Done

Line:53, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/NewFolderHandler.java -> Done

Line:143, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/RenameTraceDialog.java -> Done

-------------------------------------
author: Kaeden Tapia
date: 2014-04-30 18:59:50.000000000

Patch Set 4:

(4 comments)

Line:126, lttng/org.eclipse.linuxtools.tmf.ui/plugin.properties -> In the preferences and in Quick access, among others.

Line:181, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfExperimentElement.java -> can you use IResourceProxyVisitor instead and request the resource only when inside the isLinked?

Line:114, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceFolder.java -> Can you take a look at https://git.eclipse.org/r/#/c/25514/

It should be fairly fast because there is no metadata file. But of course, if there are other trace types that are directories, this could be a problem.

As it is now without Bend patch, the legacy import doesn't work for me when I import a ctf trace, it ends up as a trace folder.

Line:252, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfProjectModelElement.java -> OK

-------------------------------------
author: Luciana Barry
date: 2014-04-30 19:50:30.000000000

Patch Set 4:

(2 comments)

Line:181, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfExperimentElement.java -> Done

Line:114, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceFolder.java -> Will be fixed in https://git.eclipse.org/r/#/c/25514/.
Note that it seems to work for me using the legacy import even without this patch, because the TRACETYPE persistent property is set? Perhaps it is unreliable whether the resource changed event executes before or after the persistent property is set?

-------------------------------------
author: Kaeden Tapia
date: 2014-04-30 20:35:27.000000000

Patch Set 4:

(1 comment)

Line:114, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceFolder.java -> "Perhaps it is unreliable whether the resource changed event executes before or after the persistent property is set?"

I added some logging and this is what's happening. I tried the 25514 patch and it fixed the problem for me. I'd like to merge patch 25514 into this patch if you don't mind so that this patch doesn't break things too much on its own (and 25514 is only a few lines anyway). Then I'll rebase and verify again the chain and if all goes well we can submit. Sounds good?

-------------------------------------
author: Luciana Barry
date: 2014-04-30 21:26:12.000000000

Patch Set 4:

(1 comment)

Line:114, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceFolder.java -> Sounds good!

-------------------------------------
author: Gerrit Code Review
date: 2014-05-01 13:10:40.000000000

The change could not be merged due to a path conflict.

Please rebase the change locally and upload the rebased commit for review.

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