Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Refreshing Palette View without closing/reopen
Refreshing Palette View without closing/reopen [message #238776] Tue, 02 October 2007 10:13 Go to next message
Eclipse UserFriend
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 #238811 is a reply to message #238776] Wed, 03 October 2007 08:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bagnard.natacha.free.fr

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
Re: Refreshing Palette View without closing/reopen [message #238821 is a reply to message #238811] Wed, 03 October 2007 12:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: agatha.schmitz.gmx.de

....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
Re: Refreshing Palette View without closing/reopen [message #238915 is a reply to message #238821] Sun, 07 October 2007 18:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: trommas.yahoo.com

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
Re: Refreshing Palette View without closing/reopen [message #238920 is a reply to message #238915] Mon, 08 October 2007 06:25 Go to previous message
Eclipse UserFriend
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
Previous Topic:palette questions
Next Topic:creating parent for already created child figure
Goto Forum:
  


Current Time: Tue Apr 23 12:47:37 GMT 2024

Powered by FUDForum. Page generated in 0.03267 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top