Java Element Filters Tutorial
To define your own filters, please follow these steps:
- Switch to a new installation of Eclipse in a new workspace
- Install AgileJ StructureViews from the update site http://www.agilej.com/structureViews
- Select New - Project - Plugin Project
- Give your new project a name such as MyJavaElementFilters and click Next
- Deselect This plug-in will make contributions to the UI and click Next
- Deselect Create a plug-in using one of the templates and click Finish
- The Overview editor is shown
- On the dependencies tab click Add...
- Select org.eclipse.jdt.core and click OK
- Repeat for com.agilej.filters.common, com.agilej.filters.api, com.agilej.model.impl and com.agilej.model.common
- Click the Extensions tab
- Click Add...
- Select com.agilej.filters.api and click OK
- Right click on com.agilej.filters.api and select New - client
- Select File - Save (this step is important for the next step to work correctly)
- Click on the link class*
- The New Class wizard will open
- Click Finish
- The Java source editor will open
An example implementation of a filter is also shown on the example implementation page.
Testing your new filters
Finally, when you have implemented your filter provider and one or more new filters, you can test then by selecting Run - Debug Configurations. Right click on Eclipse Application and give the configuration a meaningful name such as Filter Test.
Press the File System...button and navigate to the root of your normal development workspace.
Press Debug to launch a new instance of Eclipse. The quickest way to check that your new filter is available is to open a class diagram and open the filter script view. Ctrl+Space will now show your new filter listed.
Copyright © AgileJ Ltd. All rights reserved.