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 / TraceDomainComponent.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.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
19 /**
20 * <b><u>TraceDomainComponent</u></b>
21 * <p>
22 * Implementation of the trace domain component.
23 * </p>
24 */
25 public class TraceDomainComponent extends TraceControlComponent {
26 // ------------------------------------------------------------------------
27 // Constants
28 // ------------------------------------------------------------------------
29 /**
30 * Path to icon file for this component.
31 */
32 public static final String TRACE_DOMAIN_ICON_FILE = "icons/obj16/domain.gif"; //$NON-NLS-1$
33
34 // ------------------------------------------------------------------------
35 // Attributes
36 // ------------------------------------------------------------------------
37 /**
38 * The domain information.
39 */
40 private IDomainInfo fDomainInfo = null;
41
42 // ------------------------------------------------------------------------
43 // Constructors
44 // ------------------------------------------------------------------------
45 /**
46 * Constructor
47 * @param name - the name of the component.
48 * @param parent - the parent of this component.
49 */
50 public TraceDomainComponent(String name, ITraceControlComponent parent) {
51 super(name, parent);
52 setImage(TRACE_DOMAIN_ICON_FILE);
53 setToolTip(Messages.TraceControl_DomainDisplayName);
54 fDomainInfo = new DomainInfo(name);
55 }
56
57 // ------------------------------------------------------------------------
58 // Accessors
59 // ------------------------------------------------------------------------
60 /**
61 * Sets the domain information.
62 * @param domainInfo - the domain information to set.
63 */
64 public void setDomainInfo(IDomainInfo domainInfo) {
65 fDomainInfo = domainInfo;
66 IChannelInfo[] channels = fDomainInfo.getChannels();
67 for (int i = 0; i < channels.length; i++) {
68 TraceChannelComponent channel = new TraceChannelComponent(channels[i].getName(), this);
69 channel.setChannelInfo(channels[i]);
70 addChild(channel);
71 }
72 }
73
74 // ------------------------------------------------------------------------
75 // Operations
76 // ------------------------------------------------------------------------
77 }
This page took 0.032538 seconds and 6 git commands to generate.