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
.lttng
.ui
.views
.control
.model
.impl
;
14 import org
.eclipse
.linuxtools
.lttng
.ui
.views
.control
.Messages
;
15 import org
.eclipse
.linuxtools
.lttng
.ui
.views
.control
.model
.IChannelInfo
;
16 import org
.eclipse
.linuxtools
.lttng
.ui
.views
.control
.model
.IDomainInfo
;
17 import org
.eclipse
.linuxtools
.lttng
.ui
.views
.control
.model
.ITraceControlComponent
;
18 import org
.eclipse
.linuxtools
.lttng
.ui
.views
.control
.property
.TraceDomainPropertySource
;
19 import org
.eclipse
.ui
.views
.properties
.IPropertySource
;
22 * <b><u>TraceDomainComponent</u></b>
24 * Implementation of the trace domain component.
27 public class TraceDomainComponent
extends TraceControlComponent
{
28 // ------------------------------------------------------------------------
30 // ------------------------------------------------------------------------
32 * Path to icon file for this component.
34 public static final String TRACE_DOMAIN_ICON_FILE
= "icons/obj16/domain.gif"; //$NON-NLS-1$
36 // ------------------------------------------------------------------------
38 // ------------------------------------------------------------------------
40 * The domain information.
42 private IDomainInfo fDomainInfo
= null;
44 // ------------------------------------------------------------------------
46 // ------------------------------------------------------------------------
49 * @param name - the name of the component.
50 * @param parent - the parent of this component.
52 public TraceDomainComponent(String name
, ITraceControlComponent parent
) {
54 setImage(TRACE_DOMAIN_ICON_FILE
);
55 setToolTip(Messages
.TraceControl_DomainDisplayName
);
56 fDomainInfo
= new DomainInfo(name
);
59 // ------------------------------------------------------------------------
61 // ------------------------------------------------------------------------
63 * Sets the domain information.
64 * @param domainInfo - the domain information to set.
66 public void setDomainInfo(IDomainInfo domainInfo
) {
67 fDomainInfo
= domainInfo
;
68 IChannelInfo
[] channels
= fDomainInfo
.getChannels();
69 for (int i
= 0; i
< channels
.length
; i
++) {
70 TraceChannelComponent channel
= new TraceChannelComponent(channels
[i
].getName(), this);
71 channel
.setChannelInfo(channels
[i
]);
78 * @see org.eclipse.linuxtools.lttng.ui.views.control.model.impl.TraceControlComponent#getAdapter(java.lang.Class)
80 @SuppressWarnings("rawtypes")
82 public Object
getAdapter(Class adapter
) {
83 if (adapter
== IPropertySource
.class) {
84 return new TraceDomainPropertySource(this);
88 // ------------------------------------------------------------------------
90 // ------------------------------------------------------------------------