Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/SDWidget.java6
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/ScrollView.java10
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/loader/TmfUml2SDSyncLoader.java149
3 files changed, 92 insertions, 73 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/SDWidget.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/SDWidget.java
index 208fd8eb06..5c6c9e17cf 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/SDWidget.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/SDWidget.java
@@ -1850,7 +1850,11 @@ public class SDWidget extends ScrollView implements SelectionListener,
@Override
public void run() {
- Display.getDefault().asyncExec(new Runnable() {
+ Display display = Display.getDefault();
+ if ((display == null) || (display.isDisposed())) {
+ return;
+ }
+ display.asyncExec(new Runnable() {
@Override
public void run() {
if (fSdWidget.isDisposed()) {
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/ScrollView.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/ScrollView.java
index 7ba6a39540..4922da75af 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/ScrollView.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/ScrollView.java
@@ -868,10 +868,16 @@ public class ScrollView extends Composite {
@Override
public void run() {
- Display.getDefault().asyncExec(new Runnable() {
+ final Display display = Display.getDefault();
+ if ((display == null) || display.isDisposed()) {
+ return;
+ }
+ display.asyncExec(new Runnable() {
@Override
public void run() {
- scrollView.scrollBy(deltaX, deltaY);
+ if (!scrollView.isDisposed()) {
+ scrollView.scrollBy(deltaX, deltaY);
+ }
}
});
}
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/loader/TmfUml2SDSyncLoader.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/loader/TmfUml2SDSyncLoader.java
index a4f24a557c..442b8058f3 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/loader/TmfUml2SDSyncLoader.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/loader/TmfUml2SDSyncLoader.java
@@ -304,39 +304,69 @@ public class TmfUml2SDSyncLoader extends TmfComponent implements IUml2SDLoader,
fLock.lock();
try {
- final Job job = new IndexingJob("Indexing " + getName() + "..."); //$NON-NLS-1$ //$NON-NLS-2$
- job.setUser(false);
- job.schedule();
+ final Job job = new IndexingJob("Indexing " + getName() + "..."); //$NON-NLS-1$ //$NON-NLS-2$
+ job.setUser(false);
+ job.schedule();
- indexRequest = fIndexRequest;
+ indexRequest = fIndexRequest;
- cancelOngoingRequests();
+ cancelOngoingRequests();
- TmfTimeRange window = TmfTimeRange.ETERNITY;
+ TmfTimeRange window = TmfTimeRange.ETERNITY;
- fIndexRequest = new TmfEventRequest(ITmfEvent.class, window, TmfDataRequest.ALL_DATA, DEFAULT_BLOCK_SIZE, ITmfDataRequest.ExecutionType.BACKGROUND) {
+ fIndexRequest = new TmfEventRequest(ITmfEvent.class, window, TmfDataRequest.ALL_DATA, DEFAULT_BLOCK_SIZE, ITmfDataRequest.ExecutionType.BACKGROUND) {
- private ITmfTimestamp fFirstTime = null;
- private ITmfTimestamp fLastTime = null;
- private int fNbSeqEvents = 0;
- private final List<ITmfSyncSequenceDiagramEvent> fSdEvents = new ArrayList<ITmfSyncSequenceDiagramEvent>(MAX_NUM_OF_MSG);
+ private ITmfTimestamp fFirstTime = null;
+ private ITmfTimestamp fLastTime = null;
+ private int fNbSeqEvents = 0;
+ private final List<ITmfSyncSequenceDiagramEvent> fSdEvents = new ArrayList<ITmfSyncSequenceDiagramEvent>(MAX_NUM_OF_MSG);
- @Override
- public void handleData(ITmfEvent event) {
- super.handleData(event);
+ @Override
+ public void handleData(ITmfEvent event) {
+ super.handleData(event);
- ITmfSyncSequenceDiagramEvent sdEvent = getSequenceDiagramEvent(event);
+ ITmfSyncSequenceDiagramEvent sdEvent = getSequenceDiagramEvent(event);
- if (sdEvent != null) {
- ++fNbSeqEvents;
+ if (sdEvent != null) {
+ ++fNbSeqEvents;
+
+ if (fFirstTime == null) {
+ fFirstTime = event.getTimestamp();
+ }
+
+ fLastTime = event.getTimestamp();
+
+ if ((fNbSeqEvents % MAX_NUM_OF_MSG) == 0) {
+ fLock.lock();
+ try {
+ fCheckPoints.add(new TmfTimeRange(fFirstTime, fLastTime));
+ if (fView != null) {
+ fView.updateCoolBar();
+ }
+ } finally {
+ fLock.unlock();
+ }
+ fFirstTime = null;
+
+ }
- if (fFirstTime == null) {
- fFirstTime = event.getTimestamp();
+ if (fNbSeqEvents > MAX_NUM_OF_MSG) {
+ // page is full
+ return;
+ }
+
+ fSdEvents.add(sdEvent);
+
+ if (fNbSeqEvents == MAX_NUM_OF_MSG) {
+ fillCurrentPage(fSdEvents);
+ }
}
+ }
- fLastTime = event.getTimestamp();
+ @Override
+ public void handleSuccess() {
+ if ((fFirstTime != null) && (fLastTime != null)) {
- if ((fNbSeqEvents % MAX_NUM_OF_MSG) == 0) {
fLock.lock();
try {
fCheckPoints.add(new TmfTimeRange(fFirstTime, fLastTime));
@@ -346,65 +376,44 @@ public class TmfUml2SDSyncLoader extends TmfComponent implements IUml2SDLoader,
} finally {
fLock.unlock();
}
- fFirstTime = null;
-
- }
-
- if (fNbSeqEvents > MAX_NUM_OF_MSG) {
- // page is full
- return;
}
- fSdEvents.add(sdEvent);
-
- if (fNbSeqEvents == MAX_NUM_OF_MSG) {
+ if (fNbSeqEvents <= MAX_NUM_OF_MSG) {
fillCurrentPage(fSdEvents);
}
- }
- }
- @Override
- public void handleSuccess() {
- if ((fFirstTime != null) && (fLastTime != null)) {
+ super.handleSuccess();
+ }
- fLock.lock();
- try {
- fCheckPoints.add(new TmfTimeRange(fFirstTime, fLastTime));
- if (fView != null) {
- fView.updateCoolBar();
+ @Override
+ public void handleCompleted() {
+ if (fEvents.isEmpty()) {
+ fFrame = new Frame();
+ // make sure that view is not null when setting frame
+ SDView sdView;
+ fLock.lock();
+ try {
+ sdView = fView;
+ } finally {
+ fLock.unlock();
+ }
+ if (sdView != null) {
+ sdView.setFrameSync(fFrame);
}
- } finally {
- fLock.unlock();
}
+ super.handleCompleted();
+ job.cancel();
}
+ };
- if (fNbSeqEvents <= MAX_NUM_OF_MSG) {
- fillCurrentPage(fSdEvents);
- }
-
- super.handleSuccess();
- }
-
- @Override
- public void handleCompleted() {
- if (fEvents.isEmpty()) {
- fFrame = new Frame();
- fView.setFrameSync(fFrame);
- }
- super.handleCompleted();
- job.cancel();
- }
- };
-
- } finally {
- fLock.unlock();
- }
- if (indexRequest != null && !indexRequest.isCompleted()) {
- indexRequest.cancel();
- }
- resetLoader();
- fTrace.sendRequest(fIndexRequest);
-
+ } finally {
+ fLock.unlock();
+ }
+ if (indexRequest != null && !indexRequest.isCompleted()) {
+ indexRequest.cancel();
+ }
+ resetLoader();
+ fTrace.sendRequest(fIndexRequest);
}
/**

Back to the top