bin.includes = META-INF/,\
.,\
plugin.properties,\
- about.html
+ about.html,\
+ plugin.xml
src.includes = about.html
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.linuxtools.tmf.core.tracetype">
+ <category
+ id="org.eclipse.linuxtools.gdbtrace.core.category"
+ name="GDB">
+ </category>
+ <type
+ category="org.eclipse.linuxtools.gdbtrace.core.category"
+ event_type="org.eclipse.linuxtools.internal.gdbtrace.core.event.GdbTraceEvent"
+ id="org.eclipse.linuxtools.gdbtrace.core.type.gdb"
+ name="GDB Trace"
+ trace_type="org.eclipse.linuxtools.internal.gdbtrace.core.trace.GdbTrace">
+ </type>
+ </extension>
+
+</plugin>
name="%perspective.name">
</perspective>
</extension>
- <extension
- point="org.eclipse.linuxtools.tmf.ui.tracetype">
- <category
- id="org.eclipse.linuxtools.gdbtrace.ui.category"
- name="GDB">
- </category>
- <type
- category="org.eclipse.linuxtools.gdbtrace.ui.category"
- event_type="org.eclipse.linuxtools.internal.gdbtrace.core.event.GdbTraceEvent"
- icon="icons/obj16/gdb_icon16.png"
- id="org.eclipse.linuxtools.gdbtrace.ui.type.gdb"
- name="GDB Trace"
- trace_type="org.eclipse.linuxtools.internal.gdbtrace.core.trace.GdbTrace">
- <eventsTableType
- class="org.eclipse.linuxtools.internal.gdbtrace.ui.views.events.GdbEventsTable">
- </eventsTableType>
- </type>
- </extension>
<extension
point="org.eclipse.ui.commands">
<command
</enablement>
</commonWizard>
</extension>
+ <extension
+ point="org.eclipse.linuxtools.tmf.ui.tracetypeui">
+ <type
+ icon="icons/obj16/gdb_icon16.png"
+ tracetype="org.eclipse.linuxtools.gdbtrace.core.type.gdb">
+ <eventsTableType
+ class="org.eclipse.linuxtools.internal.gdbtrace.ui.views.events.GdbEventsTable">
+ </eventsTableType>
+ </type>
+ </extension>
</plugin>
Bundle-Vendor = Eclipse Linux Tools
Bundle-Name = Linux Tools LTTng Kernel Analysis Core Plug-in
+tracetype.type.kernel = LTTng Kernel Trace
analysis.lttngkernel = LTTng Kernel Analysis
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
+ <extension
+ point="org.eclipse.linuxtools.tmf.core.tracetype">
+ <type
+ category="org.eclipse.linuxtools.tmf.core.category.ctf"
+ event_type="org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfEvent"
+ id="org.eclipse.linuxtools.lttng2.kernel.tracetype"
+ isDirectory="true"
+ name="%tracetype.type.kernel"
+ trace_type="org.eclipse.linuxtools.lttng2.kernel.core.trace.LttngKernelTrace">
+ </type>
+ </extension>
<extension
point="org.eclipse.linuxtools.tmf.core.analysis">
<module
resources.view.name = Resources
tracetype.type.kernel = LTTng Kernel Trace
+analysis.lttngkernel = LTTng Kernel Analysis
restorable="true">
</view>
</extension>
- <extension
- point="org.eclipse.linuxtools.tmf.ui.tracetype">
- <type
- category="org.eclipse.linuxtools.tmf.ui.category.ctf"
- event_type="org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfEvent"
- icon="icons/obj16/garland16.png"
- id="org.eclipse.linuxtools.lttng2.kernel.tracetype"
- isDirectory="true"
- name="%tracetype.type.kernel"
- trace_type="org.eclipse.linuxtools.lttng2.kernel.core.trace.LttngKernelTrace">
- <eventsTableType
- class="org.eclipse.linuxtools.internal.lttng2.kernel.ui.viewers.events.LTTng2EventsTable">
- </eventsTableType>
- </type>
- </extension>
<extension
point="org.eclipse.ui.navigator.navigatorContent">
<commonWizard
</analysisId>
</output>
</extension>
+ <extension
+ point="org.eclipse.linuxtools.tmf.ui.tracetypeui">
+ <type
+ icon="icons/obj16/garland16.png"
+ tracetype="org.eclipse.linuxtools.lttng2.kernel.tracetype">
+ <eventsTableType
+ class="org.eclipse.linuxtools.internal.lttng2.kernel.ui.viewers.events.LTTng2EventsTable">
+ </eventsTableType>
+ </type>
+ </extension>
</plugin>
bin.includes = META-INF/,\
.,\
about.html,\
- plugin.properties
+ plugin.properties,\
+ plugin.xml
src.includes = about.html
#Properties file for org.eclipse.linuxtools.lttng2.ust.core
Bundle-Vendor = Eclipse Linux Tools
-Bundle-Name = Linux Tools LTTng Userspace Tracer Analysis Core Plug-in
\ No newline at end of file
+Bundle-Name = Linux Tools LTTng Userspace Tracer Analysis Core Plug-in
+
+tracetype.type.ust = LTTng UST Trace
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.linuxtools.tmf.core.tracetype">
+ <type
+ category="org.eclipse.linuxtools.tmf.core.category.ctf"
+ event_type="org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfEvent"
+ id="org.eclipse.linuxtools.lttng2.ust.tracetype"
+ isDirectory="true"
+ name="%tracetype.type.ust"
+ trace_type="org.eclipse.linuxtools.lttng2.ust.core.trace.LttngUstTrace">
+ </type>
+ </extension>
+
+</plugin>
org.eclipse.ui,
org.eclipse.linuxtools.lttng2.ust.core;bundle-version="3.0.0",
org.eclipse.linuxtools.tmf.core;bundle-version="3.0.0",
- org.eclipse.linuxtools.tmf.ui
+ org.eclipse.linuxtools.tmf.ui;bundle-version="3.0.0"
Export-Package: org.eclipse.linuxtools.internal.lttng2.ust.ui;x-friends:="org.eclipse.linuxtools.lttng2.ust.ui.tests",
org.eclipse.linuxtools.internal.lttng2.ust.ui.views.memusage;x-friends:="org.eclipse.linuxtools.lttng2.ust.ui.tests",
org.eclipse.linuxtools.lttng2.ust.ui.analysis.callstack,
<?eclipse version="3.4"?>
<plugin>
<extension
- point="org.eclipse.linuxtools.tmf.ui.tracetype">
+ point="org.eclipse.linuxtools.tmf.ui.tracetypeui">
<type
- category="org.eclipse.linuxtools.tmf.ui.category.ctf"
- event_type="org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfEvent"
icon="icons/obj16/garland16.png"
- id="org.eclipse.linuxtools.lttng2.ust.tracetype"
- isDirectory="true"
- name="%tracetype.type.ust"
- trace_type="org.eclipse.linuxtools.lttng2.ust.core.trace.LttngUstTrace">
+ tracetype="org.eclipse.linuxtools.lttng2.ust.tracetype">
</type>
</extension>
<extension
</tracetype>
</module>
</extension>
+ <extension
+ point="org.eclipse.linuxtools.tmf.core.tracetype">
+ <category
+ id="org.eclipse.linuxtools.tmf.core.tests.category"
+ name="Test trace">
+ </category>
+ <type
+ category="org.eclipse.linuxtools.tmf.core.tests.category"
+ event_type="org.eclipse.linuxtools.tmf.core.event.TmfEvent"
+ id="org.eclipse.linuxtools.tmf.core.tests.tracetype"
+ name="TMF Tests"
+ trace_type="org.eclipse.linuxtools.tmf.tests.stubs.trace.TmfTraceStub">
+ </type>
+ <type
+ category="org.eclipse.linuxtools.tmf.core.tests.category"
+ event_type="org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfEvent"
+ id="org.eclipse.linuxtools.tmf.core.tests.ctf.tracetype"
+ isDirectory="true"
+ name="CTF Tests"
+ trace_type="org.eclipse.linuxtools.tmf.tests.stubs.ctf.CtfTmfTraceStub">
+ </type>
+ </extension>
</plugin>
#Properties file for org.eclipse.linuxtools.tmf.core
Bundle-Vendor = Eclipse Linux Tools
Bundle-Name = Linux Tools TMF Core Plug-in
+
+# CTF trace type
+tracetype.category.ctf = Common Trace Format
+tracetype.type.ctf = Generic CTF Trace
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
+ <extension-point id="org.eclipse.linuxtools.tmf.core.tracetype" name="Tmf Trace Type" schema="schema/org.eclipse.linuxtools.tmf.core.tracetype.exsd"/>
+ <extension-point id="org.eclipse.linuxtools.tmf.core.analysis" name="Trace Analysis Module" schema="schema/org.eclipse.linuxtools.tmf.core.analysis.exsd"/>
+
<extension
point="org.eclipse.core.runtime.preferences">
<initializer
class="org.eclipse.linuxtools.internal.tmf.core.TmfCorePreferenceInitializer">
</initializer>
</extension>
- <extension-point id="org.eclipse.linuxtools.tmf.core.analysis" name="Trace Analysis Module" schema="schema/org.eclipse.linuxtools.tmf.core.analysis.exsd"/>
<extension
point="org.eclipse.linuxtools.tmf.core.analysis">
<source
class="org.eclipse.linuxtools.internal.tmf.core.analysis.TmfAnalysisModuleSourceConfigElement">
</source>
</extension>
+ <extension
+ point="org.eclipse.linuxtools.tmf.core.tracetype">
+ <category
+ id="org.eclipse.linuxtools.tmf.core.category.ctf"
+ name="%tracetype.category.ctf">
+ </category>
+ <type
+ category="org.eclipse.linuxtools.tmf.core.category.ctf"
+ event_type="org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfEvent"
+ id="org.eclipse.linuxtools.tmf.core.type.ctf"
+ isDirectory="true"
+ name="%tracetype.type.ctf"
+ trace_type="org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace">
+ </type>
+ </extension>
</plugin>
--- /dev/null
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.linuxtools.tmf.core" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.linuxtools.tmf.core" id="tracetype" name="TMF Trace Type"/>
+ </appinfo>
+ <documentation>
+ This extension point is used to contribute new trace types to the generic components of the TMF framework.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="category"/>
+ <element ref="type"/>
+ </choice>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+ a fully qualified identifier of the target extension point
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+ an optional identifier of the extension instance
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+ an optional name of the extension instance
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="category">
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ a unique name that will be used to identify this category
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ a translatable name that will be used in the UI for this category
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="type">
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ The unique ID that identifies this trace type.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ The type name as it is displayed to the end user.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="category" type="string">
+ <annotation>
+ <documentation>
+ An optional attribute that is composed of the category ID. The referenced category must be declared in a corresponding category element.
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="identifier" basedOn="org.eclipse.linuxtools.tmf.core.tracetype/category/@id"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="trace_type" type="string" use="required">
+ <annotation>
+ <documentation>
+ The fully qualified name of a class that implements the <samp>ITmfTrace</samp> interface.
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.linuxtools.tmf.core.trace.ITmfTrace"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="event_type" type="string" use="required">
+ <annotation>
+ <documentation>
+ The fully qualified name of a class that implements the <samp>ITmfEvent</samp> interface
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.linuxtools.tmf.core.event.ITmfEvent"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="isDirectory" type="boolean" use="default" value="false">
+ <annotation>
+ <documentation>
+ Indicates whether the trace type is for traces that are directories (true) or files (false)
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 3.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ Example use of the tmftracetype extension point for generic CTF traces (CtfTmfTrace):
+
+<extension
+ point="org.eclipse.linuxtools.tmf.core.tracetype">
+ <category
+ id="org.eclipse.linuxtools.tmf.core.category.ctf"
+ name="Common Trace Format">
+ </category>
+ <type
+ category="org.eclipse.linuxtools.tmf.core.category.ctf"
+ event_type="org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfEvent"
+ id="org.eclipse.linuxtools.tmf.core.type.ctf"
+ name="Generic CTF Trace"
+ trace_type="org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace">
+ </type>
+</extension>
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ Trace types using this extension point have to specify the two following classes:
+
+* trace_type: Has to implement ITmfTrace. It's *highly* recommend to extend 'TmfTrace' to get default implementations.
+* event_type: Has to implement ITmfEvent. Once again, TmfEvent provides a reference implementation that should work in most cases.
+ </documentation>
+ </annotation>
+
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ Copyright (c) 2014 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 <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
+ </documentation>
+ </annotation>
+
+</schema>
import java.util.List;
import java.util.Map;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.linuxtools.internal.tmf.core.Activator;
-import org.eclipse.linuxtools.tmf.core.TmfCommonConstants;
import org.eclipse.linuxtools.tmf.core.parsers.custom.CustomTxtTrace;
import org.eclipse.linuxtools.tmf.core.parsers.custom.CustomTxtTraceDefinition;
import org.eclipse.linuxtools.tmf.core.parsers.custom.CustomXmlTrace;
private static final char SEPARATOR = ':';
/** Extension point ID */
- public static final String TMF_TRACE_TYPE_ID = "org.eclipse.linuxtools.tmf.ui.tracetype"; //$NON-NLS-1$
+ public static final String TMF_TRACE_TYPE_ID = "org.eclipse.linuxtools.tmf.core.tracetype"; //$NON-NLS-1$
/** Extension point element 'Category' */
public static final String CATEGORY_ELEM = "category"; //$NON-NLS-1$
/** Extension point element 'Type' */
public static final String TYPE_ELEM = "type"; //$NON-NLS-1$
- /** Extension point element 'Default editor' */
- public static final String DEFAULT_EDITOR_ELEM = "defaultEditor"; //$NON-NLS-1$
-
- /** Extension point element 'Events table type' */
- public static final String EVENTS_TABLE_TYPE_ELEM = "eventsTableType"; //$NON-NLS-1$
-
- /** Extension point element 'Statistics viewer type' */
- public static final String STATISTICS_VIEWER_ELEM = "statisticsViewerType"; //$NON-NLS-1$
-
/** Extension point attribute 'ID' */
public static final String ID_ATTR = "id"; //$NON-NLS-1$
/** Extension point attribute 'event_type' */
public static final String EVENT_TYPE_ATTR = "event_type"; //$NON-NLS-1$
- /** Extension point attribute 'icon' */
- public static final String ICON_ATTR = "icon"; //$NON-NLS-1$
-
- /** Extension point attribute 'class' */
- public static final String CLASS_ATTR = "class"; //$NON-NLS-1$
-
/** Extension point attribute 'isDirectory' */
public static final String IS_DIR_ATTR = "isDirectory"; //$NON-NLS-1$
return ""; //$NON-NLS-1$
}
- /**
- * Retrieves and instantiates an element's object based on his plug-in
- * definition for a specific trace type.
- *
- * The element's object is instantiated using its 0-argument constructor.
- *
- * @param resource
- * The resource where to find the information about the trace
- * properties
- * @param element
- * The name of the element to find under the trace type
- * definition
- * @return a new Object based on his definition in plugin.xml, or null if no
- * definition was found
- */
- public static Object getTraceTypeElement(IResource resource, String element) {
- try {
- if (resource != null) {
- String traceType = resource.getPersistentProperty(TmfCommonConstants.TRACETYPE);
- /*
- * Search in the configuration if there is any viewer specified
- * for this kind of trace type.
- */
- for (IConfigurationElement ce : TmfTraceType.getTypeElements()) {
- if (ce.getAttribute(TmfTraceType.ID_ATTR).equals(traceType)) {
- IConfigurationElement[] viewerCE = ce.getChildren(element);
- if (viewerCE.length != 1) {
- break;
- }
- return viewerCE[0].createExecutableExtension(TmfTraceType.CLASS_ATTR);
- }
- }
- }
- } catch (CoreException e) {
- Activator.logError("Error creating the element from the resource", e); //$NON-NLS-1$
- }
- return null;
- }
-
/**
* Retrieves all configuration elements from the platform extension registry
* for the trace type extension.
</uml2SDLoader>
</extension>
- <extension
- point="org.eclipse.linuxtools.tmf.ui.tracetype">
- <category
- id="org.eclipse.linuxtools.tmf.tests.category.tracetype"
- name="Test trace">
- </category>
- <type
- category="org.eclipse.linuxtools.tmf.tests.category.tracetype"
- event_type="org.eclipse.linuxtools.tmf.core.event.TmfEvent"
- id="org.eclipse.linuxtools.tmf.tests.tracetype"
- name="TMF Tests"
- trace_type="org.eclipse.linuxtools.tmf.tests.stubs.trace.TmfTraceStub">
- <eventsTableType
- class="org.eclipse.linuxtools.tmf.ui.viewers.events.TmfEventsTable">
- </eventsTableType>
- </type>
- <type
- category="org.eclipse.linuxtools.tmf.tests.category.tracetype"
- event_type="org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfEvent"
- id="org.eclipse.linuxtools.tmf.tests.ctf.tracetype"
- isDirectory="true"
- name="CTF Tests"
- trace_type="org.eclipse.linuxtools.tmf.tests.stubs.ctf.CtfTmfTraceStub">
- </type>
- </extension>
<extension
point="org.eclipse.linuxtools.tmf.core.analysis">
<module
return null;
}
linkedTrace.setPersistentProperty(TmfCommonConstants.TRACETYPE,
- "org.eclipse.linuxtools.tmf.tests.ctf.tracetype");
+ "org.eclipse.linuxtools.tmf.core.tests.ctf.tracetype");
final TmfProjectElement projectElement = TmfProjectRegistry.getProject(project, true);
TmfTraceElement traceElement = projectElement.getTracesFolder().getTraces().get(0);
commands.uml2sd.showend.description = Show the node end
commands.uml2sd.showstart = Show node start
commands.uml2sd.showstart.description = Show the node start
-
-# CTF trace type
-tracetype.category.ctf = Common Trace Format
-tracetype.type.ctf = Generic CTF Trace
-
<?eclipse version="3.4"?>
<plugin>
<extension-point id="org.eclipse.linuxtools.tmf.ui.uml2SDLoader" name="TMF UML 2 Sequence Diagram Loader" schema="schema/org.eclipse.linuxtools.tmf.ui.uml2SDLoader.exsd"/>
- <extension-point id="org.eclipse.linuxtools.tmf.ui.tracetype" name="Tmf Trace Type" schema="schema/org.eclipse.linuxtools.tmf.ui.tracetype.exsd"/>
+ <extension-point id="org.eclipse.linuxtools.tmf.ui.tracetypeui" name="Tmf Trace Type UI Elements" schema="schema/org.eclipse.linuxtools.tmf.ui.tracetypeui.exsd"/>
<extension
point="org.eclipse.ui.perspectives">
type="org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectModelElement">
</propertyTester>
</extension>
- <extension
- point="org.eclipse.linuxtools.tmf.ui.tracetype">
- <category
- id="org.eclipse.linuxtools.tmf.ui.category.ctf"
- name="%tracetype.category.ctf">
- </category>
- <type
- category="org.eclipse.linuxtools.tmf.ui.category.ctf"
- event_type="org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfEvent"
- icon="icons/eview16/events_view.gif"
- id="org.eclipse.linuxtools.tmf.ui.type.ctf"
- isDirectory="true"
- name="%tracetype.type.ctf"
- trace_type="org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace">
- </type>
- </extension>
<extension
point="org.eclipse.ui.navigator.linkHelper">
<linkHelper
</tracetype>
</module>
</extension>
-
+ <extension
+ point="org.eclipse.linuxtools.tmf.ui.tracetypeui">
+ <type
+ icon="icons/eview16/events_view.gif"
+ tracetype="org.eclipse.linuxtools.tmf.core.type.ctf">
+ </type>
+ </extension>
</plugin>
+++ /dev/null
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.linuxtools.tmf.ui" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.linuxtools.tmf.ui" id="tracetype" name="TMF Trace Type"/>
- </appinfo>
- <documentation>
- This extension point is used to contribute new trace types to the generic components of the TMF framework.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="category"/>
- <element ref="type"/>
- </choice>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="category">
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- a unique name that will be used to identify this category
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- a translatable name that will be used in the UI for this category
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="type">
- <complexType>
- <sequence>
- <element ref="defaultEditor" minOccurs="0" maxOccurs="1"/>
- <element ref="eventsTableType" minOccurs="0" maxOccurs="1"/>
- <element ref="statisticsViewerType" minOccurs="0" maxOccurs="1"/>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- The unique ID that identifies this trace type.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- The type name as it is displayed to the end user.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="category" type="string">
- <annotation>
- <documentation>
- An optional attribute that is composed of the category ID. The referenced category must be declared in a corresponding category element.
- </documentation>
- <appinfo>
- <meta.attribute kind="identifier" basedOn="org.eclipse.linuxtools.tmf.ui.tracetype/category/@id"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="trace_type" type="string" use="required">
- <annotation>
- <documentation>
- The fully qualified name of a class that implements the <samp>ITmfTrace</samp> interface.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.linuxtools.tmf.core.trace.ITmfTrace"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="event_type" type="string" use="required">
- <annotation>
- <documentation>
- The fully qualified name of a class that implements the <samp>ITmfEvent</samp> interface
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.linuxtools.tmf.core.event.ITmfEvent"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="icon" type="string">
- <annotation>
- <documentation>
- The icon associated to the trace type.
- </documentation>
- <appinfo>
- <meta.attribute kind="resource"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="isDirectory" type="boolean" use="default" value="false">
- <annotation>
- <documentation>
- Indicates whether the trace type is for traces that are directories (true) or files (false)
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="defaultEditor">
- <annotation>
- <documentation>
- The default editor to use for this trace type.
-If omitted, the default events editor will be used.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="default" value="org.eclipse.linuxtools.tmf.ui.editors.events">
- <annotation>
- <documentation>
- The id of the editor to use for this trace type.
-If empty, the default events editor will be used.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="eventsTableType">
- <annotation>
- <documentation>
- The events table to use for this trace type.
-If omitted, the default events table will be used.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="class" type="string" use="default" value="org.eclipse.linuxtools.tmf.ui.viewers.events.TmfEventsTable">
- <annotation>
- <documentation>
- The fully qualified name of a class that extends <samp>TmfEventsTable</samp> .
-If empty, the default events table will be used.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn="org.eclipse.linuxtools.tmf.ui.viewers.events.TmfEventsTable:"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="statisticsViewerType">
- <annotation>
- <documentation>
- The statistics viewer to use for this trace type.
-If omitted, the default statistics viewer will be used.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="class" type="string" use="default" value="org.eclipse.linuxtools.tmf.ui.viewers.statistics.TmfStatisticsViewer">
- <annotation>
- <documentation>
- The fully qualified name of a class that extends <samp>TmfStatisticsViewer</samp> .
-If empty, the default statistics viewer will be used.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn="org.eclipse.linuxtools.tmf.ui.viewers.statistics.TmfStatisticsViewer:"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- 0.9
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiinfo"/>
- </appinfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
-
-</schema>
--- /dev/null
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.linuxtools.tmf.ui" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.linuxtools.tmf.ui" id="tracetypeui" name="TMF Trace Type UI Elements"/>
+ </appinfo>
+ <documentation>
+ This extension point is used to assign UI elements to a trace type defined by org.eclipse.linuxtools.tmf.core.tracetype.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="type"/>
+ </choice>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+ a fully qualified identifier of the target extension point
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+ an optional identifier of the extension instance
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+ an optional name of the extension instance
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="type">
+ <complexType>
+ <sequence>
+ <element ref="eventsTableType" minOccurs="0" maxOccurs="1"/>
+ <element ref="defaultEditor" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ <attribute name="tracetype" type="string" use="required">
+ <annotation>
+ <documentation>
+ The unique ID that identifies this trace type.
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="identifier" basedOn="org.eclipse.linuxtools.tmf.core.tracetype/type/@id"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="icon" type="string">
+ <annotation>
+ <documentation>
+ The icon associated to the trace type.
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="resource"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="eventsTableType">
+ <annotation>
+ <documentation>
+ The events table to use for this trace type.
+If omitted, the default events table will be used.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="class" type="string" use="default" value="org.eclipse.linuxtools.tmf.ui.viewers.events.TmfEventsTable">
+ <annotation>
+ <documentation>
+ The fully qualified name of a class that extends <samp>TmfEventsTable</samp> .
+If empty, the default events table will be used.
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.linuxtools.tmf.ui.viewers.events.TmfEventsTable:"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="defaultEditor">
+ <annotation>
+ <documentation>
+ The default editor to use for this trace type.
+If omitted, the default events editor will be used.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="id" type="string" use="default" value="org.eclipse.linuxtools.tmf.ui.editors.events">
+ <annotation>
+ <documentation>
+ The id of the editor to use for this trace type.
+If empty, the default events editor will be used.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 3.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ Example use of the extension point: the GDB trace type, which specifies a custom icon and a custom editor. The 'type/tracetype' element has to point to an existing tmf.core.tracetype extension!
+
+<extension
+ point="org.eclipse.linuxtools.tmf.ui.tracetypeui">
+ <type
+ icon="icons/obj16/gdb_icon16.png"
+ tracetype="org.eclipse.linuxtools.gdbtrace.core.type.gdb">
+ <eventsTableType
+ class="org.eclipse.linuxtools.internal.gdbtrace.ui.views.events.GdbEventsTable">
+ </eventsTableType>
+ </type>
+</extension>
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ The 'eventsTableType/class' element has to extend TmfEventsTable. It is optional however ; if it is not specified, the default TmfEventsTable will be used.
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ Copyright (c) 2014 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 <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
+ </documentation>
+ </annotation>
+
+</schema>
import org.eclipse.linuxtools.tmf.core.parsers.custom.CustomXmlTraceDefinition;
import org.eclipse.linuxtools.tmf.core.project.model.TmfTraceType;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceElement;
+import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceTypeUIUtils;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
if (ce.getName().equals(TmfTraceType.TYPE_ELEM)) {
String traceBundle = ce.getContributor().getName();
String traceTypeId = ce.getAttribute(TmfTraceType.ID_ATTR);
- String traceIcon = ce.getAttribute(TmfTraceType.ICON_ATTR);
String label = ce.getAttribute(TmfTraceType.NAME_ATTR).replaceAll("&", "&&"); //$NON-NLS-1$ //$NON-NLS-2$
boolean selected = selectedTraceTypes.contains(traceTypeId);
MenuManager subMenu = categoriesMap.get(ce.getAttribute(TmfTraceType.CATEGORY_ATTR));
+ /* Get the icon from the tmftracetypeui extension, if it exists */
+ String traceIcon = null;
+ IConfigurationElement uiCE = TmfTraceTypeUIUtils.getTraceUIAttributes(traceTypeId);
+ if (uiCE != null) {
+ traceIcon = uiCE.getAttribute(TmfTraceTypeUIUtils.ICON_ATTR);
+ }
+
addContributionItem(list, traceBundle, traceTypeId, traceIcon, label, selected, subMenu);
}
}
import org.eclipse.linuxtools.tmf.core.TmfCommonConstants;
import org.eclipse.linuxtools.tmf.core.parsers.custom.CustomTxtTrace;
import org.eclipse.linuxtools.tmf.core.parsers.custom.CustomXmlTrace;
-import org.eclipse.linuxtools.tmf.core.project.model.TmfTraceType;
import org.eclipse.linuxtools.tmf.core.signal.TmfSignalHandler;
import org.eclipse.linuxtools.tmf.core.signal.TmfTimestampFormatUpdateSignal;
import org.eclipse.linuxtools.tmf.core.signal.TmfTraceClosedSignal;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectElement;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectRegistry;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceElement;
+import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceTypeUIUtils;
import org.eclipse.linuxtools.tmf.ui.viewers.events.TmfEventsTable;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
if (traceType.startsWith(CustomXmlTrace.class.getCanonicalName())) {
return new CustomEventsTable(((CustomXmlTrace) fTrace).getDefinition(), parent, cacheSize);
}
- for (final IConfigurationElement ce : TmfTraceType.getTypeElements()) {
- if (ce.getAttribute(TmfTraceType.ID_ATTR).equals(traceType)) {
- final IConfigurationElement[] eventsTableTypeCE = ce.getChildren(TmfTraceType.EVENTS_TABLE_TYPE_ELEM);
+ for (final IConfigurationElement ce : TmfTraceTypeUIUtils.getTypeUIElements()) {
+ if (ce.getAttribute(TmfTraceTypeUIUtils.TRACETYPE_ATTR).equals(traceType)) {
+ final IConfigurationElement[] eventsTableTypeCE = ce.getChildren(TmfTraceTypeUIUtils.EVENTS_TABLE_TYPE_ELEM);
if (eventsTableTypeCE.length != 1) {
break;
}
- final String eventsTableType = eventsTableTypeCE[0].getAttribute(TmfTraceType.CLASS_ATTR);
+ final String eventsTableType = eventsTableTypeCE[0].getAttribute(TmfTraceTypeUIUtils.CLASS_ATTR);
if ((eventsTableType == null) || (eventsTableType.length() == 0)) {
break;
}
if (commonTraceType.startsWith(CustomXmlTrace.class.getCanonicalName())) {
return new CustomEventsTable(((CustomXmlTrace) experiment.getTraces()[0]).getDefinition(), parent, cacheSize);
}
- for (final IConfigurationElement ce : TmfTraceType.getTypeElements()) {
- if (ce.getAttribute(TmfTraceType.ID_ATTR).equals(commonTraceType)) {
- final IConfigurationElement[] eventsTableTypeCE = ce.getChildren(TmfTraceType.EVENTS_TABLE_TYPE_ELEM);
+ for (final IConfigurationElement ce : TmfTraceTypeUIUtils.getTypeUIElements()) {
+ if (ce.getAttribute(TmfTraceTypeUIUtils.TRACETYPE_ATTR).equals(commonTraceType)) {
+ final IConfigurationElement[] eventsTableTypeCE = ce.getChildren(TmfTraceTypeUIUtils.EVENTS_TABLE_TYPE_ELEM);
if (eventsTableTypeCE.length != 1) {
break;
}
- final String eventsTableType = eventsTableTypeCE[0].getAttribute(TmfTraceType.CLASS_ATTR);
+ final String eventsTableType = eventsTableTypeCE[0].getAttribute(TmfTraceTypeUIUtils.CLASS_ATTR);
if ((eventsTableType == null) || (eventsTableType.length() == 0)) {
break;
}
// The mapping of available trace type IDs to their corresponding
// configuration element
private static final Map<String, IConfigurationElement> sfTraceTypeAttributes = new HashMap<>();
+ private static final Map<String, IConfigurationElement> sfTraceTypeUIAttributes = new HashMap<>();
private static final Map<String, IConfigurationElement> sfTraceCategories = new HashMap<>();
/**
* extension registry.
*/
public static void init() {
+ /* Read the tmf.core "tracetype" extension point */
IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(TmfTraceType.TMF_TRACE_TYPE_ID);
for (IConfigurationElement ce : config) {
- String elementName = ce.getName();
- if (elementName.equals(TmfTraceType.TYPE_ELEM)) {
+ switch (ce.getName()) {
+ case TmfTraceType.TYPE_ELEM:
String traceTypeId = ce.getAttribute(TmfTraceType.ID_ATTR);
sfTraceTypeAttributes.put(traceTypeId, ce);
- } else if (elementName.equals(TmfTraceType.CATEGORY_ELEM)) {
+ break;
+ case TmfTraceType.CATEGORY_ELEM:
String categoryId = ce.getAttribute(TmfTraceType.ID_ATTR);
sfTraceCategories.put(categoryId, ce);
+ break;
+ default:
+ }
+ }
+
+ /*
+ * Read the corresponding tmf.ui "tracetypeui" extension point for this
+ * trace type, if it exists.
+ */
+ config = Platform.getExtensionRegistry().getConfigurationElementsFor(TmfTraceTypeUIUtils.TMF_TRACE_TYPE_UI_ID);
+ for (IConfigurationElement ce : config) {
+ String elemName = ce.getName();
+ if (TmfTraceTypeUIUtils.TYPE_ELEM.equals(elemName)) {
+ String traceType = ce.getAttribute(TmfTraceTypeUIUtils.TRACETYPE_ATTR);
+ sfTraceTypeUIAttributes.put(traceType, ce);
}
}
}
if (fTraceTypeId.startsWith(CustomXmlTrace.class.getCanonicalName())) {
return TmfEventsEditor.ID;
}
- IConfigurationElement ce = sfTraceTypeAttributes.get(fTraceTypeId);
- IConfigurationElement[] defaultEditorCE = ce.getChildren(TmfTraceType.DEFAULT_EDITOR_ELEM);
+ IConfigurationElement ce = sfTraceTypeUIAttributes.get(fTraceTypeId);
+ if (ce == null) {
+ /* This trace type does not define UI attributes */
+ return null;
+ }
+ IConfigurationElement[] defaultEditorCE = ce.getChildren(TmfTraceTypeUIUtils.DEFAULT_EDITOR_ELEM);
if (defaultEditorCE.length == 1) {
return defaultEditorCE[0].getAttribute(TmfTraceType.ID_ATTR);
}
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.TreeSet;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.core.TmfCommonConstants;
import org.eclipse.linuxtools.tmf.core.project.model.TmfTraceImportException;
*/
public final class TmfTraceTypeUIUtils {
+ /** Extension point ID */
+ public static final String TMF_TRACE_TYPE_UI_ID = "org.eclipse.linuxtools.tmf.ui.tracetypeui"; //$NON-NLS-1$
+
+ /** Extension point element 'type' (should match the type in TmfTraceType) */
+ public static final String TYPE_ELEM = "type"; //$NON-NLS-1$
+
+ /** Extension point element 'Default editor' */
+ public static final String DEFAULT_EDITOR_ELEM = "defaultEditor"; //$NON-NLS-1$
+
+ /** Extension point element 'Events table type' */
+ public static final String EVENTS_TABLE_TYPE_ELEM = "eventsTableType"; //$NON-NLS-1$
+
+ /** Extension point attribute 'tracetype' */
+ public static final String TRACETYPE_ATTR = "tracetype"; //$NON-NLS-1$
+
+ /** Extension point attribute 'icon' */
+ public static final String ICON_ATTR = "icon"; //$NON-NLS-1$
+
+ /** Extension point attribute 'class' (attribute of eventsTableType) */
+ public static final String CLASS_ATTR = "class"; //$NON-NLS-1$
+
private static final String DEFAULT_TRACE_ICON_PATH = "icons" + File.separator + "elcl16" + File.separator + "trace.gif"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
private static final char SEPARATOR = ':';
*/
public static IStatus setTraceType(IPath path, TraceTypeHelper traceType) throws CoreException {
IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
- String traceBundle = null, traceTypeId = traceType.getCanonicalName(), traceIcon = null;
+ String traceBundle = null;
+ String traceTypeId = traceType.getCanonicalName();
+ String traceIcon = DEFAULT_TRACE_ICON_PATH;
+
if (isCustomTraceId(traceTypeId)) {
traceBundle = Activator.getDefault().getBundle().getSymbolicName();
- traceIcon = DEFAULT_TRACE_ICON_PATH;
} else {
IConfigurationElement ce = TmfTraceType.getInstance().getTraceAttributes(traceTypeId);
traceBundle = ce.getContributor().getName();
- traceIcon = ce.getAttribute(TmfTraceType.ICON_ATTR);
+ }
+
+ /* Check if there is an icon defined in tmftracetypeui */
+ IConfigurationElement ce = getTraceUIAttributes(traceTypeId);
+ if (ce != null) {
+ traceIcon = ce.getAttribute(TmfTraceTypeUIUtils.ICON_ATTR);
}
resource.setPersistentProperty(TmfCommonConstants.TRACEBUNDLE, traceBundle);
tmfProject.refresh();
return Status.OK_STATUS;
}
+
+ /**
+ * Retrieves all configuration elements from the platform extension registry
+ * for the trace type UI extension.
+ *
+ * @return An array of trace type configuration elements
+ */
+ public static IConfigurationElement[] getTypeUIElements() {
+ IConfigurationElement[] elements =
+ Platform.getExtensionRegistry().getConfigurationElementsFor(TMF_TRACE_TYPE_UI_ID);
+ List<IConfigurationElement> typeElements = new LinkedList<>();
+ for (IConfigurationElement element : elements) {
+ if (element.getName().equals(TYPE_ELEM)) {
+ typeElements.add(element);
+ }
+ }
+ return typeElements.toArray(new IConfigurationElement[typeElements.size()]);
+ }
+
+ /**
+ * Get the UI elements for the given trace type
+ *
+ * @param traceType
+ * The tracetype ID
+ * @return The top-level configuration element (access its children with
+ * .getChildren()). Or null if there is no such element.
+ */
+ @Nullable
+ public static IConfigurationElement getTraceUIAttributes(String traceType) {
+ IConfigurationElement[] elements = getTypeUIElements();
+ for (IConfigurationElement ce : elements) {
+ if (traceType.equals(ce.getAttribute(TRACETYPE_ATTR))) {
+ return ce;
+ }
+ }
+ return null;
+ }
}
package org.eclipse.linuxtools.tmf.ui.views.statistics;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.linuxtools.tmf.core.project.model.TmfTraceType;
import org.eclipse.linuxtools.tmf.core.signal.TmfSignalHandler;
import org.eclipse.linuxtools.tmf.core.signal.TmfTraceClosedSignal;
import org.eclipse.linuxtools.tmf.core.signal.TmfTraceOpenedSignal;
import org.eclipse.linuxtools.tmf.core.signal.TmfTraceRangeUpdatedSignal;
import org.eclipse.linuxtools.tmf.core.signal.TmfTraceSelectedSignal;
import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
-import org.eclipse.linuxtools.tmf.core.trace.TmfTraceManager;
import org.eclipse.linuxtools.tmf.ui.viewers.ITmfViewer;
import org.eclipse.linuxtools.tmf.ui.viewers.statistics.TmfStatisticsViewer;
import org.eclipse.linuxtools.tmf.ui.views.TmfView;
TmfStatisticsViewer globalViewer = new TmfStatisticsViewer(folder, Messages.TmfStatisticsView_GlobalTabName + " - " + fTrace.getName(), fTrace); //$NON-NLS-1$
fStatsViewers.addTab(globalViewer, Messages.TmfStatisticsView_GlobalTabName, defaultStyle);
- // Creates a statistics viewer for each trace.
- for (ITmfTrace trace : TmfTraceManager.getTraceSet(fTrace)) {
- String traceName = trace.getName();
- IResource traceResource = trace.getResource();
- TmfStatisticsViewer viewer = getStatisticsViewer(traceResource);
- /*
- * Adds a new viewer only if there is one defined for the
- * selected trace type, since the global tab already contains
- * all the basic event counts for the trace(s)
- */
- if (viewer != null) {
- viewer.init(folder, traceName, trace);
- fStatsViewers.addTab(viewer, viewer.getName(), defaultStyle);
- }
- }
} else {
// There is no trace selected. Shows an empty global tab
TmfStatisticsViewer globalViewer = new TmfStatisticsViewer(folder, Messages.TmfStatisticsView_GlobalTabName, fTrace);
// Makes the global viewer visible
fStatsViewers.setSelection(0);
}
-
- /**
- * Retrieves and instantiates a viewer based on his plug-in definition for a
- * specific trace type. It is specific to the statistics viewer.
- *
- * It only calls the 0-parameter constructor without performing any other
- * initialization on the viewer.
- *
- * @param resource
- * The resource where to find the information about the trace
- * properties
- * @return a new statistics viewer based on his plug-in definition, or null
- * if no statistics definition was found for the trace type.
- * @since 2.0
- */
- protected static TmfStatisticsViewer getStatisticsViewer(IResource resource) {
- return (TmfStatisticsViewer) TmfTraceType.getTraceTypeElement(resource, TmfTraceType.STATISTICS_VIEWER_ELEM);
- }
}