Skip to main content



      Home
Home » Eclipse Projects » GEF » Overriding handleCreateConnection in ConnectionCreationTool
Overriding handleCreateConnection in ConnectionCreationTool [message #243611] Fri, 13 June 2008 18:14 Go to next message
Eclipse UserFriend
Originally posted by: mingerman.metatomix.com

I have created my own create tool by subclassing ConnectionCreationTool.
The Java DOC for the handleCreateConnection method indicates that the method
can be overriden to allow for 'prompting the user...' for connection
information. I have had a difficult time getting this to work.

I create a popup-menu with the options, but then the code would execute
before the menu item would be selected. I have added a readAndDispatch loop
to prevent this, but it only works on the MAC and Linux and not on Windows.
If I don't have the loop but just one call, it works on the MAC and Windows,
but not Linux.

I also tried to create a pop-up dialog to get around this, but the loosing
focus and other problems made this situation worse (the targetEditPart is
erased for example).

Is their a suggested way to 'prompt the user'? Are they any samples?

I am using GEF 3.3.2v20080129 under Eclipse 3.3.2 M20080221-1800

Thanks.
--
Mark M. Ingerman
Senior Architect
Metatomix
www.metatomix.com
781 907-6746
Re: Overriding handleCreateConnection in ConnectionCreationTool [message #243617 is a reply to message #243611] Fri, 13 June 2008 19:05 Go to previous message
Eclipse UserFriend
Originally posted by: mingerman.metatomix.com

I might have found my problem. It seems that by performing the read and
dispatch, I distribute the mouse up event too soon. I over-rode the
handleViewerExited to not process if in the middle of my menu selection.
This appears to fix the problem, but I want to know if this is an acceptable
method.

Thanks.


On 6/13/08 6:14 PM, in article C478697F.4E88%mingerman@metatomix.com,
"Ingerman Mark" <mingerman@metatomix.com> wrote:

> I have created my own create tool by subclassing ConnectionCreationTool.
> The Java DOC for the handleCreateConnection method indicates that the method
> can be overriden to allow for 'prompting the user...' for connection
> information. I have had a difficult time getting this to work.
>
> I create a popup-menu with the options, but then the code would execute
> before the menu item would be selected. I have added a readAndDispatch loop
> to prevent this, but it only works on the MAC and Linux and not on Windows.
> If I don't have the loop but just one call, it works on the MAC and Windows,
> but not Linux.
>
> I also tried to create a pop-up dialog to get around this, but the loosing
> focus and other problems made this situation worse (the targetEditPart is
> erased for example).
>
> Is their a suggested way to 'prompt the user'? Are they any samples?
>
> I am using GEF 3.3.2v20080129 under Eclipse 3.3.2 M20080221-1800
>
> Thanks.

--
Mark M. Ingerman
Senior Architect
Metatomix
www.metatomix.com
781 907-6746
Previous Topic:Zesty Mindmaps
Next Topic:Zest 3.4.0RC4: org.eclipse.ui.services.IDisposable not found
Goto Forum:
  


Current Time: Sat May 10 20:37:09 EDT 2025

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

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

Back to the top