Home » Modeling » GMF (Graphical Modeling Framework) » commands chaining
commands chaining [message #127554] |
Sun, 20 May 2007 18:24  |
Eclipse User |
|
|
|
Hi,
I'm trying to implement the following behaviour: a user clicks element A
with element B creation tool, and then element B appears on the diagram
connected to A with a link.
In the model this corresponds to creating EObject for B and an EObject for
A->B reference.
I have 2 commands for both these actions - there is also some side-work
performed there. So, operation 2 (create reference A->B) needs to take as
an input the result of operation 1 (create new B).
What is the right way for chaining these operations in GMF? Or maybe
should I create a separate command for this action? Hoping not.
Regards,
Alexey
|
|
| |
Re: commands chaining [message #127831 is a reply to message #127717] |
Mon, 21 May 2007 10:54   |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
This is a multi-part message in MIME format.
--------------070202030908050107030006
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Artem,
EMF's commands always have a getResult that should typically be the
thing added, removed, created, copied, or whatever the command is doing
that would best be considered the result of the command. I'm just not
sure how that applies or is accessible in GMF...
Artem Tikhomirov wrote:
> CompositeCommand or #chain() depending on what commands (EMF/GEF/GMF) you
> are using, however, passing data from one command to another is up to you.
> E.g. one can use Request (e.g. see CreateElementRequest#setNewElement) to
> pass this data around.
>
>
> "Alexey Semenov" <alexeysem@gmail.com> wrote in message
> news:op.tsncjpbo32v8ru@asdell...
>
>> Hi,
>>
>> I'm trying to implement the following behaviour: a user clicks element A
>> with element B creation tool, and then element B appears on the diagram
>> connected to A with a link.
>>
>> In the model this corresponds to creating EObject for B and an EObject for
>> A->B reference.
>>
>> I have 2 commands for both these actions - there is also some side-work
>> performed there. So, operation 2 (create reference A->B) needs to take as
>> an input the result of operation 1 (create new B).
>>
>> What is the right way for chaining these operations in GMF? Or maybe
>> should I create a separate command for this action? Hoping not.
>>
>> Regards,
>> Alexey
>>
>
>
>
--------------070202030908050107030006
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Artem,<br>
<br>
EMF's commands always have a getResult that should typically be the
thing added, removed, created, copied, or whatever the command is doing
that would best be considered the result of the command. I'm just not
sure how that applies or is accessible in GMF...<br>
<br>
<br>
Artem Tikhomirov wrote:
<blockquote cite="midf2rs3b$3lb$1@build.eclipse.org" type="cite">
<pre wrap="">CompositeCommand or #chain() depending on what commands (EMF/GEF/GMF) you
are using, however, passing data from one command to another is up to you.
E.g. one can use Request (e.g. see CreateElementRequest#setNewElement) to
pass this data around.
"Alexey Semenov" <a class="moz-txt-link-rfc2396E" href="mailto:alexeysem@gmail.com"><alexeysem@gmail.com></a> wrote in message
<a class="moz-txt-link-freetext" href="news:op.tsncjpbo32v8ru@asdell">news:op.tsncjpbo32v8ru@asdell</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Hi,
I'm trying to implement the following behaviour: a user clicks element A
with element B creation tool, and then element B appears on the diagram
connected to A with a link.
In the model this corresponds to creating EObject for B and an EObject for
A->B reference.
I have 2 commands for both these actions - there is also some side-work
performed there. So, operation 2 (create reference A->B) needs to take as
an input the result of operation 1 (create new B).
What is the right way for chaining these operations in GMF? Or maybe
should I create a separate command for this action? Hoping not.
Regards,
Alexey
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
</body>
</html>
--------------070202030908050107030006--
|
|
|
Re: commands chaining [message #127881 is a reply to message #127831] |
Mon, 21 May 2007 13:43  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_001A_01C79BE0.5217F5B0
Content-Type: text/plain;
charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
getResult() (for those lucky EMF clients ;), GEF's are whining) is still =
only half of the issue - to pass this result to another command one may =
need to put some extra efforts. I assume neither operation 2 nor =
operation 1 knows about its counterpart.
Artem
"Ed Merks" <merks@ca.ibm.com> wrote in message =
news:f2sbqn$a90$1@build.eclipse.org...
Artem,
EMF's commands always have a getResult that should typically be the =
thing added, removed, created, copied, or whatever the command is doing =
that would best be considered the result of the command. I'm just not =
sure how that applies or is accessible in GMF...
Artem Tikhomirov wrote:=20
CompositeCommand or #chain() depending on what commands (EMF/GEF/GMF) =
you=20
are using, however, passing data from one command to another is up to =
you.=20
E.g. one can use Request (e.g. see CreateElementRequest#setNewElement) =
to=20
pass this data around.
"Alexey Semenov" <alexeysem@gmail.com> wrote in message=20
news:op.tsncjpbo32v8ru@asdell...
Hi,
I'm trying to implement the following behaviour: a user clicks element A =
with element B creation tool, and then element B appears on the diagram=20
connected to A with a link.
In the model this corresponds to creating EObject for B and an EObject =
for=20
A->B reference.
I have 2 commands for both these actions - there is also some side-work=20
performed there. So, operation 2 (create reference A->B) needs to take =
as=20
an input the result of operation 1 (create new B).
What is the right way for chaining these operations in GMF? Or maybe=20
should I create a separate command for this action? Hoping not.
Regards,
Alexey=20
=20
=20
------=_NextPart_000_001A_01C79BE0.5217F5B0
Content-Type: text/html;
charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.2900.3086" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>getResult() (for those lucky EMF =
clients ;), GEF's=20
are whining) is still only half of the issue - to pass this result =
to=20
another command one may need to put some extra efforts. I assume neither =
operation 2 nor operation 1 knows about its counterpart.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Artem</FONT></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" <<A =
href=3D"mailto:merks@ca.ibm.com">merks@ca.ibm.com</A>>=20
wrote in message <A=20
=
href=3D"news:f2sbqn$a90$1@build.eclipse.org">news:f2sbqn$a90$1@build.ecli=
pse.org</A>...</DIV>Artem,<BR><BR>EMF's=20
commands always have a getResult that should typically be the =
thing=20
added, removed, created, copied, or whatever the command is doing that =
would=20
best be considered the result of the command. I'm just not sure =
how that=20
applies or is accessible in GMF...<BR><BR><BR>Artem Tikhomirov wrote:=20
<BLOCKQUOTE cite=3Dmidf2rs3b$3lb$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">CompositeCommand or #chain() depending on =
what commands (EMF/GEF/GMF) you=20
are using, however, passing data from one command to another is up to =
you.=20
E.g. one can use Request (e.g. see CreateElementRequest#setNewElement) =
to=20
pass this data around.
"Alexey Semenov" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:alexeysem@gmail.com"><alexeysem@gmail.com></A> =
wrote in message=20
<A class=3Dmoz-txt-link-freetext =
href=3D"news:op.tsncjpbo32v8ru@asdell">news:op.tsncjpbo32v8ru@asdell</A>.=
...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Hi,
I'm trying to implement the following behaviour: a user clicks element A =
with element B creation tool, and then element B appears on the diagram=20
connected to A with a link.
In the model this corresponds to creating EObject for B and an EObject =
for=20
A->B reference.
I have 2 commands for both these actions - there is also some side-work=20
performed there. So, operation 2 (create reference A->B) needs to =
take as=20
an input the result of operation 1 (create new B).
What is the right way for chaining these operations in GMF? Or maybe=20
should I create a separate command for this action? Hoping not.
Regards,
Alexey=20
</PRE></BLOCKQUOTE><PRE wrap=3D""><!---->
</PRE></BLOCKQUOTE><BR></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_001A_01C79BE0.5217F5B0--
|
|
|
Goto Forum:
Current Time: Sun Aug 31 14:56:12 EDT 2025
Powered by FUDForum. Page generated in 0.09597 seconds
|