ctf: Fix buffer overflow traces from crashing batch import
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ui / src / org / eclipse / linuxtools / internal / lttng2 / ui / views / control / property / TraceDomainPropertySource.java
CommitLineData
06b9339e 1/**********************************************************************
11252342 2 * Copyright (c) 2012, 2013 Ericsson
5a7326dc 3 *
06b9339e
BH
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
5a7326dc
BH
8 *
9 * Contributors:
080600d9 10 * Bernd Hufmann - Initial API and implementation
06b9339e 11 **********************************************************************/
115b4a01 12package org.eclipse.linuxtools.internal.lttng2.ui.views.control.property;
06b9339e 13
9315aeee 14import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
115b4a01 15import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
080600d9 16import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor;
06b9339e 17import org.eclipse.ui.views.properties.IPropertyDescriptor;
06b9339e
BH
18
19/**
06b9339e
BH
20 * <p>
21 * Property source implementation for the trace domain component.
22 * </p>
5a7326dc 23 *
dbd4432d 24 * @author Bernd Hufmann
06b9339e
BH
25 */
26public class TraceDomainPropertySource extends BasePropertySource {
27
28 // ------------------------------------------------------------------------
29 // Constants
30 // ------------------------------------------------------------------------
31
32 /**
33 * The trace domain 'name' property ID.
34 */
35 public static final String TRACE_DOMAIN_NAME_PROPERTY_ID = "trace.domain.name"; //$NON-NLS-1$
36 /**
5a7326dc 37 * The trace domain 'name' property name.
06b9339e
BH
38 */
39 public static final String TRACE_DOMAIN_NAME_PROPERTY_NAME = Messages.TraceControl_DomainNamePropertyName;
5a7326dc 40
06b9339e
BH
41 // ------------------------------------------------------------------------
42 // Attributes
43 // ------------------------------------------------------------------------
11252342 44
06b9339e 45 /**
5a7326dc 46 * The trace domain component which this property source is for.
06b9339e
BH
47 */
48 private final TraceDomainComponent fBaseEvent;
5a7326dc 49
06b9339e
BH
50 // ------------------------------------------------------------------------
51 // Constructors
52 // ------------------------------------------------------------------------
11252342 53
06b9339e
BH
54 /**
55 * Constructor
56 * @param component - the trace domain component
57 */
58 public TraceDomainPropertySource(TraceDomainComponent component) {
59 fBaseEvent = component;
60 }
5a7326dc 61
06b9339e
BH
62 // ------------------------------------------------------------------------
63 // Operations
64 // ------------------------------------------------------------------------
11252342 65
06b9339e
BH
66 @Override
67 public IPropertyDescriptor[] getPropertyDescriptors() {
68 return new IPropertyDescriptor[] {
5a7326dc 69 new ReadOnlyTextPropertyDescriptor(TRACE_DOMAIN_NAME_PROPERTY_ID, TRACE_DOMAIN_NAME_PROPERTY_NAME)};
06b9339e
BH
70 }
71
06b9339e
BH
72 @Override
73 public Object getPropertyValue(Object id) {
74 if(TRACE_DOMAIN_NAME_PROPERTY_ID.equals(id)) {
75 return fBaseEvent.getName();
76 }
77 return null;
78 }
79
80}
This page took 0.047276 seconds and 5 git commands to generate.