|
|
Re: Invoking a Direct Edit Action [message #649874 is a reply to message #648978] |
Thu, 20 January 2011 19:56 |
|
Hi Andy ,
Try using the below code in your graphical editor
protected void configureGraphicalViewer() {
super.configureGraphicalViewer();
GraphicalViewer viewer = getGraphicalViewer();
viewer.setKeyHandler(new GraphicalViewerKeyHandler(viewer) {
@Override
public boolean keyPressed(KeyEvent event) {
EditPart editPart = (EditPart) ((IStructuredSelection) getGraphicalViewer().getSelection()).getFirstElement();
// Open the CPS if enter is pressed
if (event.keyCode == SWT.KEYPAD_CR || event.character == '\r') {
editPart.performRequest(new Request(RequestConstants.REQ_DIRECT_EDIT));
}
return super.keyPressed(event);
}
});
}
Regards,
Prasad
http://marketplace.eclipse.org/user/9964/listings
|
|
|
|
Powered by
FUDForum. Page generated in 0.04224 seconds