Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » WindowBuilder » How use wbp-palette-commands.xml inside plug-in project
How use wbp-palette-commands.xml inside plug-in project [message #902289] Thu, 16 August 2012 15:31 Go to next message
Arthur Fücher is currently offline Arthur Fücher
Messages: 59
Registered: August 2012
Member
Hi,

I want to restrict the components and categories in the toolkit. I want to know if can I use the wbp-palette-commands.xml inside my plugin.

I see that if I put this XML in a folder called wbp-meta inside the project where my plug-in is running it works. But I want that the plug-in do this restriction...

Are there anyway to do that? Put this XML inside the plug-in? Or exists a extension point to do that?

[]'s
Re: How use wbp-palette-commands.xml inside plug-in project [message #902290 is a reply to message #902289] Thu, 16 August 2012 15:37 Go to previous messageGo to next message
Konstantin Scheglov is currently offline Konstantin Scheglov
Messages: 554
Registered: July 2009
Senior Member
What do you mean under "restrict"?

Palette command can be read from jars, from project and from WindowBuilder internal location.
See org.eclipse.wb.internal.core.editor.palette.PaletteManager.commandsRead()

There is also org.eclipse.wb.core.editor.palette.PaletteEventListener which you can register and manipulate palette categories and entries before they are shown.


Konstantin Scheglov,
Google, Inc.
Re: How use wbp-palette-commands.xml inside plug-in project [message #902291 is a reply to message #902290] Thu, 16 August 2012 15:41 Go to previous messageGo to next message
Arthur Fücher is currently offline Arthur Fücher
Messages: 59
Registered: August 2012
Member
I want to hide some categories or components...

But how I make the palette read this command? I've see org.eclipse.wb.internal.core.editor.palette.PaletteManager.commandsRead(), and I just found it searching in the current workspace, not in my plugin...

I'll see a little more...
Re: How use wbp-palette-commands.xml inside plug-in project [message #902293 is a reply to message #902291] Thu, 16 August 2012 16:10 Go to previous messageGo to next message
Arthur Fücher is currently offline Arthur Fücher
Messages: 59
Registered: August 2012
Member
So,

I add the listener in my HorizontalBoxInfo, and it works! It's the best way to do that?

Thks for your support!
Re: How use wbp-palette-commands.xml inside plug-in project [message #902297 is a reply to message #902293] Thu, 16 August 2012 16:41 Go to previous message
Konstantin Scheglov is currently offline Konstantin Scheglov
Messages: 554
Registered: July 2009
Senior Member
If listener is in model, it will be added only if form has your component, so model created.
If you want to have it active always, you need org.eclipse.wb.core.model.IRootProcessor register in "org.eclipse.wb.core.rootProcessors" extension point.


Konstantin Scheglov,
Google, Inc.
Previous Topic:Re: How use wbp-palette-commands.xml inside plug-in project
Next Topic:Re: How use wbp-palette-commands.xml inside plug-in project
Goto Forum:
  


Current Time: Wed Jul 30 11:34:08 EDT 2014

Powered by FUDForum. Page generated in 0.01778 seconds