package org.eclipse.linuxtools.lttng.ui.views.timeframe;
-import org.eclipse.linuxtools.tmf.event.TmfTimeRange;
-import org.eclipse.linuxtools.tmf.event.TmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
+import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
private static final byte NS_SCALING_FACTOR = -9;
// Labels
- private static final String SECONDS_LABEL = "sec";
- private static final String NANOSEC_LABEL = "ns";
+ private static final String SECONDS_LABEL = "sec"; //$NON-NLS-1$
+ private static final String NANOSEC_LABEL = "ns"; //$NON-NLS-1$
// Widgets
private Group group;
private int currentSeconds;
private int currentNanosec;
+ @SuppressWarnings("unused")
private TimeFrameView fOwner;
/**
// Create and position the widgets
seconds = new Spinner(group, SWT.BORDER);
seconds.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
+ @Override
+ public void modifyText(ModifyEvent e) {
currentSeconds = seconds.getSelection();
refreshCurrentTime();
}
nanosec = new Spinner(group, SWT.BORDER);
nanosec.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
+ @Override
+ public void modifyText(ModifyEvent e) {
currentNanosec = nanosec.getSelection();
// Correct for nanosec underflow
if (currentNanosec < 0) {
}
public TmfTimestamp getSpan() {
- TmfTimestamp span = new TmfTimestamp(startTime.getAdjustment(endTime), NS_SCALING_FACTOR, 0);
+ TmfTimestamp span = new TmfTimestamp(startTime.getAdjustment(endTime, NS_SCALING_FACTOR), NS_SCALING_FACTOR, 0);
return span;
}
* Perform the update on the UI thread
*/
public void updateSpinners() {
-
+ // Ignore update if disposed
+ if (seconds.isDisposed()) return;
+
seconds.getDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
if (!seconds.isDisposed() && !nanosec.isDisposed()) {
// If we are on the start second, ensure that [currentNS >= startNS]