Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » F2 key not working!!!
F2 key not working!!! [message #186051] Fri, 01 July 2005 08:53 Go to next message
Eclipse UserFriend
Originally posted by: gautamn.iitk.ac.in

I enabled my keyboard for editing GEF figures using following code:
/*********************************************************** ****************/
protected KeyHandler getCommonKeyHandler(){

KeyHandler sharedKeyHandler = new KeyHandler();
sharedKeyHandler.put(KeyStroke.getPressed(SWT.DEL, 127, 0),
getActionRegistry().getAction(
GEFActionConstants.DELETE));
sharedKeyHandler.put(KeyStroke.getPressed(SWT.F2, 0),
getActionRegistry().getAction(
GEFActionConstants.DIRECT_EDIT));

return sharedKeyHandler;
}
/*********************************************************** ****************/

the delete key is working fine but F2 is working for direct editing....Can
anyone suggest something.
Regards,
Nitin.
Re: F2 key not working!!! [message #186065 is a reply to message #186051] Fri, 01 July 2005 09:14 Go to previous messageGo to next message
Andreas Holtz is currently offline Andreas HoltzFriend
Messages: 53
Registered: July 2009
Member
Nitin Gautam schrieb am 01.07.2005 10:53:
>
> editing....Can anyone suggest something.

Overwrite the createActions() in your Editorclass like this:

protected void createActions() {
super.createActions();
ActionRegistry registry = getActionRegistry();
IAction action;

action = new DirectEditAction((IWorkbenchPart) this);
registry.registerAction(action);
getSelectionActions().add(action.getId());

//add more actions here

}

A little hint: If you use examples, scroll down to the end of a class ;-)
Re: F2 key not working!!! [message #186144 is a reply to message #186065] Sat, 02 July 2005 05:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gautamn.iitk.ac.in

i have already put that in the code..but still it is not working...can you
suggest something different.
regards,
Nitin.
Re: F2 key not working!!! [message #186152 is a reply to message #186144] Sat, 02 July 2005 11:29 Go to previous message
Andreas Holtz is currently offline Andreas HoltzFriend
Messages: 53
Registered: July 2009
Member
Nitin Gautam schrieb am 02.07.2005 07:12:
> i have already put that in the code..but still it is not working...can
> you suggest something different.
> regards,
> Nitin.
>
Did you create and installed a DirectEditPolicy on the targeted Editpart?
Did you overwrote the performRequest()-Method of the targeted Editpart
and respond to a DirectEdit-Request?
Did you implement a DirectEditManger?
Did you implement a DirectEditCellLocator?
Did you impement a DirectEdit-Command and return it for the
DirectEdit-Request?

You see, you have a lot of stuff to do, to make an EditPart
directeditable (and I'm quite sure, that I forgot a step ;-) ).

Search for a post in this newsgroup. The title is "old thread: direct
edit tutorial/examples? (Andreas Holtz recommends good incremental GEF
tutorial)".

There you will find a small example where you can see, how DirectEdit is
implemented (without the functionality of a bigger example).

I hope this time I could help more :-)

Andreas
Previous Topic:AbstractEditPart>>refreshChildren bug?
Next Topic:how to get all the selected editparts
Goto Forum:
  


Current Time: Thu Dec 26 11:11:16 GMT 2024

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

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

Back to the top