[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Re: Refreshing Palette View without closing/reopen

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(Cimero2EditorDiagramEditorUtil.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