Skip to main content


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 15:32 Go to next message
Tanguy Mezzano is currently offline Tanguy MezzanoFriend
Messages: 24
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 15:32]

Report message to a moderator

Re: CombinedTemplateCreationEntry issue [message #520888 is a reply to message #520857] Mon, 15 March 2010 16:34 Go to previous messageGo to next message
Tanguy Mezzano is currently offline Tanguy MezzanoFriend
Messages: 24
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 16:00 Go to previous messageGo to next message
Deepak Singla is currently offline Deepak SinglaFriend
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 16:25 Go to previous message
Tanguy Mezzano is currently offline Tanguy MezzanoFriend
Messages: 24
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: Thu Apr 25 01:07:35 GMT 2024

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

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

Back to the top