Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Runtime: how to prevent reconnecting connections?
Runtime: how to prevent reconnecting connections? [message #65614] Thu, 19 October 2006 14:25 Go to next message
Henrik Rentz-Reichert is currently offline Henrik Rentz-ReichertFriend
Messages: 261
Registered: July 2009
Senior Member
Hi runtime team,

I have overridden the
getReorientRelationshipCommand(ReorientRelationshipRequest) method in
the EditHelpers for my connections.

The returned command is executable only for valid connections (I have
several node types and two connection types).

However, still it is possible to reconnect to an invalid node which
makes my model inconsistent.


When digging into it I found that
getReconnectTargetCommand(ReconnectRequest) of the
GraphicalNodeEditPolicy is responsible for that.


How can I prevent a connection from being reconnected to an invalid (in
the sense of my model) edit part? Do I have to subclass the
GraphicalNodeEditPolicy and replace it by the subclass?

Thanks,
Henrik

PS: I don't use any generated code.
Re: Runtime: how to prevent reconnecting connections? [message #65656 is a reply to message #65614] Thu, 19 October 2006 14:46 Go to previous messageGo to next message
Cherie Revells is currently offline Cherie RevellsFriend
Messages: 299
Registered: July 2009
Senior Member
Henrik,

Try returning an unexecutable command when reorient should not be supported.

Regards,
Cherie

Henrik Rentz-Reichert wrote:
> Hi runtime team,
>
> I have overridden the
> getReorientRelationshipCommand(ReorientRelationshipRequest) method in
> the EditHelpers for my connections.
>
> The returned command is executable only for valid connections (I have
> several node types and two connection types).
>
> However, still it is possible to reconnect to an invalid node which
> makes my model inconsistent.
>
>
> When digging into it I found that
> getReconnectTargetCommand(ReconnectRequest) of the
> GraphicalNodeEditPolicy is responsible for that.
>
>
> How can I prevent a connection from being reconnected to an invalid (in
> the sense of my model) edit part? Do I have to subclass the
> GraphicalNodeEditPolicy and replace it by the subclass?
>
> Thanks,
> Henrik
>
> PS: I don't use any generated code.
Re: Runtime: how to prevent reconnecting connections? [message #66099 is a reply to message #65656] Fri, 20 October 2006 08:07 Go to previous messageGo to next message
Henrik Rentz-Reichert is currently offline Henrik Rentz-ReichertFriend
Messages: 261
Registered: July 2009
Senior Member
Hi Cherie (the former Cherie Mahoney?),

thanks for the reply.

I tryed this

protected ICommand
getReorientRelationshipCommand(ReorientRelationshipRequest req) {
return UnexecutableCommand.INSTANCE;
}

in my EditHelper of the connection.
It didn't change the behavior.

Then I went from my maintenance branch of the release product which is
based on 1.0RC3 of GMF to the HEAD of my trunk which is based on GMF
1.0. There everything works as expected.

Can you tell me which change in the Runtime between 1.0RC3 and 1.0 is
responsible for the changed behavior?

Thanks again,
Henrik

Cherie Revells wrote:
> Henrik,
>
> Try returning an unexecutable command when reorient should not be
> supported.
>
> Regards,
> Cherie
>
> Henrik Rentz-Reichert wrote:
>> Hi runtime team,
>>
>> I have overridden the
>> getReorientRelationshipCommand(ReorientRelationshipRequest) method in
>> the EditHelpers for my connections.
>>
>> The returned command is executable only for valid connections (I have
>> several node types and two connection types).
>>
>> However, still it is possible to reconnect to an invalid node which
>> makes my model inconsistent.
>>
>>
>> When digging into it I found that
>> getReconnectTargetCommand(ReconnectRequest) of the
>> GraphicalNodeEditPolicy is responsible for that.
>>
>>
>> How can I prevent a connection from being reconnected to an invalid (in
>> the sense of my model) edit part? Do I have to subclass the
>> GraphicalNodeEditPolicy and replace it by the subclass?
>>
>> Thanks,
>> Henrik
>>
>> PS: I don't use any generated code.
Re: Runtime: how to prevent reconnecting connections? [message #66445 is a reply to message #66099] Fri, 20 October 2006 14:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vcciubot.uwaterloo.ca

It's a problem with the generated edit helpers. Make sure your version of
getReorientRelationshipCommand gets called. If not, see what the generated
base edit helper is doing.

Note: the edit helper commands are retrieved by your semantic policy.


On Fri, 20 Oct 2006 10:07:53 +0200, Henrik Rentz-Reichert wrote:

> Hi Cherie (the former Cherie Mahoney?),
>
> thanks for the reply.
>
> I tryed this
>
> protected ICommand
> getReorientRelationshipCommand(ReorientRelationshipRequest req) {
> return UnexecutableCommand.INSTANCE;
> }
>
> in my EditHelper of the connection.
> It didn't change the behavior.
>
> Then I went from my maintenance branch of the release product which is
> based on 1.0RC3 of GMF to the HEAD of my trunk which is based on GMF
> 1.0. There everything works as expected.
>
> Can you tell me which change in the Runtime between 1.0RC3 and 1.0 is
> responsible for the changed behavior?
>
> Thanks again,
> Henrik
>
> Cherie Revells wrote:
>> Henrik,
>>
>> Try returning an unexecutable command when reorient should not be
>> supported.
>>
>> Regards,
>> Cherie
>>
>> Henrik Rentz-Reichert wrote:
>>> Hi runtime team,
>>>
>>> I have overridden the
>>> getReorientRelationshipCommand(ReorientRelationshipRequest) method in
>>> the EditHelpers for my connections.
>>>
>>> The returned command is executable only for valid connections (I have
>>> several node types and two connection types).
>>>
>>> However, still it is possible to reconnect to an invalid node which
>>> makes my model inconsistent.
>>>
>>>
>>> When digging into it I found that
>>> getReconnectTargetCommand(ReconnectRequest) of the
>>> GraphicalNodeEditPolicy is responsible for that.
>>>
>>>
>>> How can I prevent a connection from being reconnected to an invalid (in
>>> the sense of my model) edit part? Do I have to subclass the
>>> GraphicalNodeEditPolicy and replace it by the subclass?
>>>
>>> Thanks,
>>> Henrik
>>>
>>> PS: I don't use any generated code.
Re: Runtime: how to prevent reconnecting connections? [message #68835 is a reply to message #66445] Wed, 25 October 2006 06:50 Go to previous messageGo to next message
Henrik Rentz-Reichert is currently offline Henrik Rentz-ReichertFriend
Messages: 261
Registered: July 2009
Senior Member
Hi Vlad,

I don't use generated code. My editor is built right upon the GMF
runtime. The getReorientRelationshipCommand() of my EditHelper is called
and canExecute() of the returned command is evaluated with result false.
But then the framework proceeds and comes up with an executable command...

Kind regards,
Henrik

Vlad Ciubotariu wrote:
> It's a problem with the generated edit helpers. Make sure your version of
> getReorientRelationshipCommand gets called. If not, see what the generated
> base edit helper is doing.
>
> Note: the edit helper commands are retrieved by your semantic policy.
>
>
> On Fri, 20 Oct 2006 10:07:53 +0200, Henrik Rentz-Reichert wrote:
>
>> Hi Cherie (the former Cherie Mahoney?),
>>
>> thanks for the reply.
>>
>> I tryed this
>>
>> protected ICommand
>> getReorientRelationshipCommand(ReorientRelationshipRequest req) {
>> return UnexecutableCommand.INSTANCE;
>> }
>>
>> in my EditHelper of the connection.
>> It didn't change the behavior.
>>
>> Then I went from my maintenance branch of the release product which is
>> based on 1.0RC3 of GMF to the HEAD of my trunk which is based on GMF
>> 1.0. There everything works as expected.
>>
>> Can you tell me which change in the Runtime between 1.0RC3 and 1.0 is
>> responsible for the changed behavior?
>>
>> Thanks again,
>> Henrik
>>
>> Cherie Revells wrote:
>>> Henrik,
>>>
>>> Try returning an unexecutable command when reorient should not be
>>> supported.
>>>
>>> Regards,
>>> Cherie
>>>
>>> Henrik Rentz-Reichert wrote:
>>>> Hi runtime team,
>>>>
>>>> I have overridden the
>>>> getReorientRelationshipCommand(ReorientRelationshipRequest) method in
>>>> the EditHelpers for my connections.
>>>>
>>>> The returned command is executable only for valid connections (I have
>>>> several node types and two connection types).
>>>>
>>>> However, still it is possible to reconnect to an invalid node which
>>>> makes my model inconsistent.
>>>>
>>>>
>>>> When digging into it I found that
>>>> getReconnectTargetCommand(ReconnectRequest) of the
>>>> GraphicalNodeEditPolicy is responsible for that.
>>>>
>>>>
>>>> How can I prevent a connection from being reconnected to an invalid (in
>>>> the sense of my model) edit part? Do I have to subclass the
>>>> GraphicalNodeEditPolicy and replace it by the subclass?
>>>>
>>>> Thanks,
>>>> Henrik
>>>>
>>>> PS: I don't use any generated code.
>
Re: Runtime: how to prevent reconnecting connections? [message #70292 is a reply to message #68835] Thu, 26 October 2006 15:12 Go to previous messageGo to next message
Cherie Revells is currently offline Cherie RevellsFriend
Messages: 299
Registered: July 2009
Senior Member
Henrik,

Yes, this is the former Cherie Mahoney. I got married this summer. :-)

I will test this out with the latest code and get back to you.

- Cherie

Henrik Rentz-Reichert wrote:
> Hi Vlad,
>
> I don't use generated code. My editor is built right upon the GMF
> runtime. The getReorientRelationshipCommand() of my EditHelper is called
> and canExecute() of the returned command is evaluated with result false.
> But then the framework proceeds and comes up with an executable command...
>
> Kind regards,
> Henrik
>
> Vlad Ciubotariu wrote:
>> It's a problem with the generated edit helpers. Make sure your version of
>> getReorientRelationshipCommand gets called. If not, see what the generated
>> base edit helper is doing.
>>
>> Note: the edit helper commands are retrieved by your semantic policy.
>>
>>
>> On Fri, 20 Oct 2006 10:07:53 +0200, Henrik Rentz-Reichert wrote:
>>
>>> Hi Cherie (the former Cherie Mahoney?),
>>>
>>> thanks for the reply.
>>>
>>> I tryed this
>>>
>>> protected ICommand
>>> getReorientRelationshipCommand(ReorientRelationshipRequest req) {
>>> return UnexecutableCommand.INSTANCE;
>>> }
>>>
>>> in my EditHelper of the connection.
>>> It didn't change the behavior.
>>>
>>> Then I went from my maintenance branch of the release product which is
>>> based on 1.0RC3 of GMF to the HEAD of my trunk which is based on GMF
>>> 1.0. There everything works as expected.
>>>
>>> Can you tell me which change in the Runtime between 1.0RC3 and 1.0 is
>>> responsible for the changed behavior?
>>>
>>> Thanks again,
>>> Henrik
>>>
>>> Cherie Revells wrote:
>>>> Henrik,
>>>>
>>>> Try returning an unexecutable command when reorient should not be
>>>> supported.
>>>>
>>>> Regards,
>>>> Cherie
>>>>
>>>> Henrik Rentz-Reichert wrote:
>>>>> Hi runtime team,
>>>>>
>>>>> I have overridden the
>>>>> getReorientRelationshipCommand(ReorientRelationshipRequest) method in
>>>>> the EditHelpers for my connections.
>>>>>
>>>>> The returned command is executable only for valid connections (I have
>>>>> several node types and two connection types).
>>>>>
>>>>> However, still it is possible to reconnect to an invalid node which
>>>>> makes my model inconsistent.
>>>>>
>>>>>
>>>>> When digging into it I found that
>>>>> getReconnectTargetCommand(ReconnectRequest) of the
>>>>> GraphicalNodeEditPolicy is responsible for that.
>>>>>
>>>>>
>>>>> How can I prevent a connection from being reconnected to an invalid (in
>>>>> the sense of my model) edit part? Do I have to subclass the
>>>>> GraphicalNodeEditPolicy and replace it by the subclass?
>>>>>
>>>>> Thanks,
>>>>> Henrik
>>>>>
>>>>> PS: I don't use any generated code.
Re: Runtime: how to prevent reconnecting connections? [message #71024 is a reply to message #70292] Fri, 27 October 2006 16:37 Go to previous message
Cherie Revells is currently offline Cherie RevellsFriend
Messages: 299
Registered: July 2009
Senior Member
Henrik,

I tried out the Logic Diagram Example using the code in GMF head. I do
not notice this problem when reorienting wires and note attachments.

Could you figure out what is returning the executable command?

- Cherie

Cherie Revells wrote:
> Henrik,
>
> Yes, this is the former Cherie Mahoney. I got married this summer. :-)
>
> I will test this out with the latest code and get back to you.
>
> - Cherie
>
> Henrik Rentz-Reichert wrote:
>> Hi Vlad,
>>
>> I don't use generated code. My editor is built right upon the GMF
>> runtime. The getReorientRelationshipCommand() of my EditHelper is called
>> and canExecute() of the returned command is evaluated with result false.
>> But then the framework proceeds and comes up with an executable
>> command...
>>
>> Kind regards,
>> Henrik
>>
>> Vlad Ciubotariu wrote:
>>> It's a problem with the generated edit helpers. Make sure your
>>> version of
>>> getReorientRelationshipCommand gets called. If not, see what the
>>> generated
>>> base edit helper is doing.
>>> Note: the edit helper commands are retrieved by your semantic policy.
>>>
>>>
>>> On Fri, 20 Oct 2006 10:07:53 +0200, Henrik Rentz-Reichert wrote:
>>>
>>>> Hi Cherie (the former Cherie Mahoney?),
>>>>
>>>> thanks for the reply.
>>>>
>>>> I tryed this
>>>>
>>>> protected ICommand
>>>> getReorientRelationshipCommand(ReorientRelationshipRequest req) {
>>>> return UnexecutableCommand.INSTANCE;
>>>> }
>>>>
>>>> in my EditHelper of the connection.
>>>> It didn't change the behavior.
>>>>
>>>> Then I went from my maintenance branch of the release product which is
>>>> based on 1.0RC3 of GMF to the HEAD of my trunk which is based on GMF
>>>> 1.0. There everything works as expected.
>>>>
>>>> Can you tell me which change in the Runtime between 1.0RC3 and 1.0 is
>>>> responsible for the changed behavior?
>>>>
>>>> Thanks again,
>>>> Henrik
>>>>
>>>> Cherie Revells wrote:
>>>>> Henrik,
>>>>>
>>>>> Try returning an unexecutable command when reorient should not be
>>>>> supported.
>>>>>
>>>>> Regards,
>>>>> Cherie
>>>>>
>>>>> Henrik Rentz-Reichert wrote:
>>>>>> Hi runtime team,
>>>>>>
>>>>>> I have overridden the
>>>>>> getReorientRelationshipCommand(ReorientRelationshipRequest) method in
>>>>>> the EditHelpers for my connections.
>>>>>>
>>>>>> The returned command is executable only for valid connections (I have
>>>>>> several node types and two connection types).
>>>>>>
>>>>>> However, still it is possible to reconnect to an invalid node which
>>>>>> makes my model inconsistent.
>>>>>>
>>>>>>
>>>>>> When digging into it I found that
>>>>>> getReconnectTargetCommand(ReconnectRequest) of the
>>>>>> GraphicalNodeEditPolicy is responsible for that.
>>>>>>
>>>>>>
>>>>>> How can I prevent a connection from being reconnected to an
>>>>>> invalid (in
>>>>>> the sense of my model) edit part? Do I have to subclass the
>>>>>> GraphicalNodeEditPolicy and replace it by the subclass?
>>>>>>
>>>>>> Thanks,
>>>>>> Henrik
>>>>>>
>>>>>> PS: I don't use any generated code.
Previous Topic:Code for Outline
Next Topic:Mindmap example error
Goto Forum:
  


Current Time: Fri Jan 03 03:25:31 GMT 2025

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

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

Back to the top