Update internal packages export in LTTng 2.0 control + update java doc
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ui / src / org / eclipse / linuxtools / internal / lttng2 / ui / views / control / model / impl / TraceProviderGroup.java
CommitLineData
eb1bab5b
BH
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 **********************************************************************/
115b4a01 12package org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl;
eb1bab5b
BH
13
14import java.util.Iterator;
15import java.util.List;
16
17import org.eclipse.core.commands.ExecutionException;
18import org.eclipse.core.runtime.IProgressMonitor;
19import org.eclipse.core.runtime.NullProgressMonitor;
9315aeee
BH
20import org.eclipse.linuxtools.internal.lttng2.core.control.model.IBaseEventInfo;
21import org.eclipse.linuxtools.internal.lttng2.core.control.model.IUstProviderInfo;
22import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
115b4a01 23import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
eb1bab5b
BH
24
25/**
eb1bab5b
BH
26 * <p>
27 * Implementation of the trace provider group.
28 * </p>
dbd4432d
BH
29 *
30 * @author Bernd Hufmann
eb1bab5b
BH
31 */
32public class TraceProviderGroup extends TraceControlComponent {
33 // ------------------------------------------------------------------------
34 // Constants
35 // ------------------------------------------------------------------------
36 /**
37 * Path to icon file for this component.
38 */
39 public static final String TRACE_PROVIDERS_ICON_FILE = "icons/obj16/providers.gif"; //$NON-NLS-1$
40
41 // ------------------------------------------------------------------------
42 // Attributes
43 // ------------------------------------------------------------------------
44
45 // ------------------------------------------------------------------------
46 // Constructors
47 // ------------------------------------------------------------------------
48 /**
49 * Constructor
50 * @param name - the name of the component.
51 * @param parent - the parent of this component.
52 */
53 public TraceProviderGroup(String name, ITraceControlComponent parent) {
54 super(name, parent);
55 setImage(TRACE_PROVIDERS_ICON_FILE);
56 }
57
58 // ------------------------------------------------------------------------
59 // Accessors
60 // ------------------------------------------------------------------------
61
62 // ------------------------------------------------------------------------
63 // Operations
64 // ------------------------------------------------------------------------
65
66 /**
67 * Gets the provider information from the target node.
68 * @throws ExecutionException
69 */
70 public void getProviderFromNode() throws ExecutionException {
71 getProviderFromNode(new NullProgressMonitor());
72 }
73
74 /**
75 * Gets the provider information from the target node.
76 * @param monitor - a progress monitor
77 * @throws ExecutionException
78 */
79 public void getProviderFromNode(IProgressMonitor monitor) throws ExecutionException {
80
81 List<IBaseEventInfo> eventInfos = getControlService().getKernelProvider(monitor);
82 KernelProviderComponent component = new KernelProviderComponent(Messages.TraceControl_KernelProviderDisplayName, this);
83 addChild(component);
84 component.setEventInfo(eventInfos);
85
86 List<IUstProviderInfo> allProviders = getControlService().getUstProvider(monitor);
87
88 for (Iterator<IUstProviderInfo> iterator = allProviders.iterator(); iterator.hasNext();) {
89 IUstProviderInfo ustProviderInfo = (IUstProviderInfo) iterator.next();
90 UstProviderComponent ustComponent = new UstProviderComponent(ustProviderInfo.getName(), this);
91 addChild(ustComponent);
92 ustComponent.setUstProvider(ustProviderInfo);
93 }
94 }
95}
96
This page took 0.034767 seconds and 5 git commands to generate.