How to put own Components in the palette view [message #76488] |
Tue, 11 January 2005 07:37 |
Eclipse User |
|
|
|
Originally posted by: tobias.schwarz.bs-ag.com
hi!
we use our own enhaunced components for our applications inherited from
standard swing components.
so we need to put our own components into the palette of the visual editor
to simply add them to the design.
is there another simplier way to add them than do this manually in the
property file?
up to now i put them manually in property file located at
org.eclipse.ve.jfc_1.0.2\palette\javavisualbeanscats.xmi
thanks for your help
tobias
|
|
|
Re: How to put own Components in the palette view [message #76505 is a reply to message #76488] |
Wed, 12 January 2005 22:58 |
Joe Winchester Messages: 496 Registered: July 2009 |
Senior Member |
|
|
Hi Tobias,
> we use our own enhaunced components for our applications inherited from
> standard swing components.
> so we need to put our own components into the palette of the visual
> editor to simply add them to the design.
> is there another simplier way to add them than do this manually in the
> property file?
> up to now i put them manually in property file located at
> org.eclipse.ve.jfc_1.0.2\palette\javavisualbeanscats.xmi
You shouldn't really edit the xmi file because it's part of the supplied
code and will be hard to maintain across release. The technique is that
you create your own .xmi file with the palette categories and entries
and then write a plugin that describes the class path entries that will
result in this being included.
There is no current API doc on this, however if you look at how the
org.eclipse.ve.jfc and org.eclipse.ve.swt plugins contribute their
palette entries it should point you in the right direction. As an
example, for org.eclipse.ve.swt there is the plugin.xml entry
<extension
point="org.eclipse.ve.java.core.contributors">
<palette
container="SWT_CONTAINER"
categories="swtpalette.xmi"
plugin="org.eclipse.swt">
</palette>
</extension>
This says that when the SWT_CONTAINER is in the build path of the
project the palette is used, or if the plugin org.eclipse.swt is in the
build path. The current VE philosophy is that things are only included
on the palette if they are in the build path, sort of similar to the way
that code assist only includes entries that are on the build path so you
can't drop something that can't compile. For example, if your custom
swing components aren't in the build path the entries won't be there,
and if the container or plugin that defines them is there they will be.
At the moment we don't work with jar files, so the trigger that your
palette entries should be there is a container or a plugin. For a
container if you look at the org.eclipse.ve.swt/plugin.xml file you can
see more about how the container is setup with an initializer - the user
experience is that they use Add Library on the Java build path page and
selected it. The New Visual Class wizard also does this automatically
if SWT is chosen and you can also look at the plugin extension point to
see how this is done if you want.
However we do hope to rework the palette quite a bit and open up the
palette extensibility more and one thing we are thinking is that the
palette includes entries that are available but not yet in the build
path and this would make them available to the user to see and selecting
them would prompt for the project reconfiguration. This way it's easier
for the user to see what is available. Any feedback you could give on
how you'd like to see the palette improved would be really appreciated.
Best regards,
Joe Winchester
|
|
|
|
Re: How to put own Components in the palette view [message #77043 is a reply to message #76505] |
Fri, 14 January 2005 21:42 |
Eclipse User |
|
|
|
Originally posted by: spiazzi67.netscape.net
Hi, this is my plugin.xml:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin
id="org.ex1.ve.beans"
name="Beans Plug-in"
version="1.0.5"
provider-name=""
class="org.ex1.ve.beans.BeansPlugin">
<runtime>
<library name="beans.jar">
<export name="*"/>
</library>
</runtime>
<requires>
<import plugin="org.eclipse.ve.java.core"/>
<import plugin="org.eclipse.jface"/>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.gef"/>
<import plugin="org.eclipse.jdt.core"/>
<import plugin="org.eclipse.core.runtime"/>
</requires>
<extension
point="org.eclipse.jdt.ui.classpathContainerPage">
<classpathContainerPage
name="ex1 BEAN"
class=" org.eclipse.ve.internal.java.wizard.RegisteredClasspathConta inerWizardPage "
id="org.ex1.ve.beans">
</classpathContainerPage>
</extension>
<extension
point="org.eclipse.jdt.core.classpathContainerInitializer">
<classpathContainerInitializer
class=" org.eclipse.ve.internal.java.core.RegisteredClasspathContain erInitializer "
id="org.ex1.ve.beans">
</classpathContainerInitializer>
</extension>
<extension
point="org.eclipse.ve.java.core.registrations">
<registration
container="org.ex1.ve.beans"
description="ex1 BEAN">
<library
runtime="vm/ex1bean.jar"
prefix="src"
source="vm/ex1beansrc.zip">
</library>
</registration>
</extension>
<extension
point="org.eclipse.ve.java.core.contributors">
<palette
container="org.ex1.ve.beans"
categories="ex1palette.xmi">
</palette>
</extension>
</plugin>
And this is my xmi:
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:palette="http:///org/eclipse/ve/internal/cde/palette.ecore"
xmlns:utility="http:///org/eclipse/ve/internal/cde/utility.ecore">
<palette:CategoryCmp xmi:id="cat1">
<categoryLabel xsi:type="utility:ConstantString" xmi:id="string0"
string="ex1 BEAN"/>
<cmpGroups xsi:type="palette:GroupCmp" xmi:id="group1">
<cmpEntries xsi:type="palette:AnnotatedCreationEntry"
xmi:id="entry1"
icon16Name="platform:/plugin/org.ex1.ve.beans/icons/shape.gif ">
<objectCreationEntry xsi:type="palette:EMFCreationToolEntry"
xmi:id="entry1obj"
creationClassURI="java:/org.ex1.ve.beans#provaBean"/>
<entryLabel xsi:type="utility:ConstantString" xmi:id="string1"
string="Component ex1"/>
</cmpEntries>
</cmpGroups>
</palette:CategoryCmp>
</xmi:XMI>
But this don't work.
What I can't understand is the
<extension
point="org.eclipse.ve.java.core.registrations">
<registration
container="org.ex1.ve.beans"
description="ex1 BEAN">
<library
runtime="vm/ex1bean.jar"
prefix="src"
source="vm/ex1beansrc.zip">
</library>
</registration>
</extension>
How to use this?
Thanks
|
|
|
Re: How to put own Components in the palette view [message #604345 is a reply to message #76488] |
Wed, 12 January 2005 22:58 |
Joe Winchester Messages: 496 Registered: July 2009 |
Senior Member |
|
|
Hi Tobias,
> we use our own enhaunced components for our applications inherited from
> standard swing components.
> so we need to put our own components into the palette of the visual
> editor to simply add them to the design.
> is there another simplier way to add them than do this manually in the
> property file?
> up to now i put them manually in property file located at
> org.eclipse.ve.jfc_1.0.2\palette\javavisualbeanscats.xmi
You shouldn't really edit the xmi file because it's part of the supplied
code and will be hard to maintain across release. The technique is that
you create your own .xmi file with the palette categories and entries
and then write a plugin that describes the class path entries that will
result in this being included.
There is no current API doc on this, however if you look at how the
org.eclipse.ve.jfc and org.eclipse.ve.swt plugins contribute their
palette entries it should point you in the right direction. As an
example, for org.eclipse.ve.swt there is the plugin.xml entry
<extension
point="org.eclipse.ve.java.core.contributors">
<palette
container="SWT_CONTAINER"
categories="swtpalette.xmi"
plugin="org.eclipse.swt">
</palette>
</extension>
This says that when the SWT_CONTAINER is in the build path of the
project the palette is used, or if the plugin org.eclipse.swt is in the
build path. The current VE philosophy is that things are only included
on the palette if they are in the build path, sort of similar to the way
that code assist only includes entries that are on the build path so you
can't drop something that can't compile. For example, if your custom
swing components aren't in the build path the entries won't be there,
and if the container or plugin that defines them is there they will be.
At the moment we don't work with jar files, so the trigger that your
palette entries should be there is a container or a plugin. For a
container if you look at the org.eclipse.ve.swt/plugin.xml file you can
see more about how the container is setup with an initializer - the user
experience is that they use Add Library on the Java build path page and
selected it. The New Visual Class wizard also does this automatically
if SWT is chosen and you can also look at the plugin extension point to
see how this is done if you want.
However we do hope to rework the palette quite a bit and open up the
palette extensibility more and one thing we are thinking is that the
palette includes entries that are available but not yet in the build
path and this would make them available to the user to see and selecting
them would prompt for the project reconfiguration. This way it's easier
for the user to see what is available. Any feedback you could give on
how you'd like to see the palette improved would be really appreciated.
Best regards,
Joe Winchester
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02889 seconds