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
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);
}