|
|
|
|
|
|
|
|
|
|
|
|
|
Re: How to add custom widgets to XWT designer palette [message #581083 is a reply to message #574601] |
Fri, 20 August 2010 06:02  |
Eclipse User |
|
|
|
"org.eclipse.e4.xwt.tools.ui.palette.paletteContribution" is the correct extension point.
<extension
point="org.eclipse.e4.xwt.tools.ui.palette.paletteContribution ">
<Contribution
targetId="org.eclipse.e4.xwt.tools.ui.designer.XWTDesigner" >
<Resource
provider="your.palette.provider.YourPaletteProvider"
uri="palette/your.palette" >
</Resource>
</Contribution>
</extension>
I used a subclass of org.eclipse.e4.xwt.tools.ui.palette.page.resources.URIResour ceProvider as palette provider.
Next you need to define the palette file "palette/your.palette" somehow like this:
<?xml version="1.0" encoding="UTF-8"?>
<palette:Palette xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:palette="http://www.eclipse.org/e4/xwt/tools/palette.xmi">
<entries name=" Controls" icon=" platform:/plugin/org.eclipse.e4.xwt.tools.ui.editor.custompa lette/icons/riena.png ">
<entries
toolTip="Create a YourWidget"
content="<YourWidget x:Class="your.widget.YourWidget" x:style="SWT.NONE"></YourWid get> "
name="YourWidget"
icon="platform:/plugin/your.palette/icons/yourwidget.gif"
scope="Composite"/>
</entries>
</palette:Palette>
Keep in mind that you are required to register your widget with the xwt designer, otherwise it will not load.
Your palette provider might be a good place to do that, eg in the getPaletteResourceURI() method.
cheers,
--Holger
|
|
|
Powered by
FUDForum. Page generated in 0.28229 seconds