summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorBernd Hufmann2012-11-28 15:48:11 (EST)
committer Bernd Hufmann2012-11-29 07:44:34 (EST)
commit28392e827ce7c11cfa27d26e5d8d48b9a1d7ac8d (patch)
tree73198fc5fbb56ac7d3079e55b6f299d20a5415e1
parentcf2667737f384ad72f98b7dc84029c128b3e5646 (diff)
downloadorg.eclipse.linuxtools-28392e827ce7c11cfa27d26e5d8d48b9a1d7ac8d.zip
org.eclipse.linuxtools-28392e827ce7c11cfa27d26e5d8d48b9a1d7ac8d.tar.gz
org.eclipse.linuxtools-28392e827ce7c11cfa27d26e5d8d48b9a1d7ac8d.tar.bz2
Fix SWT widget disposed Exception in Sequence diagram viewrefs/changes/16/8916/3
Additionally: - Fix typo in OpenTraceHandler - Add check for file existence in CTFTrace Change-Id: I88d7da6003c4fc587fb09ad5023ee0c72d61a845 Reviewed-on: https://git.eclipse.org/r/8916 Tested-by: Hudson CI Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im> IP-Clean: Alexandre Montplaisir <alexmonthy@voxpopuli.im> Tested-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im> Tested-by: Bernd Hufmann <bhufmann@gmail.com> IP-Clean: Bernd Hufmann <bhufmann@gmail.com> Reviewed-by: Bernd Hufmann <bhufmann@gmail.com>
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFTrace.java3
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/OpenTraceHandler.java2
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/SDView.java28
3 files changed, 19 insertions, 14 deletions
diff --git a/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFTrace.java b/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFTrace.java
index b6dda75..97973e7 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFTrace.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFTrace.java
@@ -192,6 +192,9 @@ public class CTFTrace implements IDefinitionScope {
this.metadata = new Metadata(this);
/* Set up the internal containers for this trace */
+ if (!this.path.exists()) {
+ throw new CTFReaderException("Trace (" + path.getPath() + ") doesn't exist. Deleted or moved?"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
if (!this.path.isDirectory()) {
throw new CTFReaderException("Path must be a valid directory"); //$NON-NLS-1$
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/OpenTraceHandler.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/OpenTraceHandler.java
index 340f236..11cf23c 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/OpenTraceHandler.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/OpenTraceHandler.java
@@ -168,7 +168,7 @@ public class OpenTraceHandler extends AbstractHandler {
file.setHidden(true);
file.setPersistentProperty(TmfCommonConstants.TRACETYPE, TmfTrace.class.getCanonicalName());
IDE.setDefaultEditor(file, editorId);
- // editor should dispose the experiment on close
+ // editor should dispose the trace on close
} catch (final CoreException e) {
Activator.getDefault().logError("Error opening trace " + traceElement.getName(), e); //$NON-NLS-1$
displayErrorMsg(Messages.OpenTraceHandler_Error + "\n\n" + e.getMessage()); //$NON-NLS-1$
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/SDView.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/SDView.java
index 5c16712..e2ca4c9 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/SDView.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/SDView.java
@@ -56,6 +56,7 @@ import org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.provider.ISDCollapseP
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.provider.ISDExtendedActionBarProvider;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.provider.ISDFilterProvider;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.provider.ISDFindProvider;
+import org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.provider.ISDGraphNodeSupporter;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.provider.ISDPagingProvider;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.provider.ISDPropertiesProvider;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.load.IUml2SDLoader;
@@ -754,7 +755,7 @@ public class SDView extends ViewPart {
* @param resetPosition boolean Flag whether to reset the position or not.
*/
protected void setFrame(Frame frame, boolean resetPosition) {
- if (fSdWidget == null) {
+ if (getSDWidget() == null) {
return;
}
@@ -772,22 +773,22 @@ public class SDView extends ViewPart {
setContentDescription(loader.getTitleString());
}
- if (getSDWidget() != null) {
- getSDWidget().setFrame(frame, resetPosition);
- }
+ getSDWidget().setFrame(frame, resetPosition);
if (fTimeCompressionBar != null) {
fTimeCompressionBar.setFrame(frame);
}
updateCoolBar();
- if (!frame.hasTimeInfo()) {
- Composite parent = fTimeCompressionBar.getParent();
- fTimeCompressionBar.setVisible(false);
- parent.layout(true);
- } else {
- Composite parent = fTimeCompressionBar.getParent();
- fTimeCompressionBar.setVisible(true);
- parent.layout(true);
+ if (fTimeCompressionBar != null) {
+ if (!frame.hasTimeInfo()) {
+ Composite parent = fTimeCompressionBar.getParent();
+ fTimeCompressionBar.setVisible(false);
+ parent.layout(true);
+ } else {
+ Composite parent = fTimeCompressionBar.getParent();
+ fTimeCompressionBar.setVisible(true);
+ parent.layout(true);
+ }
}
IContributionItem shortKeysMenu = getViewSite().getActionBars().getMenuManager().find("org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers");//$NON-NLS-1$
MenuManager shortKeys = (MenuManager) shortKeysMenu;
@@ -838,7 +839,8 @@ public class SDView extends ViewPart {
getSDWidget().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
- if (getSDWidget() == null || getSDWidget().isDisposed()) {
+ if (getSDWidget() == null || getSDWidget().isDisposed() ||
+ ((fTimeCompressionBar != null) && fTimeCompressionBar.isDisposed())) {
return;
}
setFrame(frame);