Skip to end of metadata
Go to start of metadata


The designer hook class of a module that adds Vision module properties has two main functions:

  1. Add the beaninfo search path
  2. Add the components themselves into the Vision Palette.


To get the Palette, you'll need to grab the Vision module's VisionDesignerInterface. You can do this through the DesignerContext. Once you have the VisionDesignerInterface, you can get the palette and make your own PaletteItemGroup. You'll add all of your components to this item group.

An example should make this clear:  

public class MyModuleDesignerHook extends AbstractDesignerModuleHook { 
	public void startup(DesignerContext context, LicenseState activationState) throws Exception {
		context.addBeanInfoSearchPath("com.example.mymodule.beaninfos"); 
		VisionDesignerInterface sdk = (VisionDesignerInterface) context.getModule(VisionDesignerInterface.VISION_MODULE_ID);
		if (sdk != null) {
			Palette palette = sdk.getPalette(); 
			PaletteItemGroup group = palette.addGroup("MyModule");
			group.addPaletteItem(new JavaBeanPaletteItem(MyGreatChart.class));
			group.addPaletteItem(new JavaBeanPaletteItem(SomeOtherComponent.class)); 

		}
	} 
}


 


 

  • No labels