Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Focus on newly created connection
Focus on newly created connection [message #231865] Mon, 19 March 2007 18:44 Go to next message
Eclipse UserFriend
Originally posted by: gary.pi4tech.com

When a component is created by being dragged from a palette, it
automatically obtains the focus.

However when using the connection tool, the same does not happen for the
created connection.

Is there a simple way to get the focus on the connection, without having
to specifically locate the new edit part and invoke setFocus on the viewer?

Regards
Gary
Re: Focus on newly created connection [message #232002 is a reply to message #231865] Thu, 22 March 2007 05:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

CreationTool has a selectAddedObject() method that is invoked once the
creation command has executed. ConnectionCreationTool doesn't. You can
easily add that by subclassing CCT and setting that as the tool for your
palette entry.

"Gary Brown" <gary@pi4tech.com> wrote in message
news:etmlmu$qa6$1@utils.eclipse.org...
> When a component is created by being dragged from a palette, it
> automatically obtains the focus.
>
> However when using the connection tool, the same does not happen for the
> created connection.
>
> Is there a simple way to get the focus on the connection, without having
> to specifically locate the new edit part and invoke setFocus on the
> viewer?
>
> Regards
> Gary
Re: Focus on newly created connection [message #232096 is a reply to message #232002] Fri, 23 March 2007 11:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gary.pi4tech.com

Thanks for the suggestion, but the method you refer to is on the GMF
CreationTool. I am not using GMF, so need to find a GEF solution.


Pratik Shah wrote:
> CreationTool has a selectAddedObject() method that is invoked once the
> creation command has executed. ConnectionCreationTool doesn't. You can
> easily add that by subclassing CCT and setting that as the tool for your
> palette entry.
>
> "Gary Brown" <gary@pi4tech.com> wrote in message
> news:etmlmu$qa6$1@utils.eclipse.org...
>> When a component is created by being dragged from a palette, it
>> automatically obtains the focus.
>>
>> However when using the connection tool, the same does not happen for the
>> created connection.
>>
>> Is there a simple way to get the focus on the connection, without having
>> to specifically locate the new edit part and invoke setFocus on the
>> viewer?
>>
>> Regards
>> Gary
>
>
Re: Focus on newly created connection [message #232113 is a reply to message #232096] Fri, 23 March 2007 15:00 Go to previous message
Anthony Hunter is currently offline Anthony HunterFriend
Messages: 446
Registered: July 2009
Senior Member
Hi Gary,

Subclass ConnectionCreationTool and override the handleCreateConnection()
method to call your selectAddedObject() method.

You can do exactly what CreationTool does, you can get the model object from
the connection request.

Cheers...
Anthony

"Gary Brown" <gary@pi4tech.com> wrote in message
news:4603BB12.8020208@pi4tech.com...
> Thanks for the suggestion, but the method you refer to is on the GMF
> CreationTool. I am not using GMF, so need to find a GEF solution.
>
>
> Pratik Shah wrote:
>> CreationTool has a selectAddedObject() method that is invoked once the
>> creation command has executed. ConnectionCreationTool doesn't. You can
>> easily add that by subclassing CCT and setting that as the tool for your
>> palette entry.
>>
>> "Gary Brown" <gary@pi4tech.com> wrote in message
>> news:etmlmu$qa6$1@utils.eclipse.org...
>>> When a component is created by being dragged from a palette, it
>>> automatically obtains the focus.
>>>
>>> However when using the connection tool, the same does not happen for the
>>> created connection.
>>>
>>> Is there a simple way to get the focus on the connection, without having
>>> to specifically locate the new edit part and invoke setFocus on the
>>> viewer?
>>>
>>> Regards
>>> Gary
>>
Previous Topic:Re: Process For Finding Out About a Project
Next Topic:Ruler with different units
Goto Forum:
  


Current Time: Wed Oct 20 05:07:11 GMT 2021

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

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

Back to the top