///////////////////////////////////////////////////////////////
//
// RE-INITIALIZE BEAN TOOLS PLUGIN
//
// IF YOU PUT A NEW SCRIPT FILE INTO THE BeanTools DIR,
// RUN THIS SCRIPT INSTEAD OF RESTARTING OPEN JUMP
//
// Michael Michaud 2007-03-15
//
///////////////////////////////////////////////////////////////

// import statements
import com.vividsolutions.jump.workbench.ui.MenuNames;
import com.vividsolutions.jump.I18N;
import org.openjump.core.ui.plugin.customize.BeanToolsPlugIn;
import com.vividsolutions.jump.workbench.ui.plugin.FeatureInstaller;

// Remove the BeanTools menu
context = wc.createPlugInContext();
featureInstaller = context.getFeatureInstaller();
menuCustom = featureInstaller.menuBarMenu(I18N.JUMP.get(MenuNames.CUSTOMIZE));
item = featureInstaller.childMenuItem(BeanToolsPlugIn.NAME, FeatureInstaller.wrapMenu(menuCustom));
// empty menu item, instead of removal to keep position
item.removeAll();

// Reinitialize the plugin
plugin = new BeanToolsPlugIn();
plugin.initialize(context);