Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » RE: delete an editPart
RE: delete an editPart [message #140383] Mon, 28 June 2004 11:18 Go to next message
Eclipse UserFriend
Originally posted by: jerome.lafon.bull.net

Hi,
do you know where i can find a tutorial or simple example on how to use
keyhandlers because i don't understand at all why it doesn't work.
however I have followed the logic example.

thanks
Jerome

jerome lafon wrote:

> Hi,
> I want to know if Somedody can explain me how to catch a keyboard
> event, like del key pressed and assign a method to his event ?
> Actually I have:
>
> a GraphicalEditorWithPalette, with a KeyHandler, a method with
> sharedKeyHandler.put( KeyStroke.getPressed(SWT.DEL, 127, 0),
> getActionRegistry().getAction(ActionFactory.DELETE.getId())) ;
>
> and a method createActions((IWorkbenchPart)this) {
> action = new DeleteAction((IWorkbenchPart)this);
> registry.registerAction(action);
> getSelectionActions().add(action.getId());
> }
>
> The topEditPart with a LAYOUT_ROLE and a CONTAINER_ROLE
>
> I have an editpart with a COMPONENT_ROLE edit policy, this policy
> implements createDeleteCommand(GroupRequest deleteRequest).
>
> With this state, I can't delete an editpart.
> I am not sure to understand how it should work. When I register the
> DeleteAction in the ActionRegistry, GEF automatically call
> createDeleteCommand() ?
>
> Thanks
> Jerome Lafon
Re: delete an editPart [message #140463 is a reply to message #140383] Mon, 28 June 2004 17:01 Go to previous message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
Did you step through the code? And did you try the other approach of
overriding keyPressed(KeyEvent)?

"jerome lafon" <jerome.lafon@bull.net> wrote in message
news:40DFFE78.CE32B90B@bull.net...
> Hi,
> do you know where i can find a tutorial or simple example on how to use
> keyhandlers because i don't understand at all why it doesn't work.
> however I have followed the logic example.
>
> thanks
> Jerome
>
> jerome lafon wrote:
>
> > Hi,
> > I want to know if Somedody can explain me how to catch a keyboard
> > event, like del key pressed and assign a method to his event ?
> > Actually I have:
> >
> > a GraphicalEditorWithPalette, with a KeyHandler, a method with
> > sharedKeyHandler.put( KeyStroke.getPressed(SWT.DEL, 127, 0),
> > getActionRegistry().getAction(ActionFactory.DELETE.getId())) ;
> >
> > and a method createActions((IWorkbenchPart)this) {
> > action = new DeleteAction((IWorkbenchPart)this);
> > registry.registerAction(action);
> > getSelectionActions().add(action.getId());
> > }
> >
> > The topEditPart with a LAYOUT_ROLE and a CONTAINER_ROLE
> >
> > I have an editpart with a COMPONENT_ROLE edit policy, this policy
> > implements createDeleteCommand(GroupRequest deleteRequest).
> >
> > With this state, I can't delete an editpart.
> > I am not sure to understand how it should work. When I register the
> > DeleteAction in the ActionRegistry, GEF automatically call
> > createDeleteCommand() ?
> >
> > Thanks
> > Jerome Lafon
>
>
>
Previous Topic:org.eclipse.swt.widgets.Text equivalent in draw2d
Next Topic:Snap in the logic and flow examples
Goto Forum:
  


Current Time: Fri Apr 26 11:34:21 GMT 2024

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

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

Back to the top