lttng: Move to Java 7 and fix warnings
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ui / src / org / eclipse / linuxtools / internal / lttng2 / ui / views / control / property / TraceProbeEventPropertySource.java
index 75234ad07d2692261a64d038f90b6e9af5d3a5bc..449faee229f605b3c7a3de1e01e3572989fb19e5 100644 (file)
@@ -1,13 +1,13 @@
 /**********************************************************************
- * 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: 
- *   Bernd Hufmann - Initial API and implementation
+ *
+ * Contributors:
+ *     Bernd Hufmann - Initial API and implementation
  **********************************************************************/
 package org.eclipse.linuxtools.internal.lttng2.ui.views.control.property;
 
@@ -15,17 +15,18 @@ import java.util.ArrayList;
 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.ui.properties.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 {
 
@@ -60,53 +61,53 @@ 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();
 
         List<IPropertyDescriptor> superList = Arrays.asList(superProperties);
-        ArrayList<IPropertyDescriptor> list = new ArrayList<IPropertyDescriptor>();
+        ArrayList<IPropertyDescriptor> list = new ArrayList<>();
         list.addAll(superList);
 
         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)) {
This page took 0.029018 seconds and 5 git commands to generate.