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
.UstProviderComponent
;
16 import org
.eclipse
.linuxtools
.tmf
.core
.util
.ReadOnlyTextPropertyDescriptor
;
17 import org
.eclipse
.ui
.views
.properties
.IPropertyDescriptor
;
21 * Property source implementation for the UST provider component.
24 * @author Bernd Hufmann
26 public class UstProviderPropertySource
extends BasePropertySource
{
28 // ------------------------------------------------------------------------
30 // ------------------------------------------------------------------------
32 * The UST provider 'name' property ID.
34 public static final String UST_PROVIDER_NAME_PROPERTY_ID
= "ust.provider.name"; //$NON-NLS-1$
36 * The UST provider 'PID' property ID.
38 public static final String UST_PROVIDER_PID_PROPERTY_ID
= "ust.provider.pid"; //$NON-NLS-1$
40 * The UST provider 'name' property name.
42 public static final String UST_PROVIDER_NAME_PROPERTY_NAME
= Messages
.TraceControl_ProviderNamePropertyName
;
44 * The UST provider 'type' property name.
46 public static final String UST_PROVIDER_PID_PROPERTY_NAME
= Messages
.TraceControl_ProcessIdPropertyName
;
48 // ------------------------------------------------------------------------
50 // ------------------------------------------------------------------------
52 * The UST provider component which this property source is for.
54 private UstProviderComponent fUstProvider
;
56 // ------------------------------------------------------------------------
58 // ------------------------------------------------------------------------
61 * @param component - the UST provider component
63 public UstProviderPropertySource(UstProviderComponent component
) {
64 fUstProvider
= component
;
67 // ------------------------------------------------------------------------
69 // ------------------------------------------------------------------------
72 * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.BasePropertySource#getPropertyDescriptors()
75 public IPropertyDescriptor
[] getPropertyDescriptors() {
76 return new IPropertyDescriptor
[] {
77 new ReadOnlyTextPropertyDescriptor(UST_PROVIDER_NAME_PROPERTY_ID
, UST_PROVIDER_NAME_PROPERTY_NAME
),
78 new ReadOnlyTextPropertyDescriptor(UST_PROVIDER_PID_PROPERTY_ID
, UST_PROVIDER_PID_PROPERTY_NAME
)};
83 * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.BasePropertySource#getPropertyValue(java.lang.Object)
86 public Object
getPropertyValue(Object id
) {
87 if(UST_PROVIDER_NAME_PROPERTY_ID
.equals(id
)) {
88 return fUstProvider
.getName();
90 if (UST_PROVIDER_PID_PROPERTY_ID
.equals(id
)) {
91 return String
.valueOf(fUstProvider
.getPid());