Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » CombinedTemplateCreationEntry issue(how set default tool to be last tool used)
CombinedTemplateCreationEntry issue [message #520857] Mon, 15 March 2010 11:32 Go to next message
Tanguy Mezzano is currently offline Tanguy Mezzano
Messages: 23
Registered: March 2010
Junior Member
Hello,

I would like to set the default tool to the last CombinedTemplateCreationEntry from my Palette. When creating several rectangles by using the Palette, the user needs to select each time in the Palette the rectangle entry and the click in the editor. Is there a way to set by default the tool to be the last PaletteEntry selected?

Thx,

[Updated on: Mon, 15 March 2010 11:32]

Report message to a moderator

Re: CombinedTemplateCreationEntry issue [message #520888 is a reply to message #520857] Mon, 15 March 2010 12:34 Go to previous messageGo to next message
Tanguy Mezzano is currently offline Tanguy Mezzano
Messages: 23
Registered: March 2010
Junior Member
Ok, I solved my issue.

I used the PaletteListener() ... works well.

++
Re: CombinedTemplateCreationEntry issue [message #521167 is a reply to message #520888] Tue, 16 March 2010 12:00 Go to previous messageGo to next message
Deepak Singla is currently offline Deepak Singla
Messages: 27
Registered: December 2009
Junior Member
Can you please share your idea how you implemented that?

Any code sample will be appriciated.
Re: CombinedTemplateCreationEntry issue [message #521180 is a reply to message #521167] Tue, 16 March 2010 12:25 Go to previous message
Tanguy Mezzano is currently offline Tanguy Mezzano
Messages: 23
Registered: March 2010
Junior Member
Here it is Smile

        /** Configures the palette viewer and adds a drag source listener to it */
	protected PaletteViewerProvider createPaletteViewerProvider() {
		return new PaletteViewerProvider(getEditDomain()) {
			protected void configurePaletteViewer(PaletteViewer viewer) {
					super.configurePaletteViewer(viewer);
					paletteListener = new PaletteListener() {

					@Override
					public void activeToolChanged(PaletteViewer palette,
							ToolEntry tool) {
						getPaletteRoot().setDefaultEntry(tool);
					}
					
				};
				viewer.addPaletteListener(paletteListener);
				viewer.addDragSourceListener(new TemplateTransferDragSourceListener(viewer));
			}
		};
	}
Previous Topic:ColorDialog and Wrong Colors
Next Topic:[ZEST] Draw a Rectangle in the Background
Goto Forum:
  


Current Time: Sat Aug 23 01:43:28 EDT 2014

Powered by FUDForum. Page generated in 0.02452 seconds