/**********************************************************************
- * Copyright (c) 2012 Ericsson
- *
+ * Copyright (c) 2012, 2013 Ericsson
+ *
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
* accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
+ *
+ * Contributors:
* Bernd Hufmann - Initial API and implementation
**********************************************************************/
package org.eclipse.linuxtools.internal.lttng2.ui.views.control.property;
import java.util.Arrays;
import java.util.List;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.Messages;
+import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceEventComponent;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceProbeEventComponent;
+import org.eclipse.linuxtools.tmf.core.util.ReadOnlyTextPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
/**
- * <b><u>TraceEventPropertySource</u></b>
* <p>
* Property source implementation for the trace probe event component.
* </p>
+ *
+ * @author Bernd Hufmann
*/
public class TraceProbeEventPropertySource extends TraceEventPropertySource {
// ------------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------------
-
+
// ------------------------------------------------------------------------
// Constructors
// ------------------------------------------------------------------------
+
+ /**
+ * Constructor
+ *
+ * @param component
+ * A trace event component
+ */
public TraceProbeEventPropertySource(TraceEventComponent component) {
super(component);
if (component.getClass() != TraceProbeEventComponent.class) {
throw new IllegalArgumentException("Invalid type passed. Only class of type TraceProbeEventComponent allowed:\n" + component.getClass()); //$NON-NLS-1$
}
}
-
+
// ------------------------------------------------------------------------
// Operations
// ------------------------------------------------------------------------
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.BasePropertySource#getPropertyDescriptors()
- */
+
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
IPropertyDescriptor[] superProperties = super.getPropertyDescriptors();
if (fEvent instanceof TraceProbeEventComponent) {
TraceProbeEventComponent event = (TraceProbeEventComponent) fEvent;
if (event.getAddress() != null) {
- list.add(new TextPropertyDescriptor(TRACE_EVENT_PROBE_ADDRESS_PROPERTY_ID, TRACE_EVENT_PROBE_ADDRESS_PROPERTY_NAME));
+ list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_PROBE_ADDRESS_PROPERTY_ID, TRACE_EVENT_PROBE_ADDRESS_PROPERTY_NAME));
}
if (event.getOffset() != null) {
- list.add(new TextPropertyDescriptor(TRACE_EVENT_PROBE_OFFSET_PROPERTY_ID, TRACE_EVENT_PROBE_OFFSET_PROPERTY_NAME));
+ list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_PROBE_OFFSET_PROPERTY_ID, TRACE_EVENT_PROBE_OFFSET_PROPERTY_NAME));
}
if (event.getSymbol() != null) {
- list.add(new TextPropertyDescriptor(TRACE_EVENT_PROBE_SYMBOL_PROPERTY_ID, TRACE_EVENT_PROBE_SYMBOL_PROPERTY_NAME));
+ list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_PROBE_SYMBOL_PROPERTY_ID, TRACE_EVENT_PROBE_SYMBOL_PROPERTY_NAME));
}
}
- return (IPropertyDescriptor [])list.toArray(new IPropertyDescriptor[list.size()]);
+ return list.toArray(new IPropertyDescriptor[list.size()]);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.BasePropertySource#getPropertyValue(java.lang.Object)
- */
@Override
public Object getPropertyValue(Object id) {
if(TRACE_EVENT_PROBE_ADDRESS_PROPERTY_ID.equals(id)) {