Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Extending Eclipse monitoring, profiling, and testing functions
Previous Page Home Next Page

Working with the Filter Type sample

This sample demonstrates how to dynamically create a new filter type using the extension point org.eclipse.hyades.ui.filterTypes.

If you have not already done so, create the example by File > New > Example... > Filter Type Sample.

The sample provides a filter type with id org.eclipse.tptp.filtertype.extension.sample.SampleFilterType defined in the plugin.xml file. This filter type has the standard tab implementation provided by org.eclipse.tptp.filtertype.extension.sample.filter.definitions.SampleFilterStandardTabUI and the advanced tab UI implementation provided by org.eclipse.tptp.filtertype.extension.sample.filter.definitions.SampleAdvancedTabAttributeSet. The sample also provides a simple view implemented in org.eclipse.tptp.filtertype.extension.sample.views.FilterTypeSampleView in which this sample filter type is applicable. The filter type is defined with the scope "FilterTypeSampleScope", as is the sample view which makes the filter applicable to the view.

This sample view shows a list of the packages for the object selected when it is opened. The view filtering can then be applied to this list of packages. The sample filter type definition has a simple standard tab with one text field for the package name and and an option to select whether or no the filter should be case sensitive. The advanced tab has three filter attributes defined. Two of these attributes are the method name and class name, if used the packages will be returned that contain these attributes. The third attribute visible in the advanced tab is a sample filter attribute. This sample filter attribute is provided by org.eclipse.tptp.filtertype.extension.sample.filter.definitions.SampleFilterAttribute.

The classes provided for implementing or extending the API required for view filtering are:

  • org.eclipse.tptp.filtertype.extension.sample.filter.definitions.SampleFilterStandardTabUI extends org.eclipse.hyades.ui.filters.FiltersStandardTabUI
  • org.eclipse.tptp.filtertype.extension.sample.filter.definitions.SampleAdvancedTabAttributeSet implements org.eclipse.hyades.ui.filters.IAdvancedTabAttributeSet
  • org.eclipse.tptp.filtertype.extension.sample.filter.definitions.SampleFilterAttribute implements org.eclipse.hyades.ui.filters.IFilterAttribute
  • org.eclipse.tptp.filtertype.extension.sample.views.FilterTypeSampleView implements org.eclipse.hyades.ui.filters.IFilterViewer

The following procedure outlines the steps required to view the sample filter type in the sample view:

  1. Launch an instance of a runtime workbench by selecting Run > Run As > Eclipse Application.
  2. Populate the Profiling Monitor view by either profiling an application or importing a profiling file.
  3. Right click on an item in the view and select Open With then select Open Filter Type Sample View to open the sample view.
  4. At the top of the view, the filter action is available. Filters of this sample filter type can be created and selected from the drop down menu in the view.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire