Merge branch 'master' into lttng_2_0_control_dev
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ui / src / org / eclipse / linuxtools / internal / lttng2 / ui / views / control / property / TraceDomainPropertySource.java
CommitLineData
06b9339e
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.property;
06b9339e 13
115b4a01
BH
14import org.eclipse.linuxtools.internal.lttng2.ui.views.control.Messages;
15import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
06b9339e
BH
16import org.eclipse.ui.views.properties.IPropertyDescriptor;
17import org.eclipse.ui.views.properties.TextPropertyDescriptor;
18
19/**
20 * <b><u>TraceDomainPropertySource</u></b>
21 * <p>
22 * Property source implementation for the trace domain component.
23 * </p>
24 */
25public class TraceDomainPropertySource extends BasePropertySource {
26
27 // ------------------------------------------------------------------------
28 // Constants
29 // ------------------------------------------------------------------------
30
31 /**
32 * The trace domain 'name' property ID.
33 */
34 public static final String TRACE_DOMAIN_NAME_PROPERTY_ID = "trace.domain.name"; //$NON-NLS-1$
35 /**
36 * The trace domain 'name' property name.
37 */
38 public static final String TRACE_DOMAIN_NAME_PROPERTY_NAME = Messages.TraceControl_DomainNamePropertyName;
39
40 // ------------------------------------------------------------------------
41 // Attributes
42 // ------------------------------------------------------------------------
43 /**
44 * The trace domain component which this property source is for.
45 */
46 private final TraceDomainComponent fBaseEvent;
47
48 // ------------------------------------------------------------------------
49 // Constructors
50 // ------------------------------------------------------------------------
51 /**
52 * Constructor
53 * @param component - the trace domain component
54 */
55 public TraceDomainPropertySource(TraceDomainComponent component) {
56 fBaseEvent = component;
57 }
58
59 // ------------------------------------------------------------------------
60 // Operations
61 // ------------------------------------------------------------------------
62 /*
63 * (non-Javadoc)
115b4a01 64 * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.BasePropertySource#getPropertyDescriptors()
06b9339e
BH
65 */
66 @Override
67 public IPropertyDescriptor[] getPropertyDescriptors() {
68 return new IPropertyDescriptor[] {
69 new TextPropertyDescriptor(TRACE_DOMAIN_NAME_PROPERTY_ID, TRACE_DOMAIN_NAME_PROPERTY_NAME)};
70 }
71
72 /*
73 * (non-Javadoc)
115b4a01 74 * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.BasePropertySource#getPropertyValue(java.lang.Object)
06b9339e
BH
75 */
76 @Override
77 public Object getPropertyValue(Object id) {
78 if(TRACE_DOMAIN_NAME_PROPERTY_ID.equals(id)) {
79 return fBaseEvent.getName();
80 }
81 return null;
82 }
83
84}
This page took 0.028247 seconds and 5 git commands to generate.