Dashboard > Guided Tour > Home > Plugin Tour
Plugin Tour Log In | Sign Up   View a printable version of the current page.

Added by Administrator , last edited by Administrator on Apr 07, 2006
Labels: 
(None)

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

  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
  2. Project contents: create the plugin in the correct directory on your local filesystem
  3. Project Settings: normal you are making a java project
  4. Plugin Format
    • Target: 3.1
    • OSGi Bundle: Yes! - will make a nice jar for use with webstart
  5. Next

Page 2

  1. 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
  2. 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
  3. RCP: not often

Page 3

  1. 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:

  1. Right click > Team > Share and choose SVN from the list
  2. Choose the correct location from the list
  3. 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
  4. 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:

  1. select your plugins repo location
  2. Use project name as folder name

Plugin Internationalization

Create plugin.properties:

plugin.properties

pluginName=XXX UI Plugin

Ensure that the MANIFEST.MF file actually has:

  • Name: %pluginName

Tracing

The EclipseRCP lets you set tracing levels using a "drop in" file.

  1. create a ".options" file with a bunch of keys
  2. Copy in the following methods into your Plugin file.
  3. 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.

Powered by a free Atlassian Confluence Open Source Project License granted to uDig. Evaluate Confluence today.
Powered by Atlassian Confluence 2.7.1, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators
User-friendly Desktop Internet GIS