





How to make our code work will be described in the sections:/* * created on 04.10.2005 * last modified: 05.10.2005 comments added * * author: sstein * **/ package ch.unizh.geo.degen; import com.vividsolutions.jump.workbench.WorkbenchContext; import com.vividsolutions.jump.workbench.plugin.AbstractPlugIn; import com.vividsolutions.jump.workbench.plugin.EnableCheckFactory; import com.vividsolutions.jump.workbench.plugin.MultiEnableCheck; import com.vividsolutions.jump.workbench.plugin.PlugInContext; import com.vividsolutions.jump.workbench.ui.plugin.FeatureInstaller; /** * @description: * testplugin for jump<p> * shows hello world - window in Jump * * @author sstein * */ public class HelloWorldPlugIn extends AbstractPlugIn{ public HelloWorldPlugIn() { // empty constructor } public void initialize(PlugInContext context) throws Exception { FeatureInstaller featureInstaller = new FeatureInstaller(context.getWorkbenchContext()); featureInstaller.addMainMenuItem( this, //exe new String[] {"View"}, //menu path this.getName(), //name methode .getName recieved by AbstractPlugIn false, //checkbox null, //icon createEnableCheck(context.getWorkbenchContext())); //enable check } public static MultiEnableCheck createEnableCheck(WorkbenchContext workbenchContext) { EnableCheckFactory checkFactory = new EnableCheckFactory(workbenchContext); return new MultiEnableCheck() .add(checkFactory.createWindowWithLayerNamePanelMustBeActiveCheck()); } /** * Action on menu item selection: * creates doc to show */ public boolean execute(PlugInContext context) throws Exception{ context.getWorkbenchFrame().getOutputFrame().createNewDocument(); context.getWorkbenchFrame().getOutputFrame().addText("Hello, World!"); context.getWorkbenchFrame().getOutputFrame().surface(); return true; } }