lttng: Add snapshot support - LTTng Tools v2.3
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ui / src / org / eclipse / linuxtools / internal / lttng2 / ui / views / control / dialogs / CreateSessionDialog.java
index f6c1845f322be3a11a310c85e40045fcbe23a83b..c92a92da7d1f1236136a84bb1a3cd34a969a3c74 100644 (file)
@@ -111,6 +111,10 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
      * The text widget for the session path.
      */
     private Text fSessionPathText = null;
+    /**
+     * The button widget to select a snapshot session
+     */
+    private Button fSnapshotButton = null;
     /**
      * The Group for stream configuration.
      */
@@ -183,6 +187,10 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
      * The  session path string.
      */
     private String fSessionPath = null;
+    /**
+     * The  session path string.
+     */
+    private boolean fIsSnapshot = false;
     /**
      * Flag whether default location (path) shall be used or not
      */
@@ -248,6 +256,7 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
        fStreamingComposite = null;
        fSessionName = null;
        fSessionPath = null;
+       fIsSnapshot = false;
        fIsDefaultPath = true;
        fIsStreamedTrace = false;
        fNetworkUrl = null;
@@ -271,7 +280,10 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
     public String getDataUrl() {
         return fDataUrl;
     }
-
+    @Override
+    public boolean isSnapshot() {
+        return fIsSnapshot;
+    }
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
@@ -318,6 +330,15 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
         fSessionPathText = new Text(sessionGroup, SWT.NONE);
         fSessionPathText.setToolTipText(Messages.TraceControl_CreateSessionPathTooltip);
 
+        if (fParent.isSnapshotSupported()) {
+            fSnapshotButton = new Button(sessionGroup, SWT.CHECK);
+            fSnapshotButton.setText(Messages.TraceControl_CreateSessionSnapshotLabel);
+            fSnapshotButton.setToolTipText(Messages.TraceControl_CreateSessionSnapshotTooltip);
+            GridData data = new GridData(GridData.FILL_HORIZONTAL);
+            data.horizontalSpan = 4;
+            fSnapshotButton.setData(data);
+        }
+
         // layout widgets
         GridData data = new GridData(GridData.FILL_HORIZONTAL);
         data.horizontalSpan = 3;
@@ -636,6 +657,10 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
             fIsDefaultPath = false;
         }
 
+        if(fParent.isSnapshotSupported()) {
+            fIsSnapshot = fSnapshotButton.getSelection();
+        }
+
         fNetworkUrl = null;
         fControlUrl = null;
         fDataUrl = null;
This page took 0.025314 seconds and 5 git commands to generate.