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 **********************************************************************/
13 package org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.model
.impl
;
15 import java
.util
.Iterator
;
16 import java
.util
.List
;
18 import org
.eclipse
.linuxtools
.internal
.lttng2
.core
.control
.model
.IBaseEventInfo
;
19 import org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.messages
.Messages
;
20 import org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.model
.ITraceControlComponent
;
21 import org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.property
.KernelProviderPropertySource
;
22 import org
.eclipse
.ui
.views
.properties
.IPropertySource
;
25 * <b><u>KernelProviderComponent</u></b>
30 public class KernelProviderComponent
extends TraceControlComponent
{
32 // ------------------------------------------------------------------------
34 // ------------------------------------------------------------------------
36 * Path to icon file for this component.
38 public static final String KERNEL_PROVIDER_ICON_FILE
= "icons/obj16/targets.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 KernelProviderComponent(String name
, ITraceControlComponent parent
) {
54 setToolTip(Messages
.TraceControl_ProviderDisplayName
);
55 setImage(KERNEL_PROVIDER_ICON_FILE
);
58 // ------------------------------------------------------------------------
60 // ------------------------------------------------------------------------
62 * Sets the events information for this component.
63 * @param eventInfos - events information to set.
65 public void setEventInfo(List
<IBaseEventInfo
> eventInfos
) {
66 for (Iterator
<IBaseEventInfo
> iterator
= eventInfos
.iterator(); iterator
.hasNext();) {
67 IBaseEventInfo baseEventInfo
= (IBaseEventInfo
) iterator
.next();
68 BaseEventComponent component
= new BaseEventComponent(baseEventInfo
.getName(), this);
69 component
.setEventInfo(baseEventInfo
);
76 * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlComponent#getAdapter(java.lang.Class)
78 @SuppressWarnings("rawtypes")
80 public Object
getAdapter(Class adapter
) {
81 if (adapter
== IPropertySource
.class) {
82 return new KernelProviderPropertySource(this);
87 // ------------------------------------------------------------------------
89 // ------------------------------------------------------------------------