Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » Extending the palette with custom widgets [Eclipse 3.2, VE 1.2]
Extending the palette with custom widgets [Eclipse 3.2, VE 1.2] [message #135721] Mon, 12 February 2007 11:26 Go to next message
Sébastien Alonzo is currently offline Sébastien AlonzoFriend
Messages: 94
Registered: July 2009
Member
Hi,

I want to extend the VE palette with some custom widgets I created
extending Swing components.

I managed to do it ever since the first releases of VE and so far I
could always update my plugin with every new version of VE/Eclipse.

Unfortunately it does not work anymore with VE 1.2 and Eclipse 3.2 and I
wonder what might be the proper way to do it since the only online
tutorial is not up to date (unless I'm mistaken it targets Eclipse 3.1
and VE 1.1)

Apparently my classpath container is not properly registered since it
does not appear in the available libraries.

Here is a snippet of my plugin.xml file :
(my plugin id is my.widgets.plugin)

<extension point="org.eclipse.jdt.core.classpathContainerInitializer">
<classpathContainerInitializer
class=" org.eclipse.ve.internal.java.core.RegisteredClasspathContain erInitializer "
id="CUSTOM_WIDGETS_CONTAINER">
</classpathContainerInitializer>
</extension>

<extension point="org.eclipse.jdt.ui.classpathContainerPage">
<classpathContainerPage name="%customWidgetsPage"
class=" org.eclipse.ve.internal.java.wizard.RegisteredClasspathConta inerWizardPage "
id="CUSTOM_WIDGETS_CONTAINER">
</classpathContainerPage>
</extension>

<extension point="org.eclipse.ve.java.core.registrations">
<registration container="CUSTOM_WIDGETS_CONTAINER"
description="Calypso widgets distribution">
<library runtime="bin/widgets.jar" source="src/widgets_src.zip" />
</registration>
</extension>

<extension point="org.eclipse.jem.beaninfo.registrations">
<registration container="CUSTOM_WIDGETS_CONTAINER"
plugin="my.widgets.plugin">
<beaninfo path="bin/widgets_dt.jar">
<searchpath package="my.widgets.beaninfo"/>
</beaninfo>
</registration>
</extension>

<extension point="org.eclipse.ve.java.core.contributors">
<palette container="CUSTOM_WIDGETS_CONTAINER"
plugin="my.widgets.plugin"
categories="palette.xmi">
</palette>
</extension>

I think my palette.xmi file is ok since I migrated it to match the ones
used in VE plugins (jfc and swt) but I have not been able to test it so
far ...

If anyone can tell me how to properly register a classpath container
with VE 1.2 I would greatly appreciate since I'm a bit stuck there.
Re: Extending the palette with custom widgets [Eclipse 3.2, VE 1.2] [message #135745 is a reply to message #135721] Mon, 12 February 2007 15:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

As far as I can tell your plugin.xml is correct.

Are there any errors in the .log file?
--
Thanks,
Rich Kulp
Re: Extending the palette with custom widgets [Eclipse 3.2, VE 1.2] [message #135758 is a reply to message #135745] Mon, 12 February 2007 17:09 Go to previous messageGo to next message
Sébastien Alonzo is currently offline Sébastien AlonzoFriend
Messages: 94
Registered: July 2009
Member
Rich,

I started from scratch with a new plugin project and it seems to work
better now : at least my Classpath Container seems to be properly
registered.

I still have some issues with the palette drawers icons and labels but
I'm working on it.

Anyway thanks for your help.

Rich Kulp wrote:
> As far as I can tell your plugin.xml is correct.
>
> Are there any errors in the .log file?
Re: Extending the palette with custom widgets [Eclipse 3.2, VE 1.2] [message #135786 is a reply to message #135758] Tue, 13 February 2007 09:23 Go to previous messageGo to next message
Sébastien Alonzo is currently offline Sébastien AlonzoFriend
Messages: 94
Registered: July 2009
Member
I've got another question.

If I don't want to mix my plugin code (custom wizards, newStyleComponent
contributions ...) with my framework code (widgets, utility classes
....), wouldn't it be a better idea to bundle the framework libraries
into another plugin (in a similar way as org.apache.ant or
org.apache.log4j plugins) and have my VE plugin reference it ?

In that case what would be the proper way to register the classpath
container ?

I've looked at the SWT VE plugin and it does not look trivial to me
(though I understand some of the issues such as not having the widgets
code run into Eclipse JVM)

Sébastien Alonzo wrote:
> Rich,
>
> I started from scratch with a new plugin project and it seems to work
> better now : at least my Classpath Container seems to be properly
> registered.
>
> I still have some issues with the palette drawers icons and labels but
> I'm working on it.
>
> Anyway thanks for your help.
>
> Rich Kulp wrote:
>
>> As far as I can tell your plugin.xml is correct.
>>
>> Are there any errors in the .log file?
Re: Extending the palette with custom widgets [Eclipse 3.2, VE 1.2] [message #135808 is a reply to message #135786] Tue, 13 February 2007 14:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

If you open the schema document on the registrations extension point
you'll see the following comment on the runtime attribute:

the path to the jar relative to the plugin. This jar will be added to
the classpath. If relative to another plugin, then use the format
"/otherpluginid/myjar.jar".



--
Thanks,
Rich Kulp
Re: Extending the palette with custom widgets [Eclipse 3.2, VE 1.2] [message #135820 is a reply to message #135808] Tue, 13 February 2007 15:37 Go to previous messageGo to next message
Sébastien Alonzo is currently offline Sébastien AlonzoFriend
Messages: 94
Registered: July 2009
Member
Thanks for your answer Rich.

Actually I was missing this piece of information since I had an
incomplete installation of the VE feature (probably missing some
plugins). So the "open extension point description" link was broken for
org.eclipse.ve.* extensions.
Now I've updated all features of my Eclipse environment using the update
manager and I have proper documentation.

Still it's not really working because Eclipse does not seem to find the
jars declared in my custom library.

I've declared them that way :

plugin.xml of my.widgets.plugin
<extension point="org.eclipse.ve.java.core.registrations">
<registration container="CUSTOM_WIDGETS_CONTAINER"
description="%classpathContainerDesription">
<library runtime="/my.widgets.framework/lib/widgets.jar"
source="/my.widgets.source/src/widgets-src.zip"/>
<library runtime="/my.widgets.framework/lib/utils.jar"
source="/my.widgets.source/src/utils-src.zip"/>
</registration>
</extension>

With my.widgets.framework the id of the plugin containing my framework
libraries and my.widgets.source the id of the plugin containing the
source code for my libraries.

Since I could not find another example I wonder if I've declared
properly the library entries ...

By the way, the .log is empty so I don't have a clue as to what's wrong
with my configuration.

Rich Kulp wrote:
> If you open the schema document on the registrations extension point
> you'll see the following comment on the runtime attribute:
>
> the path to the jar relative to the plugin. This jar will be added to
> the classpath. If relative to another plugin, then use the format
> "/otherpluginid/myjar.jar".
>
>
>
Re: Extending the palette with custom widgets [Eclipse 3.2, VE 1.2] [message #135834 is a reply to message #135820] Tue, 13 February 2007 16:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

There is a problem in that during development time the runtime jar (in
your case widgets.jar) must be a true jar sitting in the
my.widgets.framework/lib directory in the project. You'll need to build
it and place it in the right place in your framework project, and if you
are using CVS I would put a .cvsignore file in that folder telling it to
ignore that jar and not put it out to cvs.

This is an annoying problem but it is a JDT problem that they won't fix
(they call it an enhancement that they won't do. :-)) But basically they
won't allow an external class folder to be in the classpath. Since the
widgets.jar during development time is not a jar but just classes within
a class bin folder, this folder cannot be added to the container in your
target workspace.


--
Thanks,
Rich Kulp
Re: Extending the palette with custom widgets [Eclipse 3.2, VE 1.2] [message #135847 is a reply to message #135834] Tue, 13 February 2007 17:43 Go to previous messageGo to next message
Sébastien Alonzo is currently offline Sébastien AlonzoFriend
Messages: 94
Registered: July 2009
Member
Well in my case the jar is already built in my.widgets.framework/lib
directory. But it's not in the classpath of my.widgets.framework plugin
so maybe that's what is bothering the JDT.

I'm going to try and add it to my plugin classpath to see if it works.

Rich Kulp wrote:
> There is a problem in that during development time the runtime jar (in
> your case widgets.jar) must be a true jar sitting in the
> my.widgets.framework/lib directory in the project. You'll need to build
> it and place it in the right place in your framework project, and if you
> are using CVS I would put a .cvsignore file in that folder telling it to
> ignore that jar and not put it out to cvs.
>
> This is an annoying problem but it is a JDT problem that they won't fix
> (they call it an enhancement that they won't do. :-)) But basically they
> won't allow an external class folder to be in the classpath. Since the
> widgets.jar during development time is not a jar but just classes within
> a class bin folder, this folder cannot be added to the container in your
> target workspace.
>
>
Re: Extending the palette with custom widgets [Eclipse 3.2, VE 1.2] [message #135860 is a reply to message #135847] Tue, 13 February 2007 19:11 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

No, it should not be in the plugin's classpath since you are not
executing that code in Eclipse.


Sébastien Alonzo wrote:
> Well in my case the jar is already built in my.widgets.framework/lib
> directory. But it's not in the classpath of my.widgets.framework plugin
> so maybe that's what is bothering the JDT.
>
> I'm going to try and add it to my plugin classpath to see if it works.
>
> Rich Kulp wrote:
>> There is a problem in that during development time the runtime jar (in
>> your case widgets.jar) must be a true jar sitting in the
>> my.widgets.framework/lib directory in the project. You'll need to
>> build it and place it in the right place in your framework project,
>> and if you are using CVS I would put a .cvsignore file in that folder
>> telling it to ignore that jar and not put it out to cvs.
>>
>> This is an annoying problem but it is a JDT problem that they won't
>> fix (they call it an enhancement that they won't do. :-)) But
>> basically they won't allow an external class folder to be in the
>> classpath. Since the widgets.jar during development time is not a jar
>> but just classes within a class bin folder, this folder cannot be
>> added to the container in your target workspace.
>>
>>

--
Thanks,
Rich Kulp
Re: Extending the palette with custom widgets [Eclipse 3.2, VE 1.2] [message #615060 is a reply to message #135721] Mon, 12 February 2007 15:03 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

As far as I can tell your plugin.xml is correct.

Are there any errors in the .log file?
--
Thanks,
Rich Kulp
Re: Extending the palette with custom widgets [Eclipse 3.2, VE 1.2] [message #615061 is a reply to message #135745] Mon, 12 February 2007 17:09 Go to previous message
Sébastien Alonzo is currently offline Sébastien AlonzoFriend
Messages: 94
Registered: July 2009
Member
Rich,

I started from scratch with a new plugin project and it seems to work
better now : at least my Classpath Container seems to be properly
registered.

I still have some issues with the palette drawers icons and labels but
I'm working on it.

Anyway thanks for your help.

Rich Kulp wrote:
> As far as I can tell your plugin.xml is correct.
>
> Are there any errors in the .log file?
Re: Extending the palette with custom widgets [Eclipse 3.2, VE 1.2] [message #615063 is a reply to message #135758] Tue, 13 February 2007 09:23 Go to previous message
Sébastien Alonzo is currently offline Sébastien AlonzoFriend
Messages: 94
Registered: July 2009
Member
I've got another question.

If I don't want to mix my plugin code (custom wizards, newStyleComponent
contributions ...) with my framework code (widgets, utility classes
....), wouldn't it be a better idea to bundle the framework libraries
into another plugin (in a similar way as org.apache.ant or
org.apache.log4j plugins) and have my VE plugin reference it ?

In that case what would be the proper way to register the classpath
container ?

I've looked at the SWT VE plugin and it does not look trivial to me
(though I understand some of the issues such as not having the widgets
code run into Eclipse JVM)

Sébastien Alonzo wrote:
> Rich,
>
> I started from scratch with a new plugin project and it seems to work
> better now : at least my Classpath Container seems to be properly
> registered.
>
> I still have some issues with the palette drawers icons and labels but
> I'm working on it.
>
> Anyway thanks for your help.
>
> Rich Kulp wrote:
>
>> As far as I can tell your plugin.xml is correct.
>>
>> Are there any errors in the .log file?
Re: Extending the palette with custom widgets [Eclipse 3.2, VE 1.2] [message #615065 is a reply to message #135786] Tue, 13 February 2007 14:24 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

If you open the schema document on the registrations extension point
you'll see the following comment on the runtime attribute:

the path to the jar relative to the plugin. This jar will be added to
the classpath. If relative to another plugin, then use the format
"/otherpluginid/myjar.jar".



--
Thanks,
Rich Kulp
Re: Extending the palette with custom widgets [Eclipse 3.2, VE 1.2] [message #615066 is a reply to message #135808] Tue, 13 February 2007 15:37 Go to previous message
Sébastien Alonzo is currently offline Sébastien AlonzoFriend
Messages: 94
Registered: July 2009
Member
Thanks for your answer Rich.

Actually I was missing this piece of information since I had an
incomplete installation of the VE feature (probably missing some
plugins). So the "open extension point description" link was broken for
org.eclipse.ve.* extensions.
Now I've updated all features of my Eclipse environment using the update
manager and I have proper documentation.

Still it's not really working because Eclipse does not seem to find the
jars declared in my custom library.

I've declared them that way :

plugin.xml of my.widgets.plugin
<extension point="org.eclipse.ve.java.core.registrations">
<registration container="CUSTOM_WIDGETS_CONTAINER"
description="%classpathContainerDesription">
<library runtime="/my.widgets.framework/lib/widgets.jar"
source="/my.widgets.source/src/widgets-src.zip"/>
<library runtime="/my.widgets.framework/lib/utils.jar"
source="/my.widgets.source/src/utils-src.zip"/>
</registration>
</extension>

With my.widgets.framework the id of the plugin containing my framework
libraries and my.widgets.source the id of the plugin containing the
source code for my libraries.

Since I could not find another example I wonder if I've declared
properly the library entries ...

By the way, the .log is empty so I don't have a clue as to what's wrong
with my configuration.

Rich Kulp wrote:
> If you open the schema document on the registrations extension point
> you'll see the following comment on the runtime attribute:
>
> the path to the jar relative to the plugin. This jar will be added to
> the classpath. If relative to another plugin, then use the format
> "/otherpluginid/myjar.jar".
>
>
>
Re: Extending the palette with custom widgets [Eclipse 3.2, VE 1.2] [message #615067 is a reply to message #135820] Tue, 13 February 2007 16:34 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

There is a problem in that during development time the runtime jar (in
your case widgets.jar) must be a true jar sitting in the
my.widgets.framework/lib directory in the project. You'll need to build
it and place it in the right place in your framework project, and if you
are using CVS I would put a .cvsignore file in that folder telling it to
ignore that jar and not put it out to cvs.

This is an annoying problem but it is a JDT problem that they won't fix
(they call it an enhancement that they won't do. :-)) But basically they
won't allow an external class folder to be in the classpath. Since the
widgets.jar during development time is not a jar but just classes within
a class bin folder, this folder cannot be added to the container in your
target workspace.


--
Thanks,
Rich Kulp
Re: Extending the palette with custom widgets [Eclipse 3.2, VE 1.2] [message #615068 is a reply to message #135834] Tue, 13 February 2007 17:43 Go to previous message
Sébastien Alonzo is currently offline Sébastien AlonzoFriend
Messages: 94
Registered: July 2009
Member
Well in my case the jar is already built in my.widgets.framework/lib
directory. But it's not in the classpath of my.widgets.framework plugin
so maybe that's what is bothering the JDT.

I'm going to try and add it to my plugin classpath to see if it works.

Rich Kulp wrote:
> There is a problem in that during development time the runtime jar (in
> your case widgets.jar) must be a true jar sitting in the
> my.widgets.framework/lib directory in the project. You'll need to build
> it and place it in the right place in your framework project, and if you
> are using CVS I would put a .cvsignore file in that folder telling it to
> ignore that jar and not put it out to cvs.
>
> This is an annoying problem but it is a JDT problem that they won't fix
> (they call it an enhancement that they won't do. :-)) But basically they
> won't allow an external class folder to be in the classpath. Since the
> widgets.jar during development time is not a jar but just classes within
> a class bin folder, this folder cannot be added to the container in your
> target workspace.
>
>
Re: Extending the palette with custom widgets [Eclipse 3.2, VE 1.2] [message #615069 is a reply to message #135847] Tue, 13 February 2007 19:11 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

No, it should not be in the plugin's classpath since you are not
executing that code in Eclipse.


Sébastien Alonzo wrote:
> Well in my case the jar is already built in my.widgets.framework/lib
> directory. But it's not in the classpath of my.widgets.framework plugin
> so maybe that's what is bothering the JDT.
>
> I'm going to try and add it to my plugin classpath to see if it works.
>
> Rich Kulp wrote:
>> There is a problem in that during development time the runtime jar (in
>> your case widgets.jar) must be a true jar sitting in the
>> my.widgets.framework/lib directory in the project. You'll need to
>> build it and place it in the right place in your framework project,
>> and if you are using CVS I would put a .cvsignore file in that folder
>> telling it to ignore that jar and not put it out to cvs.
>>
>> This is an annoying problem but it is a JDT problem that they won't
>> fix (they call it an enhancement that they won't do. :-)) But
>> basically they won't allow an external class folder to be in the
>> classpath. Since the widgets.jar during development time is not a jar
>> but just classes within a class bin folder, this folder cannot be
>> added to the container in your target workspace.
>>
>>

--
Thanks,
Rich Kulp
Previous Topic:Turn off visual editor preview pane
Next Topic:ExpandBar widget in Palette ?
Goto Forum:
  


Current Time: Sat Dec 20 14:27:48 GMT 2014

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

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