Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Select Palette entry in code
Select Palette entry in code [message #245481] Mon, 15 September 2008 06:43 Go to next message
Carsten Spieker is currently offline Carsten SpiekerFriend
Messages: 197
Registered: July 2009
Senior Member
Hi,

is it possible to select a palette tool entry in code? I want to make some
entries available with shortcuts.

Thanks for any help!

Greetz,
Carsten
Re: Select Palette entry in code [message #245519 is a reply to message #245481] Tue, 16 September 2008 08:57 Go to previous messageGo to next message
Richard Adams is currently offline Richard AdamsFriend
Messages: 77
Registered: July 2009
Location: Edinburgh
Member
What exactly do you want to do?
Is is to activate a creation tool without having to click on the palette?
You can set the active tool for the edit domain with

domain.setActiveTool(Tool tool)

which is essentially what is eventually called when you click on a
palette item.

The parameter tool would be that which is normally created by your
ToolEntry.createTool() method.

Richard


Re: Select Palette entry in code [message #245572 is a reply to message #245519] Wed, 17 September 2008 04:48 Go to previous messageGo to next message
Carsten Spieker is currently offline Carsten SpiekerFriend
Messages: 197
Registered: July 2009
Senior Member
Hi Richard,

well this is what I have been looking for. Thank you very much!

Only Problem:
This code sets the active tool, but does not select the ToolEntry in the
palette viewer, so that the user can easily see that this tool
is selected. Maybe there is a special method for reaching this?

Greetz,
Carsten


"Richard Adams" <richard.adams@ed.ac.uk> schrieb im Newsbeitrag
news:1023233db57a73c70f0b62b5e45696b4$1@www.eclipse.org...
> What exactly do you want to do?
> Is is to activate a creation tool without having to click on the palette?
> You can set the active tool for the edit domain with
>
> domain.setActiveTool(Tool tool)
>
> which is essentially what is eventually called when you click on a palette
> item.
>
> The parameter tool would be that which is normally created by your
> ToolEntry.createTool() method.
>
> Richard
>
>
>
>
Re: Select Palette entry in code [message #245575 is a reply to message #245572] Wed, 17 September 2008 10:34 Go to previous messageGo to next message
Richard Adams is currently offline Richard AdamsFriend
Messages: 77
Registered: July 2009
Location: Edinburgh
Member
Not sure - there are palette edit parts, possibly you can get the
PaletteViewer to select the palette editPart? This might trigger the whole
tool creation process and call the setACtiveTool() method I mentioned
before.
If you dig around in the PaletteViewer, PaletteEntry and ToolEntry
classes a solution is probably in there.

Cheers
Richard


Re: Select Palette entry in code [message #245592 is a reply to message #245575] Thu, 18 September 2008 04:57 Go to previous message
Carsten Spieker is currently offline Carsten SpiekerFriend
Messages: 197
Registered: July 2009
Senior Member
Well, yesterday I?ve already digged the whole day, without any result, I
must have beean some kind of blind.
Now I have tried the setActiveTool(ToolEntry entry) method in class
PaletteViewer. And it works!

Thanks a lot!

Carsten



"Richard Adams" <richard.adams@ed.ac.uk> schrieb im Newsbeitrag
news:d488e611cb52a99896953aeae197261b$1@www.eclipse.org...
> Not sure - there are palette edit parts, possibly you can get the
> PaletteViewer to select the palette editPart? This might trigger the whole
> tool creation process and call the setACtiveTool() method I mentioned
> before.
> If you dig around in the PaletteViewer, PaletteEntry and ToolEntry classes
> a solution is probably in there.
>
> Cheers
> Richard
>
Previous Topic:Zest - Zoom
Next Topic:Is it possible to provide a Screen Capture functionality in GEF editors?
Goto Forum:
  


Current Time: Fri Apr 26 06:43:53 GMT 2024

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

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

Back to the top