tmf: Split the state system in a separate plugin
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / callstack / CallStackPresentationProvider.java
index 14297d08356cbfd8979b0cddf223591be49d458f..d3747bf6ab40a60c25d41837413887f173d555bf 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2013 Ericsson
+ * Copyright (c) 2013, 2014 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
 package org.eclipse.linuxtools.tmf.ui.views.callstack;
 
 import org.eclipse.linuxtools.internal.tmf.ui.Activator;
-import org.eclipse.linuxtools.tmf.core.callstack.CallStackStateProvider;
-import org.eclipse.linuxtools.tmf.core.exceptions.AttributeNotFoundException;
-import org.eclipse.linuxtools.tmf.core.exceptions.StateSystemDisposedException;
-import org.eclipse.linuxtools.tmf.core.exceptions.TimeRangeException;
-import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateSystem;
-import org.eclipse.linuxtools.tmf.core.statevalue.ITmfStateValue;
+import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem;
+import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException;
+import org.eclipse.linuxtools.statesystem.core.exceptions.StateSystemDisposedException;
+import org.eclipse.linuxtools.statesystem.core.exceptions.TimeRangeException;
+import org.eclipse.linuxtools.statesystem.core.statevalue.ITmfStateValue;
 import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.StateItem;
 import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.TimeGraphPresentationProvider;
 import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent;
@@ -60,6 +59,7 @@ public class CallStackPresentationProvider extends TimeGraphPresentationProvider
      *
      * @param view
      *            The callstack view that will contain the time events
+     * @since 3.0
      */
     public CallStackPresentationProvider(CallStackView view) {
         fView = view;
@@ -104,7 +104,10 @@ public class CallStackPresentationProvider extends TimeGraphPresentationProvider
     public String getEventName(ITimeEvent event) {
         if (event instanceof CallStackEvent) {
             CallStackEntry entry = (CallStackEntry) event.getEntry();
-            ITmfStateSystem ss = entry.getTrace().getStateSystems().get(CallStackStateProvider.ID);
+            ITmfStateSystem ss = CallStackView.getCallStackStateSystem(entry.getTrace());
+            if (ss == null) {
+                return null;
+            }
             try {
                 ITmfStateValue value = ss.querySingleState(event.getTime(), entry.getQuark()).getStateValue();
                 if (!value.isNull()) {
@@ -132,7 +135,10 @@ public class CallStackPresentationProvider extends TimeGraphPresentationProvider
             return;
         }
         CallStackEntry entry = (CallStackEntry) event.getEntry();
-        ITmfStateSystem ss = entry.getTrace().getStateSystems().get(CallStackStateProvider.ID);
+        ITmfStateSystem ss = CallStackView.getCallStackStateSystem(entry.getTrace());
+        if (ss == null) {
+            return;
+        }
         try {
             ITmfStateValue value = ss.querySingleState(event.getTime(), entry.getQuark()).getStateValue();
             if (!value.isNull()) {
This page took 0.027591 seconds and 5 git commands to generate.