tmf/lttng: Remove unneeded (non-Javadoc) comments
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ui / src / org / eclipse / linuxtools / internal / lttng2 / ui / views / control / model / impl / BaseEventComponent.java
index 494ec791b09449683c4f0ab2278d5938c2575990..b9ecc27fba5c1528ef44aed6a450f6ebf8d721f1 100644 (file)
@@ -1,28 +1,32 @@
 /**********************************************************************
- * 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
+ *   Bernd Hufmann - Updated for support of LTTng Tools 2.1
  **********************************************************************/
 package org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl;
 
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.IBaseEventInfo;
+import org.eclipse.linuxtools.internal.lttng2.core.control.model.IBaseEventInfo;
+import org.eclipse.linuxtools.internal.lttng2.core.control.model.IFieldInfo;
+import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType;
+import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
+import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.EventInfo;
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.TraceEventType;
-import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.TraceLogLevel;
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.property.BaseEventPropertySource;
 import org.eclipse.ui.views.properties.IPropertySource;
 
 /**
- * <b><u>BaseEventComponent</u></b>
  * <p>
  * Implementation of the base trace event component.
  * </p>
+ *
+ * @author Bernd Hufmann
  */
 public class BaseEventComponent extends TraceControlComponent {
     // ------------------------------------------------------------------------
@@ -32,21 +36,21 @@ public class BaseEventComponent extends TraceControlComponent {
      * Path to icon file for this component.
      */
     public static final String TRACE_EVENT_ICON_FILE_ENABLED = "icons/obj16/event_enabled.gif"; //$NON-NLS-1$
-    
+
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
     /**
-     * The Event information implementation. 
+     * The Event information implementation.
      */
     private IBaseEventInfo fEventInfo;
-    
+
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
-    
+
     /**
-     * Constructor 
+     * Constructor
      * @param name - the name of the component.
      * @param parent - the parent of this component.
      */
@@ -55,7 +59,7 @@ public class BaseEventComponent extends TraceControlComponent {
         setImage(TRACE_EVENT_ICON_FILE_ENABLED);
         fEventInfo = new EventInfo(name);
     }
-    
+
     // ------------------------------------------------------------------------
     // Accessors
     // ------------------------------------------------------------------------
@@ -66,14 +70,14 @@ public class BaseEventComponent extends TraceControlComponent {
     public void setEventInfo(IBaseEventInfo eventInfo) {
         fEventInfo = eventInfo;
     }
-    
+
     /**
      * @return the event type.
      */
     public TraceEventType getEventType() {
         return fEventInfo.getEventType();
     }
-    
+
     /**
      * Sets the event type to the given value.
      * @param type - type to set.
@@ -81,7 +85,7 @@ public class BaseEventComponent extends TraceControlComponent {
     public void setEventType(TraceEventType type) {
         fEventInfo.setEventType(type);
     }
-    
+
     /**
      * Sets the event type to the value specified by the give name.
      * @param typeName - the type name.
@@ -96,15 +100,15 @@ public class BaseEventComponent extends TraceControlComponent {
     public TraceLogLevel getLogLevel() {
         return fEventInfo.getLogLevel();
     }
-    
+
     /**
-     * Sets the trace event log level to the given level 
+     * Sets the trace event log level to the given level
      * @param level - event log level to set
      */
     public void setLogLevel(TraceLogLevel level) {
         fEventInfo.setLogLevel(level);
     }
-    
+
     /**
      * Sets the trace event log level to the level specified by the given name.
      * @param levelName - event log level name
@@ -113,21 +117,36 @@ public class BaseEventComponent extends TraceControlComponent {
         fEventInfo.setLogLevel(levelName);
     }
 
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceControlComponent#getAdapter(java.lang.Class)
+    /**
+     * @return a String containing pairs if field name and data type
      */
-    @SuppressWarnings("rawtypes")
+    public String getFieldString() {
+        IFieldInfo[] fields = fEventInfo.getFields();
+        if ((fields != null) && (fields.length > 0)) {
+            StringBuffer buffer = new StringBuffer();
+            for (int i = 0; i < fields.length; i++) {
+                buffer.append(fields[i].getName());
+                buffer.append("="); //$NON-NLS-1$
+                buffer.append(fields[i].getFieldType());
+                if (i != fields.length-1) {
+                    buffer.append(";"); //$NON-NLS-1$
+                }
+            }
+            return buffer.toString();
+        }
+        return null;
+    }
+
     @Override
     public Object getAdapter(Class adapter) {
         if (adapter == IPropertySource.class) {
             return new BaseEventPropertySource(this);
         }
         return null;
-    } 
+    }
 
     /**
-     * @return target node component. 
+     * @return target node component.
      */
     public TargetNodeComponent getTargetNode() {
         return (TargetNodeComponent) getParent().getParent();
This page took 0.026262 seconds and 5 git commands to generate.