Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » How to add custom widgets to XWT designer palette
How to add custom widgets to XWT designer palette [message #527453] Thu, 15 April 2010 06:38 Go to next message
Jinshan  is currently offline Jinshan
Messages: 24
Registered: December 2009
Junior Member
For XWT editor palette use org.eclipse.e4.xwt.vex.customPalette extension point.

But, how to add custom widgets to XWT "designer" palette?

Thanks.

[Updated on: Thu, 15 April 2010 06:39]

Report message to a moderator

Re: How to add custom widgets to XWT designer palette [message #527650 is a reply to message #527453] Thu, 15 April 2010 18:48 Go to previous messageGo to next message
Yves YANG is currently offline Yves YANG
Messages: 687
Registered: July 2009
Senior Member
Use the same concept, but the EP is in the bundle
"org.eclipse.e4.xwt.tools.ui.palette"

Regards
Yves
"Jinshan" <jinshanl@gmail.com> wrote in message
news:hq6qb8$rn7$1@build.eclipse.org...
> For XWT editor palette use org.eclipse.e4.xwt.vex.customPalette extension
> point.
>
> But, how to add custom widgets to XWT "designer" palette.
>
> Thanks.
Re: How to add custom widgets to XWT designer palette [message #527657 is a reply to message #527650] Thu, 15 April 2010 20:17 Go to previous messageGo to next message
Jinshan  is currently offline Jinshan
Messages: 24
Registered: December 2009
Junior Member
Thanks.

Could you tell me which it EP and where can I get a sample code or help for this EP?

[Updated on: Thu, 15 April 2010 20:23]

Report message to a moderator

Re: How to add custom widgets to XWT designer palette [message #527928 is a reply to message #527650] Fri, 16 April 2010 19:43 Go to previous messageGo to next message
Jinshan  is currently offline Jinshan
Messages: 24
Registered: December 2009
Junior Member
Could you tell me which the EP is and where can I get a sample code or help for this EP?

Yves YANG wrote on Thu, 15 April 2010 18:48
Use the same concept, but the EP is in the bundle
"org.eclipse.e4.xwt.tools.ui.palette"

Regards
Yves
"Jinshan" <jinshanl@gmail.com> wrote in message
news:hq6qb8$rn7$1@build.eclipse.org...
> For XWT editor palette use org.eclipse.e4.xwt.vex.customPalette extension
> point.
>
> But, how to add custom widgets to XWT "designer" palette.
>
> Thanks.

Re: How to add custom widgets to XWT designer palette [message #527935 is a reply to message #527928] Fri, 16 April 2010 23:30 Go to previous messageGo to next message
Yves YANG is currently offline Yves YANG
Messages: 687
Registered: July 2009
Senior Member
You can find it in the bundle org.eclipse.e4.tools.ui.designer, which adds
XWT palette.

"Jinshan" <jinshanl@gmail.com> wrote in message
news:hqasn4$149$1@build.eclipse.org...
> Could you tell me which the EP is and where can I get a sample code or
> help for this EP?
>
> Yves YANG wrote on Thu, 15 April 2010 18:48
>> Use the same concept, but the EP is in the bundle
>> "org.eclipse.e4.xwt.tools.ui.palette"
>>
>> Regards
>> Yves
>> "Jinshan" <jinshanl@gmail.com> wrote in message
>> news:hq6qb8$rn7$1@build.eclipse.org...
>> > For XWT editor palette use org.eclipse.e4.xwt.vex.customPalette
>> > extension point.
>> >
>> > But, how to add custom widgets to XWT "designer" palette.
>> >
>> > Thanks.
>
>
Re: How to add custom widgets to XWT designer palette [message #527936 is a reply to message #527928] Fri, 16 April 2010 23:31 Go to previous messageGo to next message
Yves YANG is currently offline Yves YANG
Messages: 687
Registered: July 2009
Senior Member
Please read my previous post, which indicate the bundle. Unfortunately, we
have not sample code by now.

Best regards
Yves YANG
"Jinshan" <jinshanl@gmail.com> wrote in message
news:hqasn4$149$1@build.eclipse.org...
> Could you tell me which the EP is and where can I get a sample code or
> help for this EP?
>
> Yves YANG wrote on Thu, 15 April 2010 18:48
>> Use the same concept, but the EP is in the bundle
>> "org.eclipse.e4.xwt.tools.ui.palette"
>>
>> Regards
>> Yves
>> "Jinshan" <jinshanl@gmail.com> wrote in message
>> news:hq6qb8$rn7$1@build.eclipse.org...
>> > For XWT editor palette use org.eclipse.e4.xwt.vex.customPalette
>> > extension point.
>> >
>> > But, how to add custom widgets to XWT "designer" palette.
>> >
>> > Thanks.
>
>
Re: How to add custom widgets to XWT designer palette [message #527942 is a reply to message #527935] Sat, 17 April 2010 01:23 Go to previous messageGo to next message
Jinshan  is currently offline Jinshan
Messages: 24
Registered: December 2009
Junior Member
Is it org.eclipse.e4.xwt.tools.ui.palette.paletteContribution?
Could you give me some help steps for it? which classes and resource must been implemented.

Yves YANG wrote on Fri, 16 April 2010 23:30
You can find it in the bundle org.eclipse.e4.tools.ui.designer, which adds
XWT palette.

"Jinshan" <jinshanl@gmail.com> wrote in message
news:hqasn4$149$1@build.eclipse.org...
> Could you tell me which the EP is and where can I get a sample code or
> help for this EP?
>
> Yves YANG wrote on Thu, 15 April 2010 18:48
>> Use the same concept, but the EP is in the bundle
>> "org.eclipse.e4.xwt.tools.ui.palette"
>>
>> Regards
>> Yves
>> "Jinshan" <jinshanl@gmail.com> wrote in message
>> news:hq6qb8$rn7$1@build.eclipse.org...
>> > For XWT editor palette use org.eclipse.e4.xwt.vex.customPalette
>> > extension point.
>> >
>> > But, how to add custom widgets to XWT "designer" palette.
>> >
>> > Thanks.
>
>

[Updated on: Sat, 17 April 2010 01:25]

Report message to a moderator

Re: How to add custom widgets to XWT designer palette [message #554144 is a reply to message #527942] Fri, 20 August 2010 06:02 Go to previous messageGo to next message
Holger Hoch is currently offline Holger Hoch
Messages: 8
Registered: July 2009
Junior Member
"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="&lt;YourWidget x:Class=&quot;your.widget.YourWidget&quot; x:style=&quot;SWT.NONE&quot;&gt;&lt;/YourWid get&gt; "
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
Re: How to add custom widgets to XWT designer palette [message #574306 is a reply to message #527650] Thu, 15 April 2010 20:17 Go to previous messageGo to next message
Jinshan  is currently offline Jinshan
Messages: 24
Registered: December 2009
Junior Member
Thanks.

Where can I get a sample code or help for this EP?
Re: How to add custom widgets to XWT designer palette [message #574520 is a reply to message #527650] Fri, 16 April 2010 19:43 Go to previous messageGo to next message
Jinshan  is currently offline Jinshan
Messages: 24
Registered: December 2009
Junior Member
Could you tell me which the EP is and where can I get a sample code or help for this EP?

Yves YANG wrote on Thu, 15 April 2010 18:48
> Use the same concept, but the EP is in the bundle
> "org.eclipse.e4.xwt.tools.ui.palette"
>
> Regards
> Yves
> "Jinshan" <jinshanl@gmail.com> wrote in message
> news:hq6qb8$rn7$1@build.eclipse.org...
> > For XWT editor palette use org.eclipse.e4.xwt.vex.customPalette extension
> > point.
> >
> > But, how to add custom widgets to XWT "designer" palette.
> >
> > Thanks.
Re: How to add custom widgets to XWT designer palette [message #574530 is a reply to message #574520] Fri, 16 April 2010 23:30 Go to previous messageGo to next message
Yves YANG is currently offline Yves YANG
Messages: 687
Registered: July 2009
Senior Member
You can find it in the bundle org.eclipse.e4.tools.ui.designer, which adds
XWT palette.

"Jinshan" <jinshanl@gmail.com> wrote in message
news:hqasn4$149$1@build.eclipse.org...
> Could you tell me which the EP is and where can I get a sample code or
> help for this EP?
>
> Yves YANG wrote on Thu, 15 April 2010 18:48
>> Use the same concept, but the EP is in the bundle
>> "org.eclipse.e4.xwt.tools.ui.palette"
>>
>> Regards
>> Yves
>> "Jinshan" <jinshanl@gmail.com> wrote in message
>> news:hq6qb8$rn7$1@build.eclipse.org...
>> > For XWT editor palette use org.eclipse.e4.xwt.vex.customPalette
>> > extension point.
>> >
>> > But, how to add custom widgets to XWT "designer" palette.
>> >
>> > Thanks.
>
>
Re: How to add custom widgets to XWT designer palette [message #574555 is a reply to message #574520] Fri, 16 April 2010 23:31 Go to previous messageGo to next message
Yves YANG is currently offline Yves YANG
Messages: 687
Registered: July 2009
Senior Member
Please read my previous post, which indicate the bundle. Unfortunately, we
have not sample code by now.

Best regards
Yves YANG
"Jinshan" <jinshanl@gmail.com> wrote in message
news:hqasn4$149$1@build.eclipse.org...
> Could you tell me which the EP is and where can I get a sample code or
> help for this EP?
>
> Yves YANG wrote on Thu, 15 April 2010 18:48
>> Use the same concept, but the EP is in the bundle
>> "org.eclipse.e4.xwt.tools.ui.palette"
>>
>> Regards
>> Yves
>> "Jinshan" <jinshanl@gmail.com> wrote in message
>> news:hq6qb8$rn7$1@build.eclipse.org...
>> > For XWT editor palette use org.eclipse.e4.xwt.vex.customPalette
>> > extension point.
>> >
>> > But, how to add custom widgets to XWT "designer" palette.
>> >
>> > Thanks.
>
>
Re: How to add custom widgets to XWT designer palette [message #574601 is a reply to message #527935] Sat, 17 April 2010 01:23 Go to previous messageGo to next message
Jinshan  is currently offline Jinshan
Messages: 24
Registered: December 2009
Junior Member
Is it org.eclipse.e4.xwt.tools.ui.palette.paletteContribution?
Could you give me some steps for it? which must classes and resource been implemented.

Yves YANG wrote on Fri, 16 April 2010 23:30
> You can find it in the bundle org.eclipse.e4.tools.ui.designer, which adds
> XWT palette.
>
> "Jinshan" <jinshanl@gmail.com> wrote in message
> news:hqasn4$149$1@build.eclipse.org...
> > Could you tell me which the EP is and where can I get a sample code or
> > help for this EP?
> >
> > Yves YANG wrote on Thu, 15 April 2010 18:48
> >> Use the same concept, but the EP is in the bundle
> >> "org.eclipse.e4.xwt.tools.ui.palette"
> >>
> >> Regards
> >> Yves
> >> "Jinshan" <jinshanl@gmail.com> wrote in message
> >> news:hq6qb8$rn7$1@build.eclipse.org...
> >> > For XWT editor palette use org.eclipse.e4.xwt.vex.customPalette
> >> > extension point.
> >> >
> >> > But, how to add custom widgets to XWT "designer" palette.
> >> >
> >> > Thanks.
> >
> >
Re: How to add custom widgets to XWT designer palette [message #581083 is a reply to message #574601] Fri, 20 August 2010 06:02 Go to previous message
Holger Hoch is currently offline Holger Hoch
Messages: 8
Registered: July 2009
Junior Member
"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
Previous Topic:Comboviewer binding in XWT
Next Topic:xwt browser
Goto Forum:
  


Current Time: Mon Sep 01 19:39:13 EDT 2014

Powered by FUDForum. Page generated in 0.03698 seconds