70 likes | 177 Views
HW #5. Assignment. 1. Add a "LoD checker properties" page.
E N D
Assignment • 1. Add a "LoD checker properties" page. Any Java project should have "LoD checker properties" page. Make sure it appears only for Java projects. The properties page is the nerve center where the user can choose which version of the LoD should be checked. Offer the capabilities you implemented in hw 4, e.g. defining stable classes. • 2. Add AspectJ project nature. If a Java project does not have AspectJ nature and the LoD checker is enabled, add the AspectJ nature to the project.You need to deal with the AspectJ plug-in when compiling the project. At this point find out how to deal with project natures and how to save information between start-ups and shutdowns of the Platform.
What does it mean? • You need to create a “Property Page”, that • is visible only for projects labeled with Java nature. • contains all the necessary widgets for tuning your checker for the selected project. • is AspectJ plug-in aware. • attaches/detaches checker source code files on enabling/disabling checker. • treats all the properties as persistent
What to do. Manifest file. • Write your plug-in manifest file (plug-in.xml) that defines extension to the org.eclipse.ui.propertyPages extension point. Hints: • See the extension points reference in the Plug-in the Plug-in Developer documentation at eclipse.org • To find out how to associate your extension with Java Nature projects look at the manifest files for existing plugins (example – AspectJ plugin) • Don’t forget to define all the plug-ins your plug-in uses (import tag of the manifest file).
What to do. Implementation. • Write Java implementation class containing all the necessary logic. • Read Preferences and properties section of the Plug-In Developer guide • Use documentation (API reference) !!! • Take a close look at resources API (org.eclipse.core.resources)!!! • Take a close look at SWT API (org.eclipse.swt.widgets) • In order to find out how to operate Java kind of resources – look at JDT Plug-in Developer Guide, API reference (org.eclipse.jdt.core) (you’ll need it in the stage of attaching your checker files to the project)
More on implementation. • Don’t forget to add AspectJ project nature to the project if necessary. (resources API) Remember – your checker uses AspectJplug-in and can be applied to any Java project. • Don’t forget to remove AspectJ project nature if it’s possible and user don’t need it any more. (if project had AspectJ nature before first use of the checker – we cannot remove AspectJ nature from the project) • Keep your checker files in the plug-in directory (they comes with your plugin). Copy them to a current project directory when enabling checker.
Any questions? Ask ME Sergei Kojarski kojarski@ccs.neu.edu