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
.lttng2
.ui
.views
.control
.property
;
14 import org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.messages
.Messages
;
15 import org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.model
.impl
.TraceDomainComponent
;
16 import org
.eclipse
.linuxtools
.tmf
.core
.util
.ReadOnlyTextPropertyDescriptor
;
17 import org
.eclipse
.ui
.views
.properties
.IPropertyDescriptor
;
21 * Property source implementation for the trace domain component.
24 * @author Bernd Hufmann
26 public class TraceDomainPropertySource
extends BasePropertySource
{
28 // ------------------------------------------------------------------------
30 // ------------------------------------------------------------------------
33 * The trace domain 'name' property ID.
35 public static final String TRACE_DOMAIN_NAME_PROPERTY_ID
= "trace.domain.name"; //$NON-NLS-1$
37 * The trace domain 'name' property name.
39 public static final String TRACE_DOMAIN_NAME_PROPERTY_NAME
= Messages
.TraceControl_DomainNamePropertyName
;
41 // ------------------------------------------------------------------------
43 // ------------------------------------------------------------------------
45 * The trace domain component which this property source is for.
47 private final TraceDomainComponent fBaseEvent
;
49 // ------------------------------------------------------------------------
51 // ------------------------------------------------------------------------
54 * @param component - the trace domain component
56 public TraceDomainPropertySource(TraceDomainComponent component
) {
57 fBaseEvent
= component
;
60 // ------------------------------------------------------------------------
62 // ------------------------------------------------------------------------
65 * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.BasePropertySource#getPropertyDescriptors()
68 public IPropertyDescriptor
[] getPropertyDescriptors() {
69 return new IPropertyDescriptor
[] {
70 new ReadOnlyTextPropertyDescriptor(TRACE_DOMAIN_NAME_PROPERTY_ID
, TRACE_DOMAIN_NAME_PROPERTY_NAME
)};
75 * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.BasePropertySource#getPropertyValue(java.lang.Object)
78 public Object
getPropertyValue(Object id
) {
79 if(TRACE_DOMAIN_NAME_PROPERTY_ID
.equals(id
)) {
80 return fBaseEvent
.getName();