Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » BeanInfos of custom Bean not read
BeanInfos of custom Bean not read [message #120134] Tue, 07 March 2006 16:03 Go to next message
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;
}
}
Re: BeanInfos of custom Bean not read [message #120161 is a reply to message #120134] Tue, 07 March 2006 17:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Couple of things:

1) First, don't use the same package for MyPanelBeanInfo as for MyPanel.
Even though that should work, it causes other problems. Put them in a
different package.

2) In the <searchpath package="..." the package should be the package
that MyPanelBeanInfo is in. Also, MyPanelBeanInfo must be in the
beanInfo.jar, which should be a separate jar from where MyPanel is in.

3) Are you running a deployed plugin (i.e all built with beanInfo.jar in
the plugin root directory) or are you trying to do this from a
development environment? In development, unless you use the proxy.jars
file to point to the bin output directory where you have the beanInfo
being built into at development time it won't be able to find the
MyPanelBeanInfo.

4) Also what is in the override file for MyPanel?

After these are taken care you'll need to see if there are any .log
errors and fix those, and then finally you'll need to do some debugging
to see if the search path, classpath are set up correctly for the
beaninfo and if it returns that it found it.
--
Thanks,
Rich Kulp
Re: BeanInfos of custom Bean not read [message #120260 is a reply to message #120161] Thu, 09 March 2006 07:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bakito.gmx.net

Hi

I fugured out the problem. The classpath container was wrong and so the
beaninfo classes where not found. I put the beaininfo classes now in
another package.

The overrides directory is currently empty because i do not realy know
how define them. Is there any documentation on how to create override files.

My goal is to extend the swing components with an interface that defines
specific attribute. a user for example. for this user attribute i
want to writ a custom cell editor. how is this done.

thanks bakito



Rich Kulp wrote:
> Couple of things:
>
> 1) First, don't use the same package for MyPanelBeanInfo as for MyPanel.
> Even though that should work, it causes other problems. Put them in a
> different package.
>
> 2) In the <searchpath package="..." the package should be the package
> that MyPanelBeanInfo is in. Also, MyPanelBeanInfo must be in the
> beanInfo.jar, which should be a separate jar from where MyPanel is in.
>
> 3) Are you running a deployed plugin (i.e all built with beanInfo.jar in
> the plugin root directory) or are you trying to do this from a
> development environment? In development, unless you use the proxy.jars
> file to point to the bin output directory where you have the beanInfo
> being built into at development time it won't be able to find the
> MyPanelBeanInfo.
>
> 4) Also what is in the override file for MyPanel?
>
> After these are taken care you'll need to see if there are any .log
> errors and fix those, and then finally you'll need to do some debugging
> to see if the search path, classpath are set up correctly for the
> beaninfo and if it returns that it found it.
Re: BeanInfos of custom Bean not read [message #120284 is a reply to message #120260] Thu, 09 March 2006 15:11 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

The tutorial on extending the VE has an example of the overrides.

--
Thanks,
Rich Kulp
Re: BeanInfos of custom Bean not read [message #612279 is a reply to message #120134] Tue, 07 March 2006 17:03 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Couple of things:

1) First, don't use the same package for MyPanelBeanInfo as for MyPanel.
Even though that should work, it causes other problems. Put them in a
different package.

2) In the <searchpath package="..." the package should be the package
that MyPanelBeanInfo is in. Also, MyPanelBeanInfo must be in the
beanInfo.jar, which should be a separate jar from where MyPanel is in.

3) Are you running a deployed plugin (i.e all built with beanInfo.jar in
the plugin root directory) or are you trying to do this from a
development environment? In development, unless you use the proxy.jars
file to point to the bin output directory where you have the beanInfo
being built into at development time it won't be able to find the
MyPanelBeanInfo.

4) Also what is in the override file for MyPanel?

After these are taken care you'll need to see if there are any .log
errors and fix those, and then finally you'll need to do some debugging
to see if the search path, classpath are set up correctly for the
beaninfo and if it returns that it found it.
--
Thanks,
Rich Kulp
Re: BeanInfos of custom Bean not read [message #612287 is a reply to message #120161] Thu, 09 March 2006 07:30 Go to previous message
Eclipse UserFriend
Originally posted by: bakito.gmx.net

Hi

I fugured out the problem. The classpath container was wrong and so the
beaninfo classes where not found. I put the beaininfo classes now in
another package.

The overrides directory is currently empty because i do not realy know
how define them. Is there any documentation on how to create override files.

My goal is to extend the swing components with an interface that defines
specific attribute. a user for example. for this user attribute i
want to writ a custom cell editor. how is this done.

thanks bakito



Rich Kulp wrote:
> Couple of things:
>
> 1) First, don't use the same package for MyPanelBeanInfo as for MyPanel.
> Even though that should work, it causes other problems. Put them in a
> different package.
>
> 2) In the <searchpath package="..." the package should be the package
> that MyPanelBeanInfo is in. Also, MyPanelBeanInfo must be in the
> beanInfo.jar, which should be a separate jar from where MyPanel is in.
>
> 3) Are you running a deployed plugin (i.e all built with beanInfo.jar in
> the plugin root directory) or are you trying to do this from a
> development environment? In development, unless you use the proxy.jars
> file to point to the bin output directory where you have the beanInfo
> being built into at development time it won't be able to find the
> MyPanelBeanInfo.
>
> 4) Also what is in the override file for MyPanel?
>
> After these are taken care you'll need to see if there are any .log
> errors and fix those, and then finally you'll need to do some debugging
> to see if the search path, classpath are set up correctly for the
> beaninfo and if it returns that it found it.
Re: BeanInfos of custom Bean not read [message #612289 is a reply to message #120260] Thu, 09 March 2006 15:11 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

The tutorial on extending the VE has an example of the overrides.

--
Thanks,
Rich Kulp
Previous Topic:Extract the editpart for a specific component
Next Topic:Collapsing horizontal bar in VE
Goto Forum:
  


Current Time: Thu Apr 25 17:07:44 GMT 2024

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

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

Back to the top