Refreshing Palette View without closing/reopen [message #238776] |
Tue, 02 October 2007 06:13  |
Eclipse User |
|
|
|
Originally posted by: agatha.schmitz.gmx.de
Closing and reopen couldn't be the only way to refresh the palette view.
A small hint how do achieve this in a smarter way would be very helpfull.
TIA
Agatha
> Agatha,
>
> This sounds like a GMF question so I will redirect you to that newsgroup
> which I've added to the "to" list of the reply so you don't need to repost.
>
>
> Agatha Schmitz wrote:
>> Hello everybody...
>>
>> Is there a better way to refresh the palette view after adding some
>> new creation tools than closing and opening it again?
>>
>> TIA
>> Agatha Schmitz
|
|
|
|
|
|
Re: Refreshing Palette View without closing/reopen [message #238920 is a reply to message #238915] |
Mon, 08 October 2007 02:25  |
Eclipse User |
|
|
|
Originally posted by: agatha.schmitz.gmx.de
In my case (gmf) i only needed the part to instantiate a new PaletteRoot
which triggered also a refresh on my current PaletteRoot. Strange but
working ;-)
Agatha
> Could you explain how you did this? I think the classes and methods have
> changed since this was written.
>
>
> Regards,
>
> Tomas
>
> Agatha Schmitz wrote:
>> ...it works!....thank you very much
>>
>>> Hi,
>>> I've try to do this by using
>>> PaletteService.getInstance().updatePalette(existingRoot, editor,
>>> content) but it didn't work. So I do it using
>>> PaletteService.getInstance().createPalette(editor, content).
>>>
>>> Here is the sample code I use :
>>> /** Create a new palette root **/
>>> PaletteRoot content = new PaletteRoot();
>>>
>>> /** Get the old palette root and containers **/
>>> /** Method to get palette root must be writen **/
>>> List< PaletteContainer > containers =
>>> ****DiagramEditor.getPaletteRoot().getChildren();
>>>
>>> /** Create entry to add to container **/
>>> PaletteEntry entry = ****PaletteFactory.createXXXCreationTool();
>>>
>>> /** Add it **/
>>> containers.get(my_container).add(entry);
>>>
>>> /** Add containers to new palette root **/
>>> for(int i=; i<containers.size(); i++){
>>> content.add(containers.get(i));
>>> }
>>>
>>> /** Create the palette **/
>>> PaletteService.getInstance().createPalette(Cimero2EditorDiag ramEditorUtil.getActiveEditor(),
>>> content);
>>>
>>> /** Set the root**/
>>> Cimero2EditorDiagramEditor.setPaletteRoot(content);
>>>
>>> This will refresh your palette when you call it.
>>>
>>> Regards,
>>> Natacha
>>>
>>> Agatha Schmitz a écrit :
>>>> Closing and reopen couldn't be the only way to refresh the palette
>>>> view. A small hint how do achieve this in a smarter way would be
>>>> very helpfull.
>>>>
>>>> TIA
>>>> Agatha
>>>>
>>>>
>>>>> Agatha,
>>>>>
>>>>> This sounds like a GMF question so I will redirect you to that
>>>>> newsgroup which I've added to the "to" list of the reply so you
>>>>> don't need to repost.
>>>>>
>>>>>
>>>>> Agatha Schmitz wrote:
>>>>>> Hello everybody...
>>>>>>
>>>>>> Is there a better way to refresh the palette view after adding
>>>>>> some new creation tools than closing and opening it again?
>>>>>>
>>>>>> TIA
>>>>>> Agatha Schmitz
|
|
|
Powered by
FUDForum. Page generated in 0.06680 seconds