My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
PluginDeveloperGuide  
Hawkscope Plugin Developer Guide
Phase-Implementation
Updated Feb 4, 2010 by tomas.va...@gmail.com

So, you want to write a Hawkscope Plugin? You are in a right place then.

Required Knowledge

Anatomy of a Plugin

Hawkscope Plugin is a Java JAR file, which contains:

  • plugin.loader - a plain-text file with fully qualified class name of main plugin class.
  • Java Class that implements com.varaneckas.hawkscope.plugin.Plugin interface. For convenience, it is recommended to extend PluginAdapter, which allows you to implement only the functionality you will need.
  • Image resources in "images" folder. (optional)
  • Any other Java classes or resources. (optional)

Hawkscope plugins should be compiled with Java 1.5 compatibility.

The Bare Minimum

plugin.loader

bare.MinimumPlugin

bare/MinimumPlugin.java

package bare;

import com.varaneckas.hawkscope.plugin.PluginAdapter;

class MinimumPlugin extends PluginAdapter {
    
    public String getDescription() {
        return "Bare Minimum Plugin";
    }

    public String getName() {
        return "Bare Minimum";
    }

    public String getVersion() {
        return "1.0";
    }
}

Extension Points

There are several extension points that plugins can hook into.

Before Quick Access List

Can add menu items on the very top of main Hawkscope menu.

Before About Menu Item

Can add menu items between Hide and About.

Quick Access List Item creation

Can enhance Quick Access List items while they are rendered.

Folder Menu creation

Can enhance Folder Menu items when they are rendered.

File Menu Item creation

Can enhance File items when they are rendered.

File Menu Item click interception

Can intercept File clicks and take various actions.

Settings Tabs

Can add tabs to Settings Window's Tab folder.

Example Plugin

You can browse Open With built-in plugin source for a sophisticated plugin example.

Another good example - Twitter plugin.

Where to start?

  1. Checkout or Download Hawkscope source, analyze it. Read BuildingHawkscope.
  2. If you are using Eclipse, create an Eclipse project for Hawkscope source. Otherwise build a hawkscope.jar - you will need it for building your plugin.
  3. Create a Java project in your IDE. If it's Eclipse, reference the Hawkscope project to your plugin's new project. Otherwise add hawkscope.jar to a list of referenced libraries.
  4. Create a class that extends PluginAdapter.
  5. Create a plain-text file named plugin.loader and put your plugins fully qualified class name there.
  6. Code your plugin.
  7. Build the JAR. (Compile the classes with Java 1.5 compatibility!)
  8. Try it.

More documentation is coming soon.


Sign in to add a comment
Powered by Google Project Hosting