Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Cannot delete an object???
Cannot delete an object??? [message #221353] Fri, 11 August 2006 19:39 Go to next message
Eclipse UserFriend
Originally posted by: guerreroderrick.gmail.com

The delete key has no effect in my project.

I have been creating a graph editor using the ShapesEditor as an
example. However, I do not seem to be able to delete any nodes. In my
GraphNodeEditPart class I have installed a new NodeComponentEditPolicy,
in which I create a new GraphNodeDeleteCommand. Stepping through the
project in debug, I have noticed that when I select a node, the
GraphNodeDeleteCommand is created with the correct graph and graphNode
variables. It also calls my canExecute() method which returns true when
the graph and graphNode variables are not null (they are not null when I
step through with debug). But hitting the delete key does absolutely
nothing. (Neither execute() nor redo() is called).

I assumed I was missing something in the key handler, but I use
GraphicalViewerKeyHandler(viewer) exactly like the ShapesEditor example.
And I cannot find any other differences involving delete.

Am I missing some fundamental step in deleting an object? Or do I need
to do anything to configure the GraphicalViewerKeyHandler.

Any help would be greatly appreciated.
Thanks in advance,
Guerrero
Re: Cannot delete an object??? [message #221387 is a reply to message #221353] Fri, 11 August 2006 20:49 Go to previous message
Eclipse UserFriend
Originally posted by: guerreroderrick.gmail.com

I figured it out. Apparently I needed to also create an
ActionBarContributor and include it in the contributorClass extension
for the editor. I also needed to override the protected method
buildActions(), and add the line

addRetargetAction(new DeleteRetargetAction());

Since the class extending ActionBarContributor wasn't mentioned anywhere
in code, only in the plugin extension, this took forever to find.

Guerrero.

Derrick Guerrero wrote:
> The delete key has no effect in my project.
>
> I have been creating a graph editor using the ShapesEditor as an
> example. However, I do not seem to be able to delete any nodes. In my
> GraphNodeEditPart class I have installed a new NodeComponentEditPolicy,
> in which I create a new GraphNodeDeleteCommand. Stepping through the
> project in debug, I have noticed that when I select a node, the
> GraphNodeDeleteCommand is created with the correct graph and graphNode
> variables. It also calls my canExecute() method which returns true when
> the graph and graphNode variables are not null (they are not null when I
> step through with debug). But hitting the delete key does absolutely
> nothing. (Neither execute() nor redo() is called).
>
> I assumed I was missing something in the key handler, but I use
> GraphicalViewerKeyHandler(viewer) exactly like the ShapesEditor example.
> And I cannot find any other differences involving delete.
>
> Am I missing some fundamental step in deleting an object? Or do I need
> to do anything to configure the GraphicalViewerKeyHandler.
>
> Any help would be greatly appreciated.
> Thanks in advance,
> Guerrero
Previous Topic:UndoablePropertySheetPage and Wrapped/Unwrapped Property Values (EMF.Edit)
Next Topic:no 3.3 integration builds?
Goto Forum:
  


Current Time: Fri Apr 26 23:15:05 GMT 2024

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

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

Back to the top