Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-ui-dev] Copy, Paste and Cut operations can not be executed in a focused PopupDialog

Hello everyone,

I have a handlers that get notified on copy, paste and cut operations. While that works fine, I want to forward the operation to the default ones (org.eclipse.ui.edit.{copy,paste,cut}). This works only fine inside of the handlers. But when I create a PopupDialog, which is focused on open, then later inside of this PopupDialog when I try to execute the forward operation, it fails with

org.eclipse.core.commands.NotEnabledException: Trying to execute the disabled command org.eclipse.ui.edit.paste

Could someone please explain how I can enable the commands for the context of the PopupDialog?

The forwarding operation works like this (if that is relevant):

IHandlerService service = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class);
service.executeCommand(command, null);


Back to the top