|
|
|
|
Re: Changing Palette Icons programmatically [message #661213 is a reply to message #661098] |
Wed, 23 March 2011 15:14 |
Christophe Bouhier Messages: 937 Registered: July 2009 |
Senior Member |
|
|
inlined....
On 23-03-11 00:39, Dave wrote:
> Thanks for the hint.
> I managed to find the related source code but unfortunatly I don't know
> how to change it, since my code is generated with GMF and is regenerated
> regulary. So I thought I can use an extension somewhere to override the
> existing code but that wasn't successful either. Do you have an idea how
> to change the generated code for a palette entries?
>
I am not sure why you want to override the palettefactory. What you
really want (At least, if I understand from the original post), is to
subscribe to preference changes, and then reload the palette right? So
from the palette factory, you simply re-use the parts which make sense
like this:
I found this comment in the EditingDomain.setPaletteRoot(..)
/**
* Sets the PalatteRoot for this EditDomain. If the EditDomain already
knows
* about a PaletteViewer, this root will be set into the palette viewer
* also. Loads the default Tool after the root has been set.
* <p>
* It is recommended that the palette root not be set multiple times. Some
* components (such as the PaletteCustomizerDialog for the PaletteViewer)
* might still hold on to the old root. If the input has changed or
needs to
* be refreshed, just remove all the children from the root and add the new
* ones.
*
* @param root
* the palette's root
*/
so, obviously not a good idea to reset the root.
You would need to play (Add/remove) with this:
this.getEditDomain().getPaletteViewer().getPaletteRoot().get Children()
Please let us know the result!
>
> Thank you very much indeed!
>
>
> Cheers
> Dave
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03153 seconds