Skip to main content



      Home
Home » Archived » Visual Editor (VE) » BeanInfos of custom Bean not read
BeanInfos of custom Bean not read [message #612277] Tue, 07 March 2006 11:03
Eclipse UserFriend
Originally posted by: bakito.gmx.net

Hi

i Want to extend the VE palette with a custom one to contain my own
beans. I wrote a BeanInfo class for my Beans and configured them in the
plugin.xml file.

Whe i test the palette, my beans are shown in the custom palette but the
propertydescriptor from the BeanInfo class are not applied.

Can somenone tell me what went wrong?

Thanks for an answer.

Bakito

################# extension point fin plugin.xml ############

<extension
point="org.eclipse.jem.beaninfo.registrations">
<registration
container="MY_CONTAINER">
<beaninfo
path="beanInfo.jar">
<searchpath
package="my.beans">
</searchpath>
</beaninfo>

<override
package="my.beans"
path="overrides/my/beans">
</override>
</registration>
</extension>

################# BeanInfo class ############

public class MyPanelBeanInfo extends SimpleBeanInfo
implements BeanInfo
{
public int getDefaultEventIndex()
{ return 0; }

public int getDefaultPropertyIndex()
{ return 0; }

public Image getIcon(int iconKind)
{ return null; }

public BeanDescriptor getBeanDescriptor()
{ return null; }

public BeanInfo[] getAdditionalBeanInfo()
{
try
{
return new BeanInfo[]
{ Introspector.getBeanInfo(JPanel.class) };
}
catch (IntrospectionException e)
{
return new BeanInfo[0];
}
}

public EventSetDescriptor[] getEventSetDescriptors()
{ return null; }

public MethodDescriptor[] getMethodDescriptors()
{ return null; }

public PropertyDescriptor[] getPropertyDescriptors()
{
PropertyDescriptor[] descs = new PropertyDescriptor[1];

try
{
descs[0] = new PropertyDescriptor("myHeader", MyPanel.class);
descs[0].setValue("enumerationValues", new Object[]
{ "a", MyPanel.HELLO, "my.beans.MyPanel.HELLO", "b",
MyPanel.TITLE, "my.beans.MyPanel.TITLE" });
}
catch (IntrospectionException e)
{
e.printStackTrace();
}
return null;
}
}
Previous Topic:Source code jumps
Next Topic:swingX for VE
Goto Forum:
  


Current Time: Tue Jun 17 08:04:23 EDT 2025

Powered by FUDForum. Page generated in 0.05179 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top