tmf: Remove the ITmfEventTableColumns extension point
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.ui / src / org / eclipse / tracecompass / tmf / ui / project / model / TmfTraceTypeUIUtils.java
index b5ce37319399d21bac66bda93bdde6d35f6c76ec..5859ba3b2b46f2d59082e38180af2dd8e349fc7f 100644 (file)
@@ -16,7 +16,6 @@ package org.eclipse.tracecompass.tmf.ui.project.model;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.LinkedList;
@@ -40,19 +39,16 @@ import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
-import org.eclipse.tracecompass.internal.tmf.ui.parsers.custom.CustomEventTableColumns;
 import org.eclipse.tracecompass.tmf.core.TmfCommonConstants;
 import org.eclipse.tracecompass.tmf.core.parsers.custom.CustomTxtTrace;
 import org.eclipse.tracecompass.tmf.core.parsers.custom.CustomXmlTrace;
 import org.eclipse.tracecompass.tmf.core.project.model.TmfTraceImportException;
 import org.eclipse.tracecompass.tmf.core.project.model.TmfTraceType;
-import org.eclipse.tracecompass.tmf.core.project.model.TraceTypeHelper;
 import org.eclipse.tracecompass.tmf.core.project.model.TmfTraceType.TraceElementType;
+import org.eclipse.tracecompass.tmf.core.project.model.TraceTypeHelper;
 import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
 import org.eclipse.tracecompass.tmf.core.util.Pair;
 import org.eclipse.tracecompass.tmf.ui.viewers.events.TmfEventsTable;
-import org.eclipse.tracecompass.tmf.ui.viewers.events.columns.ITmfEventTableColumns;
-import org.eclipse.tracecompass.tmf.ui.viewers.events.columns.TmfEventTableColumn;
 import org.osgi.framework.Bundle;
 
 /**
@@ -414,61 +410,6 @@ public final class TmfTraceTypeUIUtils {
         return null;
     }
 
-    /**
-     * Get the Event Table columns specified by the trace type's extension
-     * point, if there are any.
-     *
-     * @param trace
-     *            The trace for which we want the columns.
-     * @return The corresponding event table columns, or 'null' if this trace
-     *         type did not specify any.
-     * @since 3.2
-     */
-    public static @Nullable Collection<? extends TmfEventTableColumn> getEventTableColumns(ITmfTrace trace) {
-        final String traceType = getTraceType(trace);
-        if (traceType == null) {
-            return null;
-        }
-
-        /*
-         * Custom traces are a special case : the columns are defined by the
-         * trace definition.
-         */
-        if (traceType.startsWith(CustomTxtTrace.class.getCanonicalName())) {
-            return CustomEventTableColumns.generateColumns(((CustomTxtTrace) trace).getDefinition());
-        }
-        if (traceType.startsWith(CustomXmlTrace.class.getCanonicalName())) {
-            return CustomEventTableColumns.generateColumns(((CustomXmlTrace) trace).getDefinition());
-        }
-
-        /* For all other trace types, we will go look into the extension point */
-        for (final IConfigurationElement ce : TmfTraceTypeUIUtils.getTypeUIElements(TraceElementType.TRACE)) {
-            if (ce.getAttribute(TmfTraceTypeUIUtils.TRACETYPE_ATTR).equals(traceType)) {
-                final IConfigurationElement[] eventTableColumnsCE = ce.getChildren(TmfTraceTypeUIUtils.EVENT_TABLE_COLUMNS);
-
-                if (eventTableColumnsCE.length != 1) {
-                    break;
-                }
-                final String eventTableColumnsClass = eventTableColumnsCE[0].getAttribute(TmfTraceTypeUIUtils.CLASS_ATTR);
-                if ((eventTableColumnsClass == null) || (eventTableColumnsClass.isEmpty())) {
-                    break;
-                }
-                try {
-                    final Bundle bundle = Platform.getBundle(ce.getContributor().getName());
-                    final Class<?> c = bundle.loadClass(eventTableColumnsClass);
-                    final Constructor<?> ctor = c.getConstructor();
-                    ITmfEventTableColumns cols = (ITmfEventTableColumns) ctor.newInstance();
-                    return cols.getEventTableColumns();
-
-                } catch (NoSuchMethodException | ClassNotFoundException | InstantiationException |
-                        IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-                    return null;
-                }
-            }
-        }
-        return null;
-    }
-
     /**
      * Get the trace type (as a String) for the given trace
      *
This page took 0.026218 seconds and 5 git commands to generate.