Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to delete an editpart from the diagram
How to delete an editpart from the diagram [message #170315] Thu, 03 March 2005 15:51 Go to next message
Eclipse UserFriend
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 #170346 is a reply to message #170315] Thu, 03 March 2005 22:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: binti.ksu.edu

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
>
>
Re: How to delete an editpart from the diagram [message #170362 is a reply to message #170346] Thu, 03 March 2005 22:38 Go to previous message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
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
> >
> >
>
>
Previous Topic:org.eclipse.ui.PlatformUI
Next Topic:Frame on editor problem
Goto Forum:
  


Current Time: Fri Apr 26 00:27:37 GMT 2024

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

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

Back to the top