Eclipse RCP - active dialog from command handler

129 views Asked by At

I've registered a key binding in the org.eclipse.ui.contexts.dialogAndWindow context.
I've then associated a command handler

public class QuickActionsHandler extends AbstractHandler {
  @Override
  public Object execute(final ExecutionEvent event) throws ExecutionException {
     ...

Now, how do I get the active Dialog view part from the ExecutionEvent?

1

There are 1 answers

0
greg-449 On BEST ANSWER

Dialogs are not view parts - they are generally just windows extending org.eclipse.jface.dialogs.Dialog

Probably the best you can do is get the currently active Shell:

Shell shell = HandlerUtil.getActiveShell(event);