delete an editPart [message #139679] |
Wed, 23 June 2004 14:56 |
Eclipse User |
|
|
|
Originally posted by: jerome.lafon.bull.net
Hi,
is somebody knows how to delete an editpart in a graphicalViewer?
I have write:
viewer.setKeyHandler(new GraphicalViewerKeyHandler(viewer)
.setParent(getCommonKeyHandler()));
protected KeyHandler getCommonKeyHandler() {
if (sharedKeyHandler == null) {
sharedKeyHandler = new KeyHandler();
sharedKeyHandler.put(
KeyStroke.getPressed(SWT.DEL, 127, 0),
getActionRegistry().getAction(GEFActionConstants.DELETE));
}
return sharedKeyHandler;
}
but it doesn't work!
thanks
|
|
|
|
Re: delete an editPart [message #139896 is a reply to message #139679] |
Thu, 24 June 2004 19:46 |
Eclipse User |
|
|
|
Originally posted by: rlemaigr.ulb.ac.be
Hello,
The result of the execution of the GEFActionConstants.DELETE action is =
only to send a req_delete to the selected EditParts, nothing more.
So to get it working, you have to install on the EditParts EditPolicies =
=
able to understand the req_delete requests and to return delete Commands=
=
which will delete the model objects of the selected EditParts. And if th=
e =
parent EditParts of the "almost deleted EditParts" listen correctly to =
their model, they will catch the event signaling the deletion, and they =
=
will call refreshChildren on themselves and the EditParts and their =
figures will be deleted.
If you already knew that and if you find my answer to be obvious, then I=
=
am sorry.
I hope it will help you !
r=E9gis
On Wed, 23 Jun 2004 16:56:09 +0200, jerome lafon <jerome.lafon@bull.net>=
=
wrote:
> Hi,
> is somebody knows how to delete an editpart in a graphicalViewer?
> I have write:
>
> viewer.setKeyHandler(new GraphicalViewerKeyHandler(viewer)
> .setParent(getCommonKeyHandler()));
>
> protected KeyHandler getCommonKeyHandler() {
> if (sharedKeyHandler =3D=3D null) {
> sharedKeyHandler =3D new KeyHandler();
> sharedKeyHandler.put(
> KeyStroke.getPressed(SWT.DEL, 127, 0),
> getActionRegistry().getAction(GEFActionConstants.DELETE));
> }
> return sharedKeyHandler;
> }
>
> but it doesn't work!
> thanks
>
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
|
|
|
Powered by
FUDForum. Page generated in 0.04146 seconds