control: Add enhanced support for loading of sessions
[deliverable/tracecompass.git] / lttng / org.eclipse.tracecompass.lttng2.control.ui / src / org / eclipse / tracecompass / internal / lttng2 / control / ui / views / model / impl / TraceSessionGroup.java
index 425a1d8673e9e0597ee9b56498995925dd1f4159..b3aec7f8eb32ffc99c8126cdc9b22ab505b5e9f3 100644 (file)
@@ -17,6 +17,7 @@ import java.util.List;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.tracecompass.internal.lttng2.control.core.model.ISessionInfo;
 import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.ITraceControlComponent;
 
@@ -141,22 +142,6 @@ public class TraceSessionGroup extends TraceControlComponent {
         }
     }
 
-    /**
-     * Loads a session from a path
-     *
-     * @param sessionPath
-     *
-     * @param monitor
-     *            - a progress monitor
-     * @throws ExecutionException
-     *             If the command fails
-     */
-    public void loadSession(String sessionPath, IProgressMonitor monitor) throws ExecutionException {
-       getControlService().loadSession(sessionPath, monitor);
-
-
-    }
-
     /**
      * Command to execute a list of commands
      * @param monitor
@@ -187,4 +172,22 @@ public class TraceSessionGroup extends TraceControlComponent {
         session.removeAllChildren();
         removeChild(session);
     }
+
+    /**
+     * Load all or a given session.
+     *
+     * @param inputPath
+     *            a input path to load session from or null for load all from default
+     * @param isForce
+     *            flag whether to overwrite existing or not
+     * @param monitor
+     *            a progress monitor
+     * @throws ExecutionException
+     *             If the command fails
+     */
+    public void loadSession(@Nullable String inputPath, boolean isForce, IProgressMonitor monitor)
+            throws ExecutionException {
+        getControlService().loadSession(inputPath, isForce, monitor);
+        getTargetNode().refresh();
+    }
 }
This page took 0.03199 seconds and 5 git commands to generate.