Skip to main content



      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
Eclipse UserFriend
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] by 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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
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: Wed Jul 23 06:06:19 EDT 2025

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

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

Back to the top