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
.property
;
14 import org
.eclipse
.linuxtools
.lttng
.ui
.views
.control
.Messages
;
15 import org
.eclipse
.linuxtools
.lttng
.ui
.views
.control
.model
.impl
.UstProviderComponent
;
16 import org
.eclipse
.ui
.views
.properties
.IPropertyDescriptor
;
17 import org
.eclipse
.ui
.views
.properties
.TextPropertyDescriptor
;
20 * <b><u>UstProviderPropertySource</u></b>
22 * Property source implementation for the UST provider component.
25 public class UstProviderPropertySource
extends BasePropertySource
{
27 // ------------------------------------------------------------------------
29 // ------------------------------------------------------------------------
31 * The UST provider 'name' property ID.
33 public static final String UST_PROVIDER_NAME_PROPERTY_ID
= "ust.provider.name"; //$NON-NLS-1$
35 * The UST provider 'PID' property ID.
37 public static final String UST_PROVIDER_PID_PROPERTY_ID
= "ust.provider.pid"; //$NON-NLS-1$
39 * The UST provider 'name' property name.
41 public static final String UST_PROVIDER_NAME_PROPERTY_NAME
= Messages
.TraceControl_ProviderNamePropertyName
;
43 * The UST provider 'type' property name.
45 public static final String UST_PROVIDER_PID_PROPERTY_NAME
= Messages
.TraceControl_ProcessIdPropertyName
;
47 // ------------------------------------------------------------------------
49 // ------------------------------------------------------------------------
51 * The UST provider component which this property source is for.
53 private UstProviderComponent fUstProvider
;
55 // ------------------------------------------------------------------------
57 // ------------------------------------------------------------------------
60 * @param component - the UST provider component
62 public UstProviderPropertySource(UstProviderComponent component
) {
63 fUstProvider
= component
;
66 // ------------------------------------------------------------------------
68 // ------------------------------------------------------------------------
71 * @see org.eclipse.linuxtools.lttng.ui.views.control.property.BasePropertySource#getPropertyDescriptors()
74 public IPropertyDescriptor
[] getPropertyDescriptors() {
75 return new IPropertyDescriptor
[] {
76 new TextPropertyDescriptor(UST_PROVIDER_NAME_PROPERTY_ID
, UST_PROVIDER_NAME_PROPERTY_NAME
),
77 new TextPropertyDescriptor(UST_PROVIDER_PID_PROPERTY_ID
, UST_PROVIDER_PID_PROPERTY_NAME
)};
82 * @see org.eclipse.linuxtools.lttng.ui.views.control.property.BasePropertySource#getPropertyValue(java.lang.Object)
85 public Object
getPropertyValue(Object id
) {
86 if(UST_PROVIDER_NAME_PROPERTY_ID
.equals(id
)) {
87 return fUstProvider
.getName();
89 if (UST_PROVIDER_PID_PROPERTY_ID
.equals(id
)) {
90 return String
.valueOf(fUstProvider
.getPid());