Compound command to add a sub diagram [message #230170] |
Wed, 13 May 2009 20:32 |
ps Messages: 16 Registered: July 2009 |
Junior Member |
|
|
Hi there,
I have a diagram which contains some nodes, by double-click one of the
node, it'll open up a sub diagram by firing off Command got through
OpenDiagramEditPolicy. The logic in OpenDiagramEditPolicy basically works
like this, if the diagram resource doesn't exist, create one and append
that to current resource's contents. Now comes my question, I want the sub
diagram resource gets created once the node(its model and its view) gets
created, I want that to be in a single command(or compound command), is
this feasible? I ask because the current redo/undo is a bit weird, when I
first drops a node on the canvas, and then double click on it, it opens up
the new diagram editor, and then I close the subdiagram editor, and have
to click undo twice(first remove the diagram resource and then remove the
node and its view) to get rid of the newly created node, ideally I should
just need to click once. Also I need to programmatically create the node
and its diagram resource, and I don't want to create that in 2 steps, but
I don't know how to make this compound command since the
create-diagram-resource subcommand depends on the newly created node's
editpart which is a prior command.
Thanks in advance!
Paul
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03428 seconds