Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » wizard
wizard [message #115717] Wed, 04 February 2004 23:18 Go to next message
Eclipse UserFriend
Originally posted by: david_michonneau.hotmail.com

I have a question regarding commands and UI changes.

I'm going to take an example, rather than staying on an abstract level:

Let's say that when I add an element to a graphical editor, a small popup
wizard appears. In each step of the wizardI configure the new object to be
added to the graph. When the wizard is completed the object is created to
the diagram, and this is a single undoable operation.

Now from an implementation point of view, each step in the wizard will be
mapped to a command. Since each step is dependent from the previous one, I
want to be able to execute each command on the model, as the user goes
through each step, so that I know what UI to show in the next step, by
inspecting the model.

How do I do such thing? When I execute a command it goes on the
commandstack. Note that between each commands I've got some different UI to
show, but in the end I want only one big command in the commandstack (that
does not capture the UI, since it's not model related).

Thanks,

David
Re: wizard [message #115743 is a reply to message #115717] Wed, 04 February 2004 23:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Lamont_Gilbert.rigidsoftware.com

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David Michonneau wrote:
| I have a question regarding commands and UI changes.
|
| I'm going to take an example, rather than staying on an abstract level:
|
| Let's say that when I add an element to a graphical editor, a small popup
| wizard appears. In each step of the wizardI configure the new object to be
| added to the graph. When the wizard is completed the object is created to
| the diagram, and this is a single undoable operation.
|
| Now from an implementation point of view, each step in the wizard will be
| mapped to a command. Since each step is dependent from the previous one, I
| want to be able to execute each command on the model, as the user goes
| through each step, so that I know what UI to show in the next step, by
| inspecting the model.
|
| How do I do such thing? When I execute a command it goes on the
| commandstack. Note that between each commands I've got some different
UI to
| show, but in the end I want only one big command in the commandstack (that
| does not capture the UI, since it's not model related).
|
| Thanks,
|
| David
|
|

I was not able to affect multi-step commands. I redid my thinking and
baked it all into 1 single command. Perhaps you need to open a
"simulation" window to allow these intermediate steps, and once
confirmed, execute the full command. But that too would be composed of
steps...

I know you pain. The problem is that the results of one command are not
seen by another so to speak.

Like I said, I ended up conflating it into a single command.


- --
Respectfully,


CL Gilbert

"Verily, verily, I say unto you, He that entereth not by the door() into
the sheepfold{}, but climbeth up some other *way, the same is a thief
and a robber." John 10:1

GnuPG Key Fingerprint:
82A6 8893 C2A1 F64E A9AD 19AE 55B2 4CD7 80D2 0A2D

For a free Java interface to Freechess.org see
http://www.rigidsoftware.com/Chess/chess.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAIYXJVbJM14DSCi0RAlkIAJ9h5VxHatkHBNgtlB/58nlJJbpp5ACe JpK2
G8LowG5vT+RwCA5IoMPh+mg=
=4fP2
-----END PGP SIGNATURE-----
Re: wizard [message #115756 is a reply to message #115743] Thu, 05 February 2004 00:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: david_michonneau.hotmail.com

There is no doubt at the end one single command will be added to the command
stack, the whole problem is the creation of that compoudcommand. For
example:

Command1 -> Model1
if (Model1.condition)
Command2
else
Command3

If I don't execute Command1, I have to mentally compute its result to write
the proper condition. So it;s much more productive to execute commands one
by one. With a large number of commands it can become a real headache. If my
understanding is correct EMF has solved this with
CompoundCommand.appendAndExecute( see my previous post). Now I'm more
interested on how to mix UI actions in between commands.

David
"CL [dnoyeb] Gilbert" <Lamont_Gilbert@rigidsoftware.com> wrote in message
news:bvs0fo$vcj$1@eclipse.org...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> David Michonneau wrote:
> | I have a question regarding commands and UI changes.
> |
> | I'm going to take an example, rather than staying on an abstract level:
> |
> | Let's say that when I add an element to a graphical editor, a small
popup
> | wizard appears. In each step of the wizardI configure the new object to
be
> | added to the graph. When the wizard is completed the object is created
to
> | the diagram, and this is a single undoable operation.
> |
> | Now from an implementation point of view, each step in the wizard will
be
> | mapped to a command. Since each step is dependent from the previous one,
I
> | want to be able to execute each command on the model, as the user goes
> | through each step, so that I know what UI to show in the next step, by
> | inspecting the model.
> |
> | How do I do such thing? When I execute a command it goes on the
> | commandstack. Note that between each commands I've got some different
> UI to
> | show, but in the end I want only one big command in the commandstack
(that
> | does not capture the UI, since it's not model related).
> |
> | Thanks,
> |
> | David
> |
> |
>
> I was not able to affect multi-step commands. I redid my thinking and
> baked it all into 1 single command. Perhaps you need to open a
> "simulation" window to allow these intermediate steps, and once
> confirmed, execute the full command. But that too would be composed of
> steps...
>
> I know you pain. The problem is that the results of one command are not
> seen by another so to speak.
>
> Like I said, I ended up conflating it into a single command.
>
>
> - --
> Respectfully,
>
>
> CL Gilbert
>
> "Verily, verily, I say unto you, He that entereth not by the door() into
> the sheepfold{}, but climbeth up some other *way, the same is a thief
> and a robber." John 10:1
>
> GnuPG Key Fingerprint:
> 82A6 8893 C2A1 F64E A9AD 19AE 55B2 4CD7 80D2 0A2D
>
> For a free Java interface to Freechess.org see
> http://www.rigidsoftware.com/Chess/chess.html
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFAIYXJVbJM14DSCi0RAlkIAJ9h5VxHatkHBNgtlB/58nlJJbpp5ACe JpK2
> G8LowG5vT+RwCA5IoMPh+mg=
> =4fP2
> -----END PGP SIGNATURE-----
>
Re: wizard [message #115807 is a reply to message #115717] Thu, 05 February 2004 05:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: g.wagenknecht.intershop.de

David Michonneau wrote:

> Now from an implementation point of view, each step in the wizard
> will be mapped to a command. Since each step is dependent from the
> previous one, I want to be able to execute each command on the model,
> as the user goes through each step, so that I know what UI to show in
> the next step, by inspecting the model.

Using this approach you have to take care that you model is not in an
inconsistent state when the user clicks "Cancel" (remember, a wizard should
be cancelable).

> How do I do such thing? When I execute a command it goes on the
> commandstack.

When you execute a command, it will be executed.

> Note that between each commands I've got some different
> UI to show, but in the end I want only one big command in the
> commandstack (that does not capture the UI, since it's not model
> related).

So you want a CompoundCommand.

I don't know you model but have you ever looked at the Eclipse wizard
framework? A wizards consists of several pages and they are not operating on
the model directly until the user has clicked "Finish". I would suggest
going this way. Get some working copies of your model elements and mangle
these (do with them whatever you like). It is even possible to execute the
commands on these elements without going through the editor. Simply call the
command yourself. If the user clicks "Finish" you are free to create a
CompoundCommand and throw it to an execution engine (which could be but is
not limited to your editor). Going this way might give you a chance to reuse
the wizards outside of your editors.

Cu, Gunnar
Re: wizard [message #115998 is a reply to message #115756] Thu, 05 February 2004 18:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: phil.williams.toadmail.com

This is a multi-part message in MIME format.
--------------060600020904020402030606
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

One approach that I can think of is to do something similar to how
connections are added in the Logic Example. Take a look at the
LogicNodeEditPolicy.

When you mouse over and click on a source getConnectionCreateCommand is
called. Notice that the command (which is incomplete) is added to the
request. When the user clicks on the target node, the command is
retrieved off of the request and the missing parts (the target) are
added. After the command is returned the exec method is called.

So what I think you would have is a single command class to which each
page of the wizard adds pieces. Then at the end of the wizard the exec
method on the command is called and it is added to the command stack. I
guess that the main wizard will most likely have a handle to the command
and the appropriate getters and setters.

HTH,
Phil


David Michonneau wrote:

>There is no doubt at the end one single command will be added to the command
>stack, the whole problem is the creation of that compoudcommand. For
>example:
>
>Command1 -> Model1
>if (Model1.condition)
> Command2
>else
> Command3
>
>If I don't execute Command1, I have to mentally compute its result to write
>the proper condition. So it;s much more productive to execute commands one
>by one. With a large number of commands it can become a real headache. If my
>understanding is correct EMF has solved this with
>CompoundCommand.appendAndExecute( see my previous post). Now I'm more
>interested on how to mix UI actions in between commands.
>
>David
>"CL [dnoyeb] Gilbert" <Lamont_Gilbert@rigidsoftware.com> wrote in message
>news:bvs0fo$vcj$1@eclipse.org...
>
>
>>-----BEGIN PGP SIGNED MESSAGE-----
>>Hash: SHA1
>>
>>David Michonneau wrote:
>>| I have a question regarding commands and UI changes.
>>|
>>| I'm going to take an example, rather than staying on an abstract level:
>>|
>>| Let's say that when I add an element to a graphical editor, a small
>>
>>
>popup
>
>
>>| wizard appears. In each step of the wizardI configure the new object to
>>
>>
>be
>
>
>>| added to the graph. When the wizard is completed the object is created
>>
>>
>to
>
>
>>| the diagram, and this is a single undoable operation.
>>|
>>| Now from an implementation point of view, each step in the wizard will
>>
>>
>be
>
>
>>| mapped to a command. Since each step is dependent from the previous one,
>>
>>
>I
>
>
>>| want to be able to execute each command on the model, as the user goes
>>| through each step, so that I know what UI to show in the next step, by
>>| inspecting the model.
>>|
>>| How do I do such thing? When I execute a command it goes on the
>>| commandstack. Note that between each commands I've got some different
>>UI to
>>| show, but in the end I want only one big command in the commandstack
>>
>>
>(that
>
>
>>| does not capture the UI, since it's not model related).
>>|
>>| Thanks,
>>|
>>| David
>>|
>>|
>>
>>I was not able to affect multi-step commands. I redid my thinking and
>>baked it all into 1 single command. Perhaps you need to open a
>>"simulation" window to allow these intermediate steps, and once
>>confirmed, execute the full command. But that too would be composed of
>>steps...
>>
>>I know you pain. The problem is that the results of one command are not
>>seen by another so to speak.
>>
>>Like I said, I ended up conflating it into a single command.
>>
>>
>>- --
>>Respectfully,
>>
>>
>>CL Gilbert
>>
>>"Verily, verily, I say unto you, He that entereth not by the door() into
>>the sheepfold{}, but climbeth up some other *way, the same is a thief
>>and a robber." John 10:1
>>
>>GnuPG Key Fingerprint:
>>82A6 8893 C2A1 F64E A9AD 19AE 55B2 4CD7 80D2 0A2D
>>
>>For a free Java interface to Freechess.org see
>>http://www.rigidsoftware.com/Chess/chess.html
>>-----BEGIN PGP SIGNATURE-----
>>Version: GnuPG v1.2.4 (GNU/Linux)
>>Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>>
>> iD8DBQFAIYXJVbJM14DSCi0RAlkIAJ9h5VxHatkHBNgtlB/58nlJJbpp5ACe JpK2
>>G8LowG5vT+RwCA5IoMPh+mg=
>>=4fP2
>>-----END PGP SIGNATURE-----
>>
>>
>>
>
>
>
>

--------------060600020904020402030606
Content-Type: text/html; charset=us-ascii
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">
<title></title>
</head>
<body>
One approach that I can think of is to do something similar to how
connections are added in the Logic Example.&nbsp; Take a look at the
LogicNodeEditPolicy.<br>
<br>
When you mouse over and click on a source getConnectionCreateCommand is
called.&nbsp; Notice that the command (which is incomplete) is added to the
request.&nbsp; When the user clicks on the target node, the command is
retrieved off of the request and the missing parts (the target) are
added.&nbsp; After the command is returned the exec method is called.<br>
<br>
So what I think you would have is a single command class to which each
page of the wizard adds pieces.&nbsp; Then at the end of the wizard the exec
method on the command is called and it is added to the command stack.&nbsp;
I guess that the main wizard will most likely have a handle to the
command and the appropriate getters and setters.<br>
<br>
HTH,<br>
Phil<br>
<br>
<br>
David Michonneau wrote:<br>
<blockquote cite="midbvs10q$vsl$1@eclipse.org" type="cite">
<pre wrap="">There is no doubt at the end one single command will be added to the command
stack, the whole problem is the creation of that compoudcommand. For
example:

Command1 -&gt; Model1
if (Model1.condition)
Command2
else
Command3

If I don't execute Command1, I have to mentally compute its result to write
the proper condition. So it;s much more productive to execute commands one
by one. With a large number of commands it can become a real headache. If my
understanding is correct EMF has solved this with
CompoundCommand.appendAndExecute( see my previous post). Now I'm more
interested on how to mix UI actions in between commands.

David
"CL [dnoyeb] Gilbert" <a class="moz-txt-link-rfc2396E" href="mailto:Lamont_Gilbert@rigidsoftware.com">&lt;Lamont_Gilbert@rigidsoftware.com&gt;</a> wrote in message
<a class="moz-txt-link-freetext" href="news:bvs0fo$vcj$1@eclipse.org">news:bvs0fo$vcj$1@eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David Michonneau wrote:
| I have a question regarding commands and UI changes.
|
| I'm going to take an example, rather than staying on an abstract level:
|
| Let's say that when I add an element to a graphical editor, a small
</pre>
</blockquote>
<pre wrap=""><!---->popup
</pre>
<blockquote type="cite">
<pre wrap="">| wizard appears. In each step of the wizardI configure the new object to
</pre>
</blockquote>
<pre wrap=""><!---->be
</pre>
<blockquote type="cite">
<pre wrap="">| added to the graph. When the wizard is completed the object is created
</pre>
</blockquote>
<pre wrap=""><!---->to
</pre>
<blockquote type="cite">
<pre wrap="">| the diagram, and this is a single undoable operation.
|
| Now from an implementation point of view, each step in the wizard will
</pre>
</blockquote>
<pre wrap=""><!---->be
</pre>
<blockquote type="cite">
<pre wrap="">| mapped to a command. Since each step is dependent from the previous one,
</pre>
</blockquote>
<pre wrap=""><!---->I
</pre>
<blockquote type="cite">
<pre wrap="">| want to be able to execute each command on the model, as the user goes
| through each step, so that I know what UI to show in the next step, by
| inspecting the model.
|
| How do I do such thing? When I execute a command it goes on the
| commandstack. Note that between each commands I've got some different
UI to
| show, but in the end I want only one big command in the commandstack
</pre>
</blockquote>
<pre wrap=""><!---->(that
</pre>
<blockquote type="cite">
<pre wrap="">| does not capture the UI, since it's not model related).
|
| Thanks,
|
| David
|
|

I was not able to affect multi-step commands. I redid my thinking and
baked it all into 1 single command. Perhaps you need to open a
"simulation" window to allow these intermediate steps, and once
confirmed, execute the full command. But that too would be composed of
steps...

I know you pain. The problem is that the results of one command are not
seen by another so to speak.

Like I said, I ended up conflating it into a single command.


- --
Respectfully,


CL Gilbert

"Verily, verily, I say unto you, He that entereth not by the door() into
the sheepfold{}, but climbeth up some other *way, the same is a thief
and a robber." John 10:1

GnuPG Key Fingerprint:
82A6 8893 C2A1 F64E A9AD 19AE 55B2 4CD7 80D2 0A2D

For a free Java interface to Freechess.org see
<a class="moz-txt-link-freetext" href="http://www.rigidsoftware.com/Chess/chess.html">http://www.rigidsoftware.com/Chess/chess.html</a>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - <a class="moz-txt-link-freetext" href="http://enigmail.mozdev.org">http://enigmail.mozdev.org</a>

iD8DBQFAIYXJVbJM14DSCi0RAlkIAJ9h5VxHatkHBNgtlB/58nlJJbpp5ACe JpK2
G8LowG5vT+RwCA5IoMPh+mg=
=4fP2
-----END PGP SIGNATURE-----

</pre>
</blockquote>
<pre wrap=""><!---->

</pre>
</blockquote>
</body>
</html>

--------------060600020904020402030606--
Re: wizard [message #117098 is a reply to message #115717] Wed, 11 February 2004 20:14 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

I'm not sure why you are reusing the command classes in this way. Other
teams I know have created the notion of an Operation, and some sort of model
behind an operation which the dialog knows how to populate. At the end when
Finish is pressed, the operation constructs a single command.

But, if you really want to reuse the command pattern, you could comment out
execute() to do nothing, and perform the execution as you go calling your
own myExecute() API. Then, wrap it all up in a compound command and slap it
on the command stack, at which point it will be executed but that will be a
no-op at this point. Only undo() and redo() would be functional.

"David Michonneau" <david_michonneau@hotmail.com> wrote in message
news:bvruf9$tfc$1@eclipse.org...
> I have a question regarding commands and UI changes.
>
> I'm going to take an example, rather than staying on an abstract level:
>
> Let's say that when I add an element to a graphical editor, a small popup
> wizard appears. In each step of the wizardI configure the new object to be
> added to the graph. When the wizard is completed the object is created to
> the diagram, and this is a single undoable operation.
>
> Now from an implementation point of view, each step in the wizard will be
> mapped to a command. Since each step is dependent from the previous one, I
> want to be able to execute each command on the model, as the user goes
> through each step, so that I know what UI to show in the next step, by
> inspecting the model.
>
> How do I do such thing? When I execute a command it goes on the
> commandstack. Note that between each commands I've got some different UI
to
> show, but in the end I want only one big command in the commandstack (that
> does not capture the UI, since it's not model related).
>
> Thanks,
>
> David
>
>
Previous Topic:creating connections
Next Topic:I20040205 + M6 -> 100% cpu usage on gtk
Goto Forum:
  


Current Time: Sat Sep 07 11:11:49 GMT 2024

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

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

Back to the top