01: package de.latlon.deejump.plugin.manager;
02:
03: import javax.swing.ImageIcon;
04:
05: import com.vividsolutions.jump.workbench.plugin.AbstractPlugIn;
06: import com.vividsolutions.jump.workbench.plugin.Extension;
07: import com.vividsolutions.jump.workbench.plugin.PlugInContext;
08:
09: public class DummyExtension extends Extension {
10:
11: public void configure(PlugInContext context) throws Exception {
12: new DummyPlugIn().install(context);
13: }
14:
15: public String getName() {
16: return "Dummy extension";
17: }
18:
19: static class DummyPlugIn extends AbstractPlugIn {
20:
21: public boolean execute(PlugInContext context) throws Exception {
22: System.out.println("dummy has been clicked:");
23: return true;
24: }
25:
26: public void install(PlugInContext context) throws Exception {
27:
28: context.getWorkbenchContext().getWorkbench().getFrame()
29: .getToolBar().addPlugIn(getIcon(), this , null,
30: context.getWorkbenchContext());
31: }
32:
33: public ImageIcon getIcon() {
34: return new ImageIcon(getClass().getResource("refresh.png"));
35: }
36:
37: }
38:
39: }
|