Source:
<code>public Object execute(final ExecutionEvent event) throws ExecutionException { ISelection selection = HandlerUtil.getCurrentSelection(event); final Set<TmfTraceElement> traceElements = new HashSet<>(); if (selection instanceof StructuredSelection) { Iterator<Object> iterator = ((StructuredSelection) selection).iterator(); while (iterator.hasNext()) { Object element = iterator.next(); if (element instanceof TmfTraceElement) { TmfTraceElement trace = (TmfTraceElement) element; traceElements.add(trace.getElementUnderTraceFolder()); } else if (element instanceof TmfExperimentElement) { TmfExperimentElement exp = (TmfExperimentElement) element; for (TmfTraceElement trace : exp.getTraces()) { traceElements.add(trace.getElementUnderTraceFolder()); } } else if (element instanceof TmfTraceFolder) { TmfTraceFolder folder = (TmfTraceFolder) element; traceElements.addAll(folder.getTraces()); } } } Map<TmfTraceElement, Long> offsets = new LinkedHashMap<>(traceElements.size()); for (TmfTraceElement trace : traceElements) { offsets.put(trace, 0L); } Shell shell = HandlerUtil.getActiveShellChecked(event); OffsetDialog dialog = new OffsetDialog(shell, offsets); dialog.open(); if (dialog.getReturnCode() != Window.OK) { return null; } <START> for (TmfTraceElement trace : offsets.keySet()) { <END> Long offset = offsets.get(trace); if (offset != 0) { long previousOffset = TimestampTransformFactory.getTimestampTransform(trace.getResource()).transform(0); ITmfTimestampTransform transform = TimestampTransformFactory.createWithOffset(previousOffset + offset); trace.closeEditors(); trace.deleteSupplementaryResources(); trace.refreshSupplementaryFolder(); TimestampTransformFactory.setTimestampTransform(trace.getResource(), transform); trace.refreshSupplementaryFolder(); } } return null; }</code><technical_language>This is in UI thread. a job show busy icon</technical_language>

Target:
public Object execute(final ExecutionEvent event) throws ExecutionException { ISelection selection = HandlerUtil.getCurrentSelection(event); final Set<TmfTraceElement> traceElements = new HashSet<>(); if (selection instanceof StructuredSelection) { Iterator<Object> iterator = ((StructuredSelection) selection).iterator(); while (iterator.hasNext()) { Object element = iterator.next(); if (element instanceof TmfTraceElement) { TmfTraceElement trace = (TmfTraceElement) element; traceElements.add(trace.getElementUnderTraceFolder()); } else if (element instanceof TmfExperimentElement) { TmfExperimentElement exp = (TmfExperimentElement) element; for (TmfTraceElement trace : exp.getTraces()) { traceElements.add(trace.getElementUnderTraceFolder()); } } else if (element instanceof TmfTraceFolder) { TmfTraceFolder folder = (TmfTraceFolder) element; traceElements.addAll(folder.getTraces()); } } } Map<TmfTraceElement, Long> offsets = new LinkedHashMap<>(traceElements.size()); for (TmfTraceElement trace : traceElements) { offsets.put(trace, 0L); } Shell shell = HandlerUtil.getActiveShellChecked(event); OffsetDialog dialog = new OffsetDialog(shell, offsets); dialog.open(); if (dialog.getReturnCode() != Window.OK) { return null; } for (TmfTraceElement trace : offsets.keySet()) { Long offset = offsets.get(trace); if (offset != 0 && trace.getResource().exists()) { long previousOffset = TimestampTransformFactory.getTimestampTransform(trace.getResource()).transform(0); ITmfTimestampTransform transform = TimestampTransformFactory.createWithOffset(previousOffset + offset); trace.closeEditors(); trace.deleteSupplementaryResources(); trace.refreshSupplementaryFolder(); TimestampTransformFactory.setTimestampTransform(trace.getResource(), transform); trace.refreshSupplementaryFolder(); } } return null; }