Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Double-click on editpart - need to invoke editor command
Double-click on editpart - need to invoke editor command [message #180888] Wed, 11 May 2005 11:21 Go to next message
Eclipse UserFriend
Originally posted by: balimis.SPAM.poczta.onet.pl

Hello,

I react to the double-click event on editpart with code:

public void performRequest(Request req) {
if (req.getType().equals(RequestConstants.REQ_OPEN)){
System.out.println("double-click");
}
super.performRequest(req);
}

The problem is, that gef code is in "edit" package, but editor classes
are stored in "editor" package - implementation based on ibm's redbook.

Double-click event should open properties dialog, but in editpart there
is no entrypoint to lookup editor, i have no idea how to request execute
command by editor.

How should i implement such functionality?

best regards,
Bali
Re: Double-click on editpart - need to invoke editor command [message #180912 is a reply to message #180888] Wed, 11 May 2005 14:27 Go to previous message
Sapna George is currently offline Sapna GeorgeFriend
Messages: 76
Registered: July 2009
Member
I'm not exactly sure what you want to do, but if all you wanted was to
invoke an editor action/command from within your editpart, you could do
this:

IEditorPart editor =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().getActiveEditor();

ActionRegistry actionRegistry =
(ActionRegistry)editor.getAdapter(ActionRegistry.class);

IAction action = actionRegistry.getAction(<your action id>));

if (action != null && action.isEnabled()) {

action.run();

}

hope this helps,

Sapna
Previous Topic:Sticking buttons inside a node figure - moving from figure to command
Next Topic:Regressive bug in draw2d.text
Goto Forum:
  


Current Time: Mon Jan 30 12:49:44 GMT 2023

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

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

Back to the top