Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Add sth.to the palette view
Add sth.to the palette view [message #499542] Mon, 23 November 2009 05:20 Go to next message
Alexander Mack is currently offline Alexander Mack
Messages: 100
Registered: July 2009
Senior Member
Hello,
I am reading tutorials and articles about GEF. At the moment I am trying to program an simple GEF plugin for painting rectangles and ellipses...
Now I want to add some items in the palette view. But unfortunately it does not work the way I like.
Nothing will be displayed..

I extend the GraphicalEditorWithPalette class in my MainEditor and have overwritten the getRootPalette function:

protected PaletteRoot getPaletteRoot() {
		PaletteRoot root = new PaletteRoot();
		//root.add(new SelectionToolEntry());
		//root.add(new MarqueeToolEntry());
		PaletteGroup group = new PaletteGroup("tools");
		group.add(new SelectionToolEntry());
		group.add(new MarqueeToolEntry());
		root.add(group);
		return root;
	}


The platte view always says that it is not availiable...

I don't really know what the problem is so a would appreciate any help.

Best regards
Alex
Re: Add sth.to the palette view [message #499808 is a reply to message #499542] Tue, 24 November 2009 04:20 Go to previous message
Eclipse User
Originally posted by: ean.informatik.uni-kiel.de

Hello,

the palette is only available if you open an file associated with your
MainEditor. The way you initialize the palette seems correct for me. You
can try with a breakpoint that the method is called when you open a file
for your MainEditor.

best regards,
Eckhard

Alexander Mack schrieb:
> Hello,
> I am reading tutorials and articles about GEF. At the moment I am trying
> to program an simple GEF plugin for painting rectangles and ellipses...
> Now I want to add some items in the palette view. But unfortunately it
> does not work the way I like.
> Nothing will be displayed..
>
> I extend the GraphicalEditorWithPalette class in my MainEditor and have
> overwritten the getRootPalette function:
>
> protected PaletteRoot getPaletteRoot() {
> PaletteRoot root = new PaletteRoot();
> //root.add(new SelectionToolEntry());
> //root.add(new MarqueeToolEntry());
> PaletteGroup group = new PaletteGroup("tools");
> group.add(new SelectionToolEntry());
> group.add(new MarqueeToolEntry());
> root.add(group);
> return root;
> }
>
> The platte view always says that it is not availiable...
>
> I don't really know what the problem is so a would appreciate any help.
>
> Best regards
> Alex
Previous Topic:How process clicking on EditParts
Next Topic:Custom SWT widgets in palette
Goto Forum:
  


Current Time: Thu Aug 21 14:21:55 EDT 2014

Powered by FUDForum. Page generated in 0.02410 seconds