Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to get ToolEntry for a tool ?
How to get ToolEntry for a tool ? [message #123430] Wed, 02 May 2007 13:14 Go to next message
Eclipse UserFriend
Originally posted by: bagnard.natacha.free.fr

Hello,
I created a graphical editor with a palette which has 3 tools for
creating the same type of elements but which a different attribute name
value.
Then, the elementType associated with each tool is the same but I want
to know which one is used when I click on it.
In order to be able to differentiate each tool I've used different
toolEntry name and associated representation.
But now I don't know how to manage to get it back. I've find how to get
the activeTool but can't connect it with the associated toolEntry.

Does anyone has an idea ?

Natacha
Re: How to get ToolEntry for a tool ? [message #123603 is a reply to message #123430] Thu, 03 May 2007 05:28 Go to previous message
Eclipse UserFriend
Originally posted by: khai.n.situvista.com

Can you provide a little more info on your implementation?

How did you implement the tool to provide the "...same type element but
with different attribute name value"?

Where in the code are you accessing the 'activeTool'?

There is no direct link (that I know of) between an activeTool and its
ToolEntry because ToolEntry does not keep track of the Tools it creates.

One possibility is to substitute the default creation tool with a simple
subclass of UnspecifiedTypeCreationTool in
XXXPaletteFactory.NodeToolEntry.createTool().

In this subclass you can have a public attribute to hold the title or
description of the NodeToolEntry, or any other information that will
help you determine which NodeToolEntry created this Tool.


With more info we might be able to find a better approach.

-- Khai --


natacha bagnard wrote:
> Hello,
> I created a graphical editor with a palette which has 3 tools for
> creating the same type of elements but which a different attribute name
> value.
> Then, the elementType associated with each tool is the same but I want
> to know which one is used when I click on it.
> In order to be able to differentiate each tool I've used different
> toolEntry name and associated representation.
> But now I don't know how to manage to get it back. I've find how to get
> the activeTool but can't connect it with the associated toolEntry.
>
> Does anyone has an idea ?
>
> Natacha
Previous Topic:Double click event
Next Topic:Proggrammaticaly add an element for the "root" model element (access the root element prob
Goto Forum:
  


Current Time: Thu Dec 26 23:15:33 GMT 2024

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

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

Back to the top