How to delete an editpart from the diagram [message #170315] |
Thu, 03 March 2005 10:51  |
Eclipse User |
|
|
|
Originally posted by: jsk_lam.hotmail.com
Hi,
Can someone show me how to delete/remove a node editpart from the
diagram manually/programmatically? I try the following:
Diagram diagram; // Diagram is AbstractGraphicalEditPart-derived class
Node node; // Node is AbstractGraphicalEditPart-derived class
// Error: removedChild(0 is not visible, it is a protected
// method in AbstractGraphicalEditPart.
diagram.removeChild(node);
Thanks
slam
|
|
|
|
Re: How to delete an editpart from the diagram [message #170362 is a reply to message #170346] |
Thu, 03 March 2005 17:38  |
Eclipse User |
|
|
|
More importantly, you delete the model, not the editpart. When your model
changes, the corresponding editpart will be automatically removed from the
diagram.
"Binti Sepaha" <binti@ksu.edu> wrote in message
news:d082qc$o4v$1@www.eclipse.org...
> Slam,
>
> You will need to create an edit policy for this node, that extends
component
> policy. and implements createDeleteCommand(GroupRequest request). In this
> method you will need to instatiate a command that deletes the node. If
you
> need more help let me know.
>
> This should be available in logic example and schema diagram editor
example.
>
> Binti.
>
>
> "slam" <jsk_lam@hotmail.com> wrote in message
> news:d07bqp$a0$1@www.eclipse.org...
> > Hi,
> >
> > Can someone show me how to delete/remove a node editpart from the
> > diagram manually/programmatically? I try the following:
> >
> > Diagram diagram; // Diagram is AbstractGraphicalEditPart-derived
class
> > Node node; // Node is AbstractGraphicalEditPart-derived class
> >
> > // Error: removedChild(0 is not visible, it is a protected
> > // method in AbstractGraphicalEditPart.
> > diagram.removeChild(node);
> >
> > Thanks
> > slam
> >
> >
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.45083 seconds