This sample demonstrates how to extend application context support for Trace UI artifacts (statistical views, graphical views, and filter support dialogs).
If you have not already done so, create the example by File > New > Example... > Context Language Sample.
The "application context" system lets the profiling views display data using the proper terms no matter what kind of data was collected. For example, the Java term "method," the C term "function," and the Fortran term "procedure" all mean to the same thing. If you collect data from a C program, you want to display the data using C terms and syntax. The application context system lets you do that.
This sample builds a plug-in that registers an application context formatter for the "C/C++" context. It provides terms that the views can use in table headers and other places, and it provides a syntax formatter for displaying namespace names (using the C++ separator "::" instead of the Java separator ".").
The sample contains code for simple extensions to the context sensitive support. The Package, Class, and Method structure used in Java are replaced by C/C++ structures in various locations, such as in the view header, formatting, and filter dialog.
The sample contains the following elements which contribute to the context sensitive extension available in TPTP:
plugin.xml: Contains the extension point for the C/C++ context definition, the C/C++ context provider declaration, as well as C/C++ context open source action.
org.eclipse.tptp.context.sample.clanguage.CContextProvider: This is the context formatter that is declared in plugin.xml, which mainly describes a format provider in a C/C++ context for the TPTP profiling view attribute replacement.
org.eclipse.tptp.context.sample.clanguage.ContextOpenSourceProviderSample: This is a C/C++ context sensitive open source action provider.
org.eclipse.tptp.context.sample.clanguage.*Formatter: Various formatters are available from the context provider when querying for C/C++ context sensitive label and formatter support.
The following procedure outlines the steps needed to view the contributions to the TPTP views made by this sample extension:
(C) Copyright IBM Corporation 2005, 2007. All Rights Reserved.