We need to do a number of things well:
- Creating a plugin
- plugin internationalization
- tracing
- resources: internationalization bundles
- resources: icons
Creating a Plugin
Check:
|
plugin name |
|
subversion |
|
user interface or core |
Start with File > New and select New Plugin Project from the list
Page 1
- Project Name: (one of)
- org.group.project.xxx - for domain model (ie can run in headless mode)
- org.group.project.xxx.ui - for user interface
- Project contents: create the plugin in the correct directory on your local filesystem
- Project Settings: normal you are making a java project
- Plugin Format
- Target: 3.1
- OSGi Bundle: Yes! - will make a nice jar for use with webstart
- Next
Page 2
- Properties
- ID: defaults to project name - cool
- Version: 0.1 - start low and use 1.0 for your first release
- Name: XXX - you need to internationlize this anyways
- Provider: Your Organization here - tempting to use your own name but will screw up the branding plugin
- Classpath: leave empty for fear of classloader
- Generate?
- No - if you do not need to obtain or free resources (this is a lifecycle callback)
- Yes - if you need to get at internationalization bundle or icons or connect to a service
- class: (public) org.group.project.plugin.XXXPlugin
- class: (private) org.group.project.plugin.internal.XXXPlugin if nobody needs to talk to you
- User Interface? If you need to set up a user interface this will give you AbstractUIPlugin
- RCP: not often
Page 3
- Template: not usually, although view or property page may be fun
What could go wrong!
Q: I did not create it in an svn directory
That was silly:
- Right click > Team > Share and choose SVN from the list
- Choose the correct location from the list
- Use a specified folder name: (now you did not follow instructions once so pay attention)
- type in the rest of the path exactly right: PATHTO/trunk/PROJECT/plugins/EXACTNAMEOFPLUGIN
- delete your project, svn update in your filesystem, and then import the project in again
 |
You can add the plugins directory to your svn repository locations and just do:
- select your plugins repo location
- Use project name as folder name
|
Plugin Internationalization
Create plugin.properties:
Ensure that the MANIFEST.MF file actually has:
Tracing
The EclipseRCP lets you set tracing levels using a "drop in" file.
- create a ".options" file with a bunch of keys
- Copy in the following methods into your Plugin file.
- You can change the values in the file, or using the Run... interface.
Resource Bundles
Copy a Policy class into your plugin, this class will provide helper methods for most useful things.
You will need to get your feed in the bundle and clean up afterwards.
Resource Icons
Icons are much harder, once again there is a Helper classe, Images, that you can copy.
The icons are actually managed by AbstractUIPlugin.