tmf: Avoid unnecessary trace type selection during drag & drop
authorPatrick Tasse <patrick.tasse@gmail.com>
Tue, 25 Mar 2014 17:58:14 +0000 (13:58 -0400)
committerPatrick Tasse <patrick.tasse@gmail.com>
Tue, 1 Apr 2014 13:39:28 +0000 (09:39 -0400)
In some cases of drag & drop the trace type id of the target resource is
already known (set during the copy/link of the source resource, or if
the source is a trace in the same project).

In that case the trace type id should be used for refreshing the trace
type of the target element, instead of selecting the trace type by
validating the trace against all known trace types.

Change-Id: Iffa7b3c90034d7ce23b81e31d7e5632f74de189c
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/23881
Tested-by: Hudson CI
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/DropAdapterAssistant.java

index 25a40cf2250d5f45ba1e4dcde16c88220b42e6b2..ccfb5f64497e58117b02c759588445f1acfd87cc 100644 (file)
@@ -600,7 +600,11 @@ public class DropAdapterAssistant extends CommonDropAdapterAssistant {
 
     private static void setTraceType(IResource traceResource) {
         try {
-            TraceTypeHelper traceTypeHelper = TmfTraceTypeUIUtils.selectTraceType(traceResource.getLocationURI().getPath(), null, null);
+            String traceType = traceResource.getPersistentProperties().get(TmfCommonConstants.TRACETYPE);
+            TraceTypeHelper traceTypeHelper = TmfTraceType.getInstance().getTraceType(traceType);
+            if (traceTypeHelper == null) {
+                traceTypeHelper = TmfTraceTypeUIUtils.selectTraceType(traceResource.getLocationURI().getPath(), null, null);
+            }
             if (traceTypeHelper != null) {
                 TmfTraceTypeUIUtils.setTraceType(traceResource, traceTypeHelper);
             }
This page took 0.027555 seconds and 5 git commands to generate.