tmf: Remove source and reference from ITmfEvent
[deliverable/tracecompass.git] / org.eclipse.tracecompass.lttng2.control.ui / src / org / eclipse / tracecompass / internal / lttng2 / control / ui / views / dialogs / CreateSessionDialog.java
CommitLineData
bbb3538a 1/**********************************************************************
81d5dc3a 2 * Copyright (c) 2012, 2014 Ericsson
f3b33d40 3 *
bbb3538a
BH
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
f3b33d40
BH
8 *
9 * Contributors:
bbb3538a 10 * Bernd Hufmann - Initial API and implementation
ba3a9bd2 11 * Bernd Hufmann - Updated for support of LTTng Tools 2.1
81d5dc3a 12 * Marc-Andre Laperle - Support for creating a live session
bbb3538a 13 **********************************************************************/
8e8c0226 14
9bc60be7 15package org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs;
bbb3538a
BH
16
17import org.eclipse.core.runtime.NullProgressMonitor;
bbb3538a 18import org.eclipse.jface.dialogs.IDialogConstants;
abb1f9a7 19import org.eclipse.jface.dialogs.TitleAreaDialog;
bbb3538a
BH
20import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
21import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem;
22import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
23import org.eclipse.swt.SWT;
f3b33d40 24import org.eclipse.swt.custom.CCombo;
81d5dc3a
MAL
25import org.eclipse.swt.events.FocusEvent;
26import org.eclipse.swt.events.FocusListener;
a30e79fe
BH
27import org.eclipse.swt.events.ModifyEvent;
28import org.eclipse.swt.events.ModifyListener;
f3b33d40
BH
29import org.eclipse.swt.events.SelectionAdapter;
30import org.eclipse.swt.events.SelectionEvent;
81d5dc3a
MAL
31import org.eclipse.swt.events.VerifyEvent;
32import org.eclipse.swt.events.VerifyListener;
bbb3538a
BH
33import org.eclipse.swt.layout.GridData;
34import org.eclipse.swt.layout.GridLayout;
f3b33d40 35import org.eclipse.swt.widgets.Button;
bbb3538a
BH
36import org.eclipse.swt.widgets.Composite;
37import org.eclipse.swt.widgets.Control;
f3b33d40 38import org.eclipse.swt.widgets.Group;
bbb3538a
BH
39import org.eclipse.swt.widgets.Label;
40import org.eclipse.swt.widgets.Shell;
41import org.eclipse.swt.widgets.Text;
9bc60be7
AM
42import org.eclipse.tracecompass.internal.lttng2.control.core.model.ISessionInfo;
43import org.eclipse.tracecompass.internal.lttng2.control.core.model.impl.SessionInfo;
44import org.eclipse.tracecompass.internal.lttng2.control.ui.Activator;
45import org.eclipse.tracecompass.internal.lttng2.control.ui.views.messages.Messages;
46import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent;
47import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionGroup;
48import org.eclipse.tracecompass.internal.lttng2.control.ui.views.remote.IRemoteSystemProxy;
49import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.LTTngControlServiceConstants;
bbb3538a
BH
50
51/**
bbb3538a
BH
52 * <p>
53 * Dialog box for collecting session creation information.
54 * </p>
f3b33d40 55 *
dbd4432d 56 * @author Bernd Hufmann
bbb3538a 57 */
abb1f9a7 58public class CreateSessionDialog extends TitleAreaDialog implements ICreateSessionDialog {
bbb3538a
BH
59
60 // ------------------------------------------------------------------------
61 // Constants
62 // ------------------------------------------------------------------------
63 /**
64 * The icon file for this dialog box.
65 */
f3b33d40
BH
66 public static final String CREATE_SESSION_ICON_FILE = "icons/elcl16/add_button.gif"; //$NON-NLS-1$
67
81d5dc3a
MAL
68 /**
69 * To indicate that the default value will be used for this field
70 */
71 private static final String DEFAULT_TEXT = "<" + Messages.EnableChannelDialog_DefaultMessage + ">"; //$NON-NLS-1$ //$NON-NLS-2$
72
f3b33d40
BH
73 /**
74 * Supported network protocols for streaming
75 */
76 private enum StreamingProtocol {
77 /** Default network protocol for IPv4 (TCP)*/
78 net,
79 /** Default network protocol for IPv6 (TCP)*/
80 net6,
81 /** File */
82 file,
83 }
84
81d5dc3a
MAL
85 /**
86 * Supported network protocols for Live tracing
87 */
88 private enum LiveProtocol {
89 /** Default network protocol for IPv4 (TCP)*/
90 net,
91 /** Default network protocol for IPv6 (TCP)*/
92 net6
93 }
94
f3b33d40
BH
95 private enum StreamingProtocol2 {
96 /** Default network protocol for IPv4 (TCP)*/
97 net,
98 /** Default network protocol for IPv6 (TCP)*/
99 net6,
100 /** TCP network protocol for IPv4*/
101 tcp,
102 /** TCP network protocol for IPv6*/
103 tcp6 }
104
105 /**
106 * Index of last supported streaming protocol for common URL configuration.
107 */
77735e82 108 private static final int COMMON_URL_LAST_INDEX = 1;
f3b33d40
BH
109 /**
110 * Index of default streaming protocol.
111 */
77735e82 112 private static final int DEFAULT_URL_INDEX = 0;
bbb3538a
BH
113
114 // ------------------------------------------------------------------------
115 // Attributes
116 // ------------------------------------------------------------------------
117 /**
118 * The dialog composite.
119 */
120 private Composite fDialogComposite = null;
121 /**
122 * The text widget for the session name
123 */
124 private Text fSessionNameText = null;
a30e79fe
BH
125 /**
126 * The label widget for the session path.
127 */
128 private Label fSessionPathLabel = null;
bbb3538a 129 /**
f3b33d40 130 * The text widget for the session path.
bbb3538a
BH
131 */
132 private Text fSessionPathText = null;
81d5dc3a
MAL
133 /**
134 * The button widget to select a normal session
135 */
136 private Button fNormalModeButton = null;
589d0d33
BH
137 /**
138 * The button widget to select a snapshot session
139 */
140 private Button fSnapshotButton = null;
f3b33d40 141 /**
81d5dc3a
MAL
142 * The group that contains the mutually exclusive mode buttons
143 */
144 private Group fModeButtonGroup = null;
145 /**
146 * The button widget to select a live session
f3b33d40 147 */
81d5dc3a
MAL
148 private Button fLiveButton = null;
149
150 /**
151 * The text widget to set a live delay
152 */
153 private Text fLiveDelayText = null;
f3b33d40 154 /**
81d5dc3a 155 * The Group for advanced configuration.
f3b33d40 156 */
81d5dc3a
MAL
157 private Group fAdvancedGroup = null;
158 /**
159 * The button to show advanced options.
160 */
161 private Button fAdvancedButton = null;
f3b33d40
BH
162 /**
163 * The composite with streaming configuration parameter.
164 */
165 private Composite fStreamingComposite = null;
a30e79fe
BH
166 /**
167 * The text widget for the trace path.
168 */
169 private Text fTracePathText = null;
f3b33d40
BH
170 /**
171 * The button to link data protocol/Address with control protocol.
172 */
173 private Button fLinkDataWithControlButton = null;
174 /**
175 * The Combo box for channel protocol selection.
176 */
177 private CCombo fControlProtocolCombo = null;
178 /**
179 * A selection listener that copies the protocol from control to data when being linked.
180 */
181 private ControlProtocolSelectionListener fCopyProtocolSelectionListener;
a30e79fe
BH
182 /**
183 * A selection listener updates the control port text depending on the control protocol selected.
184 */
f3b33d40 185 private ProtocolComboSelectionListener fControlProtocolSelectionListener;
a30e79fe
BH
186 /**
187 * A selection listener updates the data port text depending on the data protocol selected.
188 */
f3b33d40 189 private ProtocolComboSelectionListener fDataProtocolSelectionListener;
f3b33d40
BH
190 /**
191 * The text box for the host/IP address of the control channel.
192 */
193 private Text fControlHostAddressText = null;
194 /**
195 * A key listener that copies the host address from control to data when being linked.
196 */
a30e79fe 197 private CopyModifyListener fControlUrlKeyListener;
abb1f9a7
MAL
198 /**
199 * A modify listener that updates the enablement of the dialog.
200 */
201 private UpdateEnablementModifyListener fUpdateEnablementModifyListener;
f3b33d40
BH
202 /**
203 * The text box for the control port.
204 */
205 private Text fControlPortText = null;
206 /**
207 * The Combo box for data protocol selection.
208 */
209 private CCombo fDataProtocolCombo = null;
210 /**
211 * The text box for the host/IP address of the data channel.
212 */
213 private Text fDataHostAddressText = null;
214 /**
215 * The text box for the data port.
216 */
217 private Text fDataPortText = null;
bbb3538a
BH
218 /**
219 * The parent where the new node should be added.
220 */
c56972bb 221 private TraceSessionGroup fParent = null;
bbb3538a
BH
222 /**
223 * The session name string.
224 */
aa254866 225 private String fSessionName = ""; //$NON-NLS-1$;
bbb3538a
BH
226 /**
227 * The session path string.
228 */
229 private String fSessionPath = null;
589d0d33 230 /**
abb1f9a7 231 * Flag whether the session is snapshot or not
589d0d33
BH
232 */
233 private boolean fIsSnapshot = false;
81d5dc3a
MAL
234 /**
235 * Flag whether the session is live or not
236 */
237 private boolean fIsLive = false;
6fd3c6e9
MAL
238 /**
239 * The text box for the live address (relayd).
240 */
241 private Text fLiveHostAddressText = null;
242 /**
243 * The text box for the live port (relayd).
244 */
245 private Text fLivePortText = null;
81d5dc3a
MAL
246 /**
247 * The live delay
248 */
249 private Integer fLiveDelay = 0;
6fd3c6e9
MAL
250 /**
251 * The live url.
252 */
253 private String fLiveUrl = null;
254 /**
255 * The live port.
256 */
257 private Integer fLivePort = 0;
bbb3538a
BH
258 /**
259 * Flag whether default location (path) shall be used or not
260 */
261 private boolean fIsDefaultPath = true;
f3b33d40 262 /**
81d5dc3a 263 * Flag whether the advanced options are enabled or not
f3b33d40 264 */
81d5dc3a 265 private boolean fIsAdvancedEnabled = false;
f3b33d40
BH
266 /**
267 * The network URL in case control and data is configured together.
268 * If set, fControlUrl and fDataUrl will be null.
269 */
270 private String fNetworkUrl = null;
271 /**
272 * The control URL in case control and data is configured separately.
273 * If set, fDataUrl will be set too and fNetworkUrl will be null.
274 */
275 private String fControlUrl = null;
276 /**
277 * The data URL in case control and data is configured separately.
278 * If set, fControlUrl will be set too and fNetworkUrl will be null.
279 */
280 private String fDataUrl = null;
281 /**
a30e79fe 282 * The trace path string.
f3b33d40 283 */
a30e79fe 284 private String fTracePath = null;
81d5dc3a
MAL
285 /**
286 * The Group for advanced configuration of Live mode.
287 */
288 private Group fLiveGroup = null;
bbb3538a
BH
289
290 // ------------------------------------------------------------------------
291 // Constructors
292 // ------------------------------------------------------------------------
293 /**
294 * Constructor
295 * @param shell - a shell for the display of the dialog
bbb3538a 296 */
d132bcc7 297 public CreateSessionDialog(Shell shell) {
bbb3538a 298 super(shell);
8a396998 299 setShellStyle(SWT.RESIZE | getShellStyle());
bbb3538a
BH
300 }
301
302 // ------------------------------------------------------------------------
303 // Accessors
304 // ------------------------------------------------------------------------
11252342 305
d132bcc7 306 @Override
f3b33d40
BH
307 public void initialize(TraceSessionGroup group) {
308 fParent = group;
309 fStreamingComposite = null;
81d5dc3a
MAL
310 fLiveGroup = null;
311 fLiveButton = null;
312 fIsLive = false;
313 fSnapshotButton = null;
aa254866 314 fSessionName = ""; //$NON-NLS-1$
f3b33d40 315 fSessionPath = null;
589d0d33 316 fIsSnapshot = false;
f3b33d40 317 fIsDefaultPath = true;
81d5dc3a 318 fIsAdvancedEnabled = false;
f3b33d40
BH
319 fNetworkUrl = null;
320 fControlUrl = null;
321 fDataUrl = null;
f3b33d40 322 }
bbb3538a
BH
323 // ------------------------------------------------------------------------
324 // Operations
325 // ------------------------------------------------------------------------
f3b33d40 326
bbb3538a
BH
327 @Override
328 protected void configureShell(Shell newShell) {
329 super.configureShell(newShell);
330 newShell.setText(Messages.TraceControl_CreateSessionDialogTitle);
31a6a4e4 331 newShell.setImage(Activator.getDefault().loadIcon(CREATE_SESSION_ICON_FILE));
bbb3538a
BH
332 }
333
bbb3538a
BH
334 @Override
335 protected Control createDialogArea(Composite parent) {
abb1f9a7
MAL
336 Composite dialogAreaa = (Composite) super.createDialogArea(parent);
337 setTitle(Messages.TraceControl_CreateSessionDialogTitle);
338 setMessage(Messages.TraceControl_CreateSessionDialogMessage);
f3b33d40 339
bbb3538a 340 // Main dialog panel
abb1f9a7 341 fDialogComposite = new Composite(dialogAreaa, SWT.NONE);
f3b33d40 342 GridLayout layout = new GridLayout(1, true);
5f1f22f8
BH
343 fDialogComposite.setLayout(layout);
344 fDialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
bbb3538a 345
f3b33d40
BH
346 Group sessionGroup = new Group(fDialogComposite, SWT.SHADOW_NONE);
347 sessionGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
348 sessionGroup.setLayout(new GridLayout(4, true));
349
abb1f9a7
MAL
350 fUpdateEnablementModifyListener = new UpdateEnablementModifyListener();
351
f3b33d40 352 Label sessionNameLabel = new Label(sessionGroup, SWT.RIGHT);
bbb3538a 353 sessionNameLabel.setText(Messages.TraceControl_CreateSessionNameLabel);
f3b33d40 354 fSessionNameText = new Text(sessionGroup, SWT.NONE);
bbb3538a 355 fSessionNameText.setToolTipText(Messages.TraceControl_CreateSessionNameTooltip);
abb1f9a7 356 fSessionNameText.addModifyListener(fUpdateEnablementModifyListener);
81d5dc3a
MAL
357 GridData data = new GridData(GridData.FILL_HORIZONTAL);
358 data.horizontalSpan = 3;
359 fSessionNameText.setLayoutData(data);
f3b33d40 360
a30e79fe
BH
361 fSessionPathLabel = new Label(sessionGroup, SWT.RIGHT);
362 fSessionPathLabel.setText(Messages.TraceControl_CreateSessionPathLabel);
f3b33d40 363 fSessionPathText = new Text(sessionGroup, SWT.NONE);
bbb3538a 364 fSessionPathText.setToolTipText(Messages.TraceControl_CreateSessionPathTooltip);
81d5dc3a
MAL
365 data = new GridData(GridData.FILL_HORIZONTAL);
366 data.horizontalSpan = 3;
367 fSessionPathText.setLayoutData(data);
abb1f9a7 368 fSessionPathText.addModifyListener(fUpdateEnablementModifyListener);
bbb3538a 369
81d5dc3a
MAL
370 if (fParent.isSnapshotSupported() || fParent.isLiveSupported()) {
371 fModeButtonGroup = new Group(sessionGroup, SWT.NONE);
372 data = new GridData(GridData.FILL_HORIZONTAL);
589d0d33 373 data.horizontalSpan = 4;
81d5dc3a
MAL
374 fModeButtonGroup.setLayoutData(data);
375 fModeButtonGroup.setLayout(new GridLayout(3, true));
376
377 SelectionAdapter modeChangedListener = new SelectionAdapter() {
56254dd4
BH
378 @Override
379 public void widgetSelected(SelectionEvent e) {
81d5dc3a
MAL
380 if (fLiveButton != null) {
381 if (fLiveButton.getSelection()) {
382 createAdvancedLiveGroup();
383 updateSessionPathEnablement();
384 updateProtocolComboItems();
385 } else {
386 disposeLiveGroup();
387 updateSessionPathEnablement();
388 updateProtocolComboItems();
389 }
390 }
56254dd4
BH
391 updateEnablement();
392 }
81d5dc3a
MAL
393 };
394
395 fNormalModeButton = new Button(fModeButtonGroup, SWT.RADIO);
396 fNormalModeButton.setText(Messages.TraceControl_CreateSessionNormalLabel);
397 fNormalModeButton.setToolTipText(Messages.TraceControl_CreateSessionNormalTooltip);
398 fNormalModeButton.setSelection(true);
399 fNormalModeButton.addSelectionListener(modeChangedListener);
400
401 if (fParent.isSnapshotSupported()) {
402 fSnapshotButton = new Button(fModeButtonGroup, SWT.RADIO);
403 fSnapshotButton.setText(Messages.TraceControl_CreateSessionSnapshotLabel);
404 fSnapshotButton.setToolTipText(Messages.TraceControl_CreateSessionSnapshotTooltip);
405 fSnapshotButton.addSelectionListener(modeChangedListener);
406 }
f3b33d40 407
81d5dc3a
MAL
408 if (fParent.isLiveSupported()) {
409 fLiveButton = new Button(fModeButtonGroup, SWT.RADIO);
410 fLiveButton.setText(Messages.TraceControl_CreateSessionLiveLabel);
411 fLiveButton.setToolTipText(Messages.TraceControl_CreateSessionLiveTooltip);
412 fLiveButton.addSelectionListener(modeChangedListener);
413 }
414 }
bbb3538a 415
81d5dc3a 416 if (fParent.isNetworkStreamingSupported() || fParent.isLiveSupported()) {
f3b33d40
BH
417 createAdvancedOptionsComposite();
418 }
419
bbb3538a
BH
420 return fDialogComposite;
421 }
422
f3b33d40
BH
423 private void createAdvancedOptionsComposite() {
424
81d5dc3a
MAL
425 fAdvancedGroup = new Group(fDialogComposite, SWT.SHADOW_NONE);
426 fAdvancedGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
427 fAdvancedGroup.setLayout(new GridLayout(1, true));
f3b33d40 428
81d5dc3a
MAL
429 fAdvancedButton = new Button(fAdvancedGroup, SWT.PUSH);
430 fAdvancedButton.setText(Messages.TraceControl_CreateSessionConfigureStreamingButtonText + " >>>"); //$NON-NLS-1$
431 fAdvancedButton.setToolTipText(Messages.TraceControl_CreateSessionConfigureStreamingButtonTooltip);
432 fAdvancedButton.addSelectionListener(new SelectionAdapter() {
f3b33d40
BH
433 @Override
434 public void widgetSelected(SelectionEvent e) {
81d5dc3a
MAL
435 if (fIsAdvancedEnabled) {
436 fIsAdvancedEnabled = false;
437 fAdvancedButton.setText(">>> " + Messages.TraceControl_CreateSessionConfigureStreamingButtonText); //$NON-NLS-1$
438 fAdvancedButton.setToolTipText(Messages.TraceControl_CreateSessionConfigureStreamingButtonTooltip);
439
440 if (fParent.isNetworkStreamingSupported()) {
441 updateSessionPathEnablement();
442 disposeConfigureStreamingComposite();
443 }
444
445 if (fParent.isLiveSupported()) {
446 disposeLiveGroup();
447 }
f3b33d40 448 } else {
81d5dc3a
MAL
449 fIsAdvancedEnabled = true;
450 fAdvancedButton.setText("<<< " + Messages.TraceControl_CreateSessionNoStreamingButtonText); //$NON-NLS-1$
451 fAdvancedButton.setToolTipText(Messages.TraceControl_CreateSessionNoStreamingButtonTooltip);
452
453 if (fParent.isNetworkStreamingSupported()) {
454 updateSessionPathEnablement();
455 createConfigureStreamingComposite();
456 }
457 if (fLiveButton != null && fLiveButton.getSelection()) {
458 createAdvancedLiveGroup();
459 }
f3b33d40
BH
460 }
461
abb1f9a7
MAL
462 updateEnablement();
463 getShell().pack();
f3b33d40
BH
464 }
465 });
466 }
467
81d5dc3a
MAL
468 private void updateSessionPathEnablement() {
469 if (fIsAdvancedEnabled || fIsLive) {
470 fSessionPathText.setEnabled(false);
471 fSessionPathText.setText(""); //$NON-NLS-1$
472 fSessionPathLabel.setText(""); //$NON-NLS-1$
473 } else {
474 fSessionPathText.setEnabled(true);
475 fSessionPathLabel.setText(Messages.TraceControl_CreateSessionPathLabel);
476 }
477 }
478
479 private void updateProtocolComboItems() {
480 if (fControlProtocolCombo == null || fControlProtocolCombo.isDisposed()) {
481 return;
482 }
483
484 int currentSelection = fControlProtocolCombo.getSelectionIndex() <= COMMON_URL_LAST_INDEX ?
485 fControlProtocolCombo.getSelectionIndex() : DEFAULT_URL_INDEX;
486
487 fControlProtocolCombo.removeAll();
488 Enum<? extends Enum<?>>[] values;
489 if (fIsLive) {
490 values = LiveProtocol.values();
491 } else if (fLinkDataWithControlButton.getSelection()) {
492 values = StreamingProtocol.values();
493 } else {
494 values = StreamingProtocol2.values();
495 }
496
497 String[] controlItems = new String[values.length];
498 for (int i = 0; i < controlItems.length; i++) {
499 controlItems[i] = values[i].name();
500 }
501 fControlProtocolCombo.setItems(controlItems);
502 fDataProtocolCombo.setItems(controlItems);
503
504 // Set selection
505 if (currentSelection != -1) {
506 fControlProtocolCombo.select(currentSelection);
507 fDataProtocolCombo.select(currentSelection);
508 }
509 }
510
f3b33d40
BH
511 private void createConfigureStreamingComposite() {
512 if (fStreamingComposite == null) {
81d5dc3a 513 fStreamingComposite = new Group(fAdvancedGroup, SWT.SHADOW_NONE);
f3b33d40
BH
514 GridLayout layout = new GridLayout(1, true);
515 fStreamingComposite.setLayout(layout);
516 fStreamingComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
517
f3b33d40 518 layout = new GridLayout(7, true);
81d5dc3a
MAL
519 fStreamingComposite.setLayout(layout);
520 fStreamingComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
f3b33d40 521
81d5dc3a 522 Label tracePathLabel = new Label(fStreamingComposite, SWT.RIGHT);
a30e79fe 523 tracePathLabel.setText(Messages.TraceControl_CreateSessionTracePathText);
81d5dc3a 524 fTracePathText = new Text(fStreamingComposite, SWT.NONE);
a30e79fe
BH
525 fTracePathText.setToolTipText(Messages.TraceControl_CreateSessionTracePathTooltip);
526
527 // layout widgets
528 GridData data = new GridData(GridData.FILL_HORIZONTAL);
529 data.horizontalSpan = 6;
530 fTracePathText.setLayoutData(data);
abb1f9a7 531 fTracePathText.addModifyListener(fUpdateEnablementModifyListener);
a30e79fe 532
81d5dc3a 533 fLinkDataWithControlButton = new Button(fStreamingComposite, SWT.CHECK);
f3b33d40
BH
534 fLinkDataWithControlButton.setText(Messages.TraceControl_CreateSessionLinkButtonText);
535 fLinkDataWithControlButton.setToolTipText(Messages.TraceControl_CreateSessionLinkButtonTooltip);
a30e79fe 536 data = new GridData(GridData.FILL_HORIZONTAL);
f3b33d40
BH
537 data.horizontalSpan = 7;
538 fLinkDataWithControlButton.setLayoutData(data);
539 fLinkDataWithControlButton.setSelection(true);
540
81d5dc3a 541 Label label = new Label(fStreamingComposite, SWT.NONE);
f3b33d40
BH
542 data = new GridData(GridData.FILL_HORIZONTAL);
543 data.horizontalSpan = 1;
544 label.setLayoutData(data);
545
81d5dc3a 546 label = new Label(fStreamingComposite, SWT.NONE);
f3b33d40
BH
547 label.setText(Messages.TraceControl_CreateSessionProtocolLabelText);
548 data = new GridData(GridData.FILL_HORIZONTAL);
549 data.horizontalSpan = 1;
550 label.setLayoutData(data);
551
81d5dc3a 552 label = new Label(fStreamingComposite, SWT.NONE);
f3b33d40
BH
553 label.setText(Messages.TraceControl_CreateSessionAddressLabelText);
554 data = new GridData(GridData.FILL_HORIZONTAL);
555 data.horizontalSpan = 4;
556 label.setLayoutData(data);
557
81d5dc3a 558 label = new Label(fStreamingComposite, SWT.NONE);
f3b33d40
BH
559 label.setText(Messages.TraceControl_CreateSessionPortLabelText);
560 data = new GridData(GridData.FILL_HORIZONTAL);
561 data.horizontalSpan = 1;
562 label.setLayoutData(data);
563
81d5dc3a 564 label = new Label(fStreamingComposite, SWT.RIGHT);
f3b33d40
BH
565 label.setText(Messages.TraceControl_CreateSessionControlUrlLabel);
566 data = new GridData(GridData.FILL_HORIZONTAL);
567 data.horizontalSpan = 1;
568 label.setLayoutData(data);
569
81d5dc3a 570 fControlProtocolCombo = new CCombo(fStreamingComposite, SWT.READ_ONLY);
f3b33d40
BH
571 fControlProtocolCombo.setToolTipText(Messages.TraceControl_CreateSessionCommonProtocolTooltip);
572 data = new GridData(GridData.FILL_HORIZONTAL);
573 data.horizontalSpan = 1;
574 fControlProtocolCombo.setLayoutData(data);
abb1f9a7 575 fControlProtocolCombo.addModifyListener(fUpdateEnablementModifyListener);
f3b33d40 576
81d5dc3a 577 fControlHostAddressText = new Text(fStreamingComposite, SWT.NONE);
f3b33d40
BH
578 fControlHostAddressText.setToolTipText(Messages.TraceControl_CreateSessionControlAddressTooltip);
579 data = new GridData(GridData.FILL_HORIZONTAL);
580 data.horizontalSpan = 4;
581 fControlHostAddressText.setLayoutData(data);
abb1f9a7 582 fControlHostAddressText.addModifyListener(fUpdateEnablementModifyListener);
f3b33d40 583
81d5dc3a 584 fControlPortText = new Text(fStreamingComposite, SWT.NONE);
f3b33d40
BH
585 fControlPortText.setToolTipText(Messages.TraceControl_CreateSessionControlPortTooltip);
586 data = new GridData(GridData.FILL_HORIZONTAL);
587 data.horizontalSpan = 1;
588 fControlPortText.setLayoutData(data);
abb1f9a7 589 fControlPortText.addModifyListener(fUpdateEnablementModifyListener);
f3b33d40 590
81d5dc3a 591 label = new Label(fStreamingComposite, SWT.RIGHT);
f3b33d40
BH
592 label.setText(Messages.TraceControl_CreateSessionDataUrlLabel);
593 data = new GridData(GridData.FILL_HORIZONTAL);
594 data.horizontalSpan = 1;
595 label.setLayoutData(data);
596
81d5dc3a 597 fDataProtocolCombo = new CCombo(fStreamingComposite, SWT.READ_ONLY);
f3b33d40
BH
598 fDataProtocolCombo.setEnabled(false);
599 fDataProtocolCombo.setToolTipText(Messages.TraceControl_CreateSessionProtocolTooltip);
600 data = new GridData(GridData.FILL_HORIZONTAL);
601 data.horizontalSpan = 1;
602 fDataProtocolCombo.setLayoutData(data);
abb1f9a7 603 fDataProtocolCombo.addModifyListener(fUpdateEnablementModifyListener);
f3b33d40 604
81d5dc3a 605 updateProtocolComboItems();
f3b33d40 606
81d5dc3a 607 fDataHostAddressText = new Text(fStreamingComposite, SWT.NONE);
f3b33d40
BH
608 fDataHostAddressText.setEnabled(false);
609 fDataHostAddressText.setToolTipText(Messages.TraceControl_CreateSessionDataAddressTooltip);
610 data = new GridData(GridData.FILL_HORIZONTAL);
611 data.horizontalSpan = 4;
612 fDataHostAddressText.setLayoutData(data);
abb1f9a7 613 fDataHostAddressText.addModifyListener(fUpdateEnablementModifyListener);
f3b33d40 614
81d5dc3a 615 fDataPortText = new Text(fStreamingComposite, SWT.NONE);
f3b33d40
BH
616 fDataPortText.setEnabled(true);
617 fDataPortText.setToolTipText(Messages.TraceControl_CreateSessionDataPortTooltip);
618 data = new GridData(GridData.FILL_HORIZONTAL);
619 data.horizontalSpan = 1;
620 fDataPortText.setLayoutData(data);
abb1f9a7 621 fDataPortText.addModifyListener(fUpdateEnablementModifyListener);
f3b33d40
BH
622
623 fCopyProtocolSelectionListener = new ControlProtocolSelectionListener();
624 fControlProtocolSelectionListener = new ProtocolComboSelectionListener(fControlProtocolCombo, fControlPortText);
625 fDataProtocolSelectionListener = new ProtocolComboSelectionListener(fDataProtocolCombo, fDataPortText);
626
627 fControlProtocolCombo.addSelectionListener(fCopyProtocolSelectionListener);
628
a30e79fe
BH
629 fControlUrlKeyListener = new CopyModifyListener(fControlHostAddressText, fDataHostAddressText);
630 fControlHostAddressText.addModifyListener(fControlUrlKeyListener);
631
f3b33d40
BH
632 fControlProtocolCombo.select(DEFAULT_URL_INDEX);
633 fDataProtocolCombo.select(DEFAULT_URL_INDEX);
634
635 fLinkDataWithControlButton.addSelectionListener(new SelectionAdapter() {
636 @Override
637 public void widgetSelected(SelectionEvent e) {
638 if (fLinkDataWithControlButton.getSelection()) {
639 // Set enablement control data channel inputs
640 fDataProtocolCombo.setEnabled(false);
641 fDataHostAddressText.setEnabled(false);
642 fControlPortText.setEnabled(true);
643 fDataPortText.setEnabled(true);
644
645 // Update listeners
646 fControlProtocolCombo.removeSelectionListener(fControlProtocolSelectionListener);
647 fDataProtocolCombo.removeSelectionListener(fDataProtocolSelectionListener);
648 fControlProtocolCombo.addSelectionListener(fCopyProtocolSelectionListener);
a30e79fe 649 fControlHostAddressText.addModifyListener(fControlUrlKeyListener);
f3b33d40 650
81d5dc3a 651 updateProtocolComboItems();
f3b33d40 652
f3b33d40
BH
653 fDataHostAddressText.setText(fControlHostAddressText.getText());
654
655 // Update tool tips
656 fControlProtocolCombo.setToolTipText(Messages.TraceControl_CreateSessionCommonProtocolTooltip);
657 } else {
658 // Enable data channel inputs
659 fDataProtocolCombo.setEnabled(true);
660 fDataHostAddressText.setEnabled(true);
661
662 // Update listeners
663 fControlProtocolCombo.removeSelectionListener(fCopyProtocolSelectionListener);
664 fControlProtocolCombo.addSelectionListener(fControlProtocolSelectionListener);
665 fDataProtocolCombo.addSelectionListener(fDataProtocolSelectionListener);
a30e79fe 666 fControlHostAddressText.removeModifyListener(fControlUrlKeyListener);
f3b33d40 667
81d5dc3a 668 updateProtocolComboItems();
f3b33d40
BH
669
670 // Update tool tips
671 fDataProtocolCombo.setToolTipText(Messages.TraceControl_CreateSessionProtocolTooltip);
672 fControlProtocolCombo.setToolTipText(Messages.TraceControl_CreateSessionProtocolTooltip);
673
674 // Update control/data port enablement and input
675 if (fControlProtocolCombo.getItem(fControlProtocolCombo.getSelectionIndex()).equals(StreamingProtocol.net.name()) ||
676 fControlProtocolCombo.getItem(fControlProtocolCombo.getSelectionIndex()).equals(StreamingProtocol.net6.name())) {
677 fControlPortText.setText(""); //$NON-NLS-1$
678 fControlPortText.setEnabled(false);
679 } else {
680 fControlPortText.setEnabled(true);
681 }
682
683 if (fDataProtocolCombo.getItem(fDataProtocolCombo.getSelectionIndex()).equals(StreamingProtocol.net.name()) ||
684 fDataProtocolCombo.getItem(fDataProtocolCombo.getSelectionIndex()).equals(StreamingProtocol.net6.name())) {
685 fDataPortText.setText(""); //$NON-NLS-1$
686 fDataPortText.setEnabled(false);
687 } else {
688 fDataPortText.setEnabled(true);
689 }
690 }
691 }
692 });
693 }
694 }
695
81d5dc3a
MAL
696 private void createAdvancedLiveGroup() {
697 if (fLiveGroup == null && fIsAdvancedEnabled) {
698 GridLayout layout = new GridLayout(7, true);
699 fLiveGroup = new Group(fAdvancedGroup, SWT.NONE);
700 fLiveGroup.setLayout(layout);
701 GridData layoutData = new GridData(GridData.FILL_BOTH);
702 fLiveGroup.setLayoutData(layoutData);
703
6fd3c6e9
MAL
704 Label label = new Label(fLiveGroup, SWT.NONE);
705 label.setText(Messages.TraceControl_CreateSessionLiveConnectionLabel);
706 layoutData = new GridData(GridData.FILL_HORIZONTAL);
707 layoutData.horizontalSpan = 2;
708 label.setLayoutData(layoutData);
709
710 fLiveHostAddressText = new Text(fLiveGroup, SWT.NONE);
92fe6900 711 fLiveHostAddressText.setText(SessionInfo.DEFAULT_LIVE_NETWORK_URL);
6fd3c6e9
MAL
712 fLiveHostAddressText.setEnabled(false);
713 fLiveHostAddressText.setToolTipText(Messages.TraceControl_CreateSessionLiveConnectionUrlTooltip);
714 layoutData = new GridData(GridData.FILL_HORIZONTAL);
715 layoutData.horizontalSpan = 4;
716 fLiveHostAddressText.setLayoutData(layoutData);
717
718 fLivePortText = new Text(fLiveGroup, SWT.NONE);
92fe6900 719 fLivePortText.setText(Integer.toString(SessionInfo.DEFAULT_LIVE_PORT));
6fd3c6e9
MAL
720 fLivePortText.setToolTipText(Messages.TraceControl_CreateSessionLiveConnectionPortTooltip);
721 layoutData = new GridData(GridData.FILL_HORIZONTAL);
722 fLivePortText.setLayoutData(layoutData);
723
724 Label liveDelayLabel = new Label(fLiveGroup, SWT.NONE);
81d5dc3a
MAL
725 layoutData = new GridData(GridData.FILL_HORIZONTAL);
726 liveDelayLabel.setText(Messages.TraceControl_CreateSessionLiveDelayLabel);
727 liveDelayLabel.setLayoutData(layoutData);
728 fLiveDelayText = new Text(fLiveGroup, SWT.NONE);
729 fLiveDelayText.setText(DEFAULT_TEXT);
730 fLiveDelayText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
731 fLiveDelayText.setToolTipText(Messages.TraceControl_CreateSessionLiveDelayTooltip);
732 fLiveDelayText.addVerifyListener(new VerifyListener() {
733 @Override
734 public void verifyText(VerifyEvent e) {
735 // only numbers and default are allowed.
736 e.doit = e.text.matches("[0-9]*") || e.text.matches(DEFAULT_TEXT); //$NON-NLS-1$
737 updateEnablement();
738 }
739 });
740 fLiveDelayText.addModifyListener(new ModifyListener() {
741 @Override
742 public void modifyText(ModifyEvent event) {
743 updateEnablement();
744 }
745 });
746
747 fLiveDelayText.addFocusListener(new FocusListener() {
748
749 @Override
750 public void focusLost(FocusEvent e) {
751 Text focusLostWidget = (Text) e.widget;
752 if (focusLostWidget.getText().isEmpty()) {
753 focusLostWidget.setText(DEFAULT_TEXT);
754 focusLostWidget.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
755 }
756 }
757
758 @Override
759 public void focusGained(FocusEvent e) {
760 Text focusGainedWidget = (Text) e.widget;
761 if (focusGainedWidget.getText().equals(DEFAULT_TEXT)) {
762 focusGainedWidget.setText(""); //$NON-NLS-1$
763 focusGainedWidget.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_BLACK));
764 }
765 }
766 });
767
768 layoutData = new GridData(GridData.FILL_HORIZONTAL);
769 layoutData.grabExcessHorizontalSpace = true;
770 layoutData.horizontalSpan = 6;
771 fLiveDelayText.setLayoutData(layoutData);
772 getShell().pack();
773 }
774 }
775
776 private void disposeLiveGroup() {
777 if (fLiveGroup != null) {
778 fLiveGroup.dispose();
779 fLiveGroup = null;
780 getShell().pack();
781 }
782 }
783
f3b33d40
BH
784 private void disposeConfigureStreamingComposite() {
785 if (fStreamingComposite != null) {
786 fStreamingComposite.dispose();
787 fStreamingComposite = null;
788 }
789 }
790
bbb3538a
BH
791 @Override
792 protected void createButtonsForButtonBar(Composite parent) {
79c3db85 793 createButton(parent, IDialogConstants.CANCEL_ID, "&Cancel", true); //$NON-NLS-1$
bbb3538a
BH
794 createButton(parent, IDialogConstants.OK_ID, "&Ok", true); //$NON-NLS-1$
795 }
796
abb1f9a7
MAL
797 private void updateEnablement() {
798 validate();
799 getButton(IDialogConstants.OK_ID).setEnabled(getErrorMessage() == null);
800 }
801
802 private void validate() {
bbb3538a
BH
803 // Validate input data
804 fSessionName = fSessionNameText.getText();
805 fSessionPath = fSessionPathText.getText();
abb1f9a7 806 setErrorMessage(null);
bbb3538a 807
81d5dc3a
MAL
808 if (fParent.isLiveSupported() && fLiveButton != null) {
809 fIsLive = fLiveButton.getSelection();
810 fLiveDelay = LTTngControlServiceConstants.UNUSED_VALUE;
92fe6900
MAL
811 fLiveUrl = SessionInfo.DEFAULT_LIVE_NETWORK_URL;
812 fLivePort = SessionInfo.DEFAULT_LIVE_PORT;
81d5dc3a
MAL
813 }
814
bbb3538a
BH
815 if (!"".equals(fSessionPath)) { //$NON-NLS-1$
816 // validate sessionPath
81d5dc3a 817 if (!fIsAdvancedEnabled && !fIsLive) {
f3b33d40
BH
818 TargetNodeComponent node = (TargetNodeComponent)fParent.getParent();
819 IRemoteSystemProxy proxy = node.getRemoteSystemProxy();
820 IFileServiceSubSystem fsss = proxy.getFileServiceSubSystem();
821 if (fsss != null) {
822 try {
823 IRemoteFile remoteFolder = fsss.getRemoteFileObject(fSessionPath, new NullProgressMonitor());
b68f311b
BH
824
825 if (remoteFolder == null) {
abb1f9a7 826 setErrorMessage(Messages.TraceControl_InvalidSessionPathError + " (" + fSessionPath + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$
b68f311b
BH
827 return;
828 }
829
f3b33d40 830 if (remoteFolder.exists()) {
abb1f9a7 831 setErrorMessage(Messages.TraceControl_SessionPathAlreadyExistsError + " (" + fSessionPath + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$
f3b33d40
BH
832 return;
833 }
834 } catch (SystemMessageException e) {
abb1f9a7 835 setErrorMessage(Messages.TraceControl_FileSubSystemError + "\n" + e); //$NON-NLS-1$
bbb3538a
BH
836 return;
837 }
f3b33d40 838 }
bbb3538a
BH
839 }
840 fIsDefaultPath = false;
841 }
842
abb1f9a7 843 if (fParent.isSnapshotSupported()) {
589d0d33
BH
844 fIsSnapshot = fSnapshotButton.getSelection();
845 }
846
f3b33d40
BH
847 fNetworkUrl = null;
848 fControlUrl = null;
849 fDataUrl = null;
850
81d5dc3a 851 if (fIsAdvancedEnabled && fStreamingComposite != null) {
a30e79fe 852 // Validate input data
81d5dc3a
MAL
853
854 if (fIsLive && fLiveGroup != null) {
855 String liveDelayText = fLiveDelayText.getText();
856 try {
857 fLiveDelay = liveDelayText.equals(DEFAULT_TEXT) ? LTTngControlServiceConstants.UNUSED_VALUE : Integer.valueOf(liveDelayText);
6fd3c6e9
MAL
858 fLivePort = Integer.valueOf(fLivePortText.getText());
859 fLiveUrl = fLiveHostAddressText.getText();
81d5dc3a
MAL
860 } catch (NumberFormatException e) {
861 setErrorMessage(Messages.TraceControl_InvalidLiveDelayError);
862 return;
863 }
864 }
865
a30e79fe
BH
866 fTracePath = fTracePathText.getText();
867
f3b33d40 868 if (fControlProtocolCombo.getSelectionIndex() < 0) {
abb1f9a7 869 setErrorMessage("Control Protocol Text is empty\n"); //$NON-NLS-1$
f3b33d40
BH
870 return;
871 }
872
873 if ("".equals(fControlHostAddressText.getText())) { //$NON-NLS-1$
abb1f9a7 874 setErrorMessage("Control Address Text is empty\n"); //$NON-NLS-1$
f3b33d40
BH
875 return;
876 }
877
abb1f9a7 878 if (!fLinkDataWithControlButton.getSelection()) {
f3b33d40 879 if (fDataProtocolCombo.getSelectionIndex() < 0) {
abb1f9a7 880 setErrorMessage("Data Protocol Text is empty\n"); //$NON-NLS-1$
f3b33d40
BH
881 return;
882 }
883
884 if ("".equals(fDataHostAddressText.getText())) { //$NON-NLS-1$
abb1f9a7 885 setErrorMessage("Data Address Text is empty\n"); //$NON-NLS-1$
f3b33d40
BH
886 return;
887 }
888
889 fControlUrl = getUrlString(fControlProtocolCombo.getItem(fControlProtocolCombo.getSelectionIndex()),
890 fControlHostAddressText.getText(),
891 fControlPortText.getText(),
892 null,
a30e79fe 893 fTracePath);
f3b33d40 894
abb1f9a7 895 fDataUrl = getUrlString(fDataProtocolCombo.getItem(fDataProtocolCombo.getSelectionIndex()),
f3b33d40
BH
896 fDataHostAddressText.getText(),
897 null,
898 fDataPortText.getText(),
a30e79fe 899 fTracePath);
f3b33d40 900 } else {
abb1f9a7 901 fNetworkUrl = getUrlString(fControlProtocolCombo.getItem(fControlProtocolCombo.getSelectionIndex()),
f3b33d40
BH
902 fControlHostAddressText.getText(),
903 fControlPortText.getText(),
904 fDataPortText.getText(),
a30e79fe 905 fTracePath);
f3b33d40 906 }
bbb3538a
BH
907 }
908
81d5dc3a 909 if (fIsLive && fNetworkUrl == null && fControlUrl == null && fDataUrl == null) {
92fe6900 910 fNetworkUrl = SessionInfo.DEFAULT_LIVE_NETWORK_URL;
81d5dc3a
MAL
911 }
912
bbb3538a 913 // Check for invalid names
f3b33d40 914 if (!"".equals(fSessionName) && !fSessionName.matches("^[a-zA-Z0-9\\-\\_]{1,}$")) { //$NON-NLS-1$ //$NON-NLS-2$
abb1f9a7 915 setErrorMessage(Messages.TraceControl_InvalidSessionNameError + " (" + fSessionName + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$
bbb3538a
BH
916 return;
917 }
918
919 // Check if node with name already exists in parent
920 if(fParent.containsChild(fSessionName)) {
abb1f9a7 921 setErrorMessage(Messages.TraceControl_SessionAlreadyExistsError + " (" + fSessionName + ")"); //$NON-NLS-1$ //$NON-NLS-2$
bbb3538a
BH
922 return;
923 }
bbb3538a 924 }
f3b33d40
BH
925
926 private static String getUrlString(String proto, String host, String ctrlPort, String dataPort, String sessionPath) {
927 //proto://[HOST|IP][:PORT1[:PORT2]][/TRACE_PATH]
928 StringBuilder stringBuilder = new StringBuilder();
929 stringBuilder.append(proto);
930 stringBuilder.append("://"); //$NON-NLS-1$
931 stringBuilder.append(host);
932
933 if ((ctrlPort != null) && (!"".equals(ctrlPort))) { //$NON-NLS-1$
934 stringBuilder.append(":"); //$NON-NLS-1$
935 stringBuilder.append(ctrlPort);
936 }
937
938 if ((dataPort != null) && (!"".equals(dataPort))) { //$NON-NLS-1$
939 stringBuilder.append(":"); //$NON-NLS-1$
940 stringBuilder.append(dataPort);
941 }
942
943 if ((sessionPath != null) && (!"".equals(sessionPath))) { //$NON-NLS-1$
944 stringBuilder.append("/"); //$NON-NLS-1$
945 stringBuilder.append(sessionPath);
946 }
947 return stringBuilder.toString();
948 }
949
a30e79fe 950 private static class CopyModifyListener implements ModifyListener {
f3b33d40
BH
951 private Text fSource;
952 private Text fDestination;
953
a30e79fe 954 public CopyModifyListener(Text source, Text destination) {
f3b33d40
BH
955 fSource = source;
956 fDestination = destination;
957 }
958
959 @Override
a30e79fe 960 public void modifyText(ModifyEvent e) {
f3b33d40
BH
961 fDestination.setText(fSource.getText());
962 }
963 }
964
965 private class ControlProtocolSelectionListener extends SelectionAdapter {
966
967 @Override
968 public void widgetSelected(SelectionEvent e) {
969 fDataProtocolCombo.select(fControlProtocolCombo.getSelectionIndex());
970 if (fControlProtocolCombo.getItem(fControlProtocolCombo.getSelectionIndex()).equals(StreamingProtocol.file.name())) {
971 fControlPortText.setText(""); //$NON-NLS-1$
972 fDataPortText.setText(""); //$NON-NLS-1$
973 fControlPortText.setEnabled(false);
974 fDataPortText.setEnabled(false);
975 } else {
976 fControlPortText.setEnabled(true);
977 fDataPortText.setEnabled(true);
978 }
979 }
980 }
981
982 private class ProtocolComboSelectionListener extends SelectionAdapter {
983
984 private CCombo fCombo;
985 private Text fPortText;
986
987 public ProtocolComboSelectionListener(CCombo combo, Text portText) {
988 fCombo = combo;
989 fPortText = portText;
990 }
991
992 @Override
993 public void widgetSelected(SelectionEvent e) {
994 if (fCombo.getItem(fCombo.getSelectionIndex()).equals(StreamingProtocol.net.name()) ||
995 fCombo.getItem(fCombo.getSelectionIndex()).equals(StreamingProtocol.net6.name())) {
996 fPortText.setText(""); //$NON-NLS-1$
997 fPortText.setEnabled(false);
998 } else {
999 fPortText.setEnabled(true);
1000 }
1001 }
1002 }
1003
f7d4d450
MAL
1004 @Override
1005 public ISessionInfo getParameters() {
1006 ISessionInfo sessionInfo = new SessionInfo(fSessionName);
1007
81d5dc3a
MAL
1008 boolean isStreaming = (fIsAdvancedEnabled && fStreamingComposite != null) || fIsLive;
1009 if (isStreaming) {
f7d4d450
MAL
1010 sessionInfo.setNetworkUrl(fNetworkUrl);
1011 sessionInfo.setControlUrl(fControlUrl);
1012 sessionInfo.setDataUrl(fDataUrl);
1013 sessionInfo.setStreamedTrace(true);
1014 } else if (!fIsDefaultPath) {
1015 sessionInfo.setSessionPath(fSessionPath);
1016 }
1017
81d5dc3a 1018 sessionInfo.setLive(fIsLive);
6fd3c6e9
MAL
1019 sessionInfo.setLiveUrl(fLiveUrl);
1020 sessionInfo.setLivePort(fLivePort);
81d5dc3a 1021 sessionInfo.setLiveDelay(fLiveDelay);
f7d4d450
MAL
1022 sessionInfo.setSnapshot(fIsSnapshot);
1023
1024 return sessionInfo;
1025 }
abb1f9a7
MAL
1026
1027 private final class UpdateEnablementModifyListener implements ModifyListener {
1028 @Override
1029 public void modifyText(ModifyEvent e) {
1030 updateEnablement();
1031 }
1032 }
bbb3538a 1033}
This page took 0.106705 seconds and 5 git commands to generate.