First part of LTTng 2.0 support
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.ui / src / org / eclipse / linuxtools / lttng / ui / views / control / model / impl / TraceSessionGroup.java
1 /**********************************************************************
2 * Copyright (c) 2012 Ericsson
3 *
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
8 *
9 * Contributors:
10 * Bernd Hufmann - Initial API and implementation
11 **********************************************************************/
12 package org.eclipse.linuxtools.lttng.ui.views.control.model.impl;
13
14 import org.eclipse.core.commands.ExecutionException;
15 import org.eclipse.core.runtime.IProgressMonitor;
16 import org.eclipse.core.runtime.NullProgressMonitor;
17 import org.eclipse.linuxtools.lttng.ui.views.control.model.ITraceControlComponent;
18
19 /**
20 * <b><u>TraceSessionGroup</u></b>
21 * <p>
22 * Implementation of the trace session group.
23 * </p>
24 */
25 public class TraceSessionGroup extends TraceControlComponent {
26 // ------------------------------------------------------------------------
27 // Constants
28 // ------------------------------------------------------------------------
29 /**
30 * Path to icon file for this component.
31 */
32 public static final String TRACE_SESSIONS_ICON_FILE = "icons/obj16/sessions.gif"; //$NON-NLS-1$
33
34 // ------------------------------------------------------------------------
35 // Attributes
36 // ------------------------------------------------------------------------
37
38 // ------------------------------------------------------------------------
39 // Constructors
40 // ------------------------------------------------------------------------
41 /**
42 * Constructor
43 * @param name - the name of the component.
44 * @param parent - the parent of this component.
45 */
46 public TraceSessionGroup(String name, ITraceControlComponent parent) {
47 super(name, parent);
48 setImage(TRACE_SESSIONS_ICON_FILE);
49 }
50
51 // ------------------------------------------------------------------------
52 // Accessors
53 // ------------------------------------------------------------------------
54
55 // ------------------------------------------------------------------------
56 // Operations
57 // ------------------------------------------------------------------------
58 /**
59 * Retrieves the sessions information from the node.
60 * @throws ExecutionException
61 */
62 public void getSessionsFromNode() throws ExecutionException {
63 getSessionsFromNode(new NullProgressMonitor());
64 }
65
66 /**
67 * Retrieves the sessions information from the node.
68 * @param monitor - a progress monitor
69 * @throws ExecutionException
70 */
71 public void getSessionsFromNode(IProgressMonitor monitor) throws ExecutionException {
72 String[] sessionNames = getControlService().getSessionNames(monitor);
73 for (int i = 0; i < sessionNames.length; i++) {
74 TraceSessionComponent session = new TraceSessionComponent(sessionNames[i], this);
75 addChild(session);
76 session.getConfigurationFromNode(monitor);
77 }
78 }
79 }
This page took 0.032494 seconds and 6 git commands to generate.