1 /**********************************************************************
2 * Copyright (c) 2012 Ericsson
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
10 * Bernd Hufmann - Initial API and implementation
11 **********************************************************************/
12 package org
.eclipse
.linuxtools
.internal
.lttng
.ui
.views
.control
.model
.impl
;
14 import java
.util
.Iterator
;
15 import java
.util
.List
;
17 import org
.eclipse
.core
.commands
.ExecutionException
;
18 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
19 import org
.eclipse
.core
.runtime
.NullProgressMonitor
;
20 import org
.eclipse
.linuxtools
.internal
.lttng
.ui
.views
.control
.Messages
;
21 import org
.eclipse
.linuxtools
.internal
.lttng
.ui
.views
.control
.model
.IBaseEventInfo
;
22 import org
.eclipse
.linuxtools
.internal
.lttng
.ui
.views
.control
.model
.ITraceControlComponent
;
23 import org
.eclipse
.linuxtools
.internal
.lttng
.ui
.views
.control
.model
.IUstProviderInfo
;
26 * <b><u>TraceProviderGroup</u></b>
28 * Implementation of the trace provider group.
31 public class TraceProviderGroup
extends TraceControlComponent
{
32 // ------------------------------------------------------------------------
34 // ------------------------------------------------------------------------
36 * Path to icon file for this component.
38 public static final String TRACE_PROVIDERS_ICON_FILE
= "icons/obj16/providers.gif"; //$NON-NLS-1$
40 // ------------------------------------------------------------------------
42 // ------------------------------------------------------------------------
44 // ------------------------------------------------------------------------
46 // ------------------------------------------------------------------------
49 * @param name - the name of the component.
50 * @param parent - the parent of this component.
52 public TraceProviderGroup(String name
, ITraceControlComponent parent
) {
54 setImage(TRACE_PROVIDERS_ICON_FILE
);
57 // ------------------------------------------------------------------------
59 // ------------------------------------------------------------------------
61 // ------------------------------------------------------------------------
63 // ------------------------------------------------------------------------
66 * Gets the provider information from the target node.
67 * @throws ExecutionException
69 public void getProviderFromNode() throws ExecutionException
{
70 getProviderFromNode(new NullProgressMonitor());
74 * Gets the provider information from the target node.
75 * @param monitor - a progress monitor
76 * @throws ExecutionException
78 public void getProviderFromNode(IProgressMonitor monitor
) throws ExecutionException
{
80 List
<IBaseEventInfo
> eventInfos
= getControlService().getKernelProvider(monitor
);
81 KernelProviderComponent component
= new KernelProviderComponent(Messages
.TraceControl_KernelProviderDisplayName
, this);
83 component
.setEventInfo(eventInfos
);
85 List
<IUstProviderInfo
> allProviders
= getControlService().getUstProvider(monitor
);
87 for (Iterator
<IUstProviderInfo
> iterator
= allProviders
.iterator(); iterator
.hasNext();) {
88 IUstProviderInfo ustProviderInfo
= (IUstProviderInfo
) iterator
.next();
89 UstProviderComponent ustComponent
= new UstProviderComponent(ustProviderInfo
.getName(), this);
90 addChild(ustComponent
);
91 ustComponent
.setUstProvider(ustProviderInfo
);