avier5 wrote:I have a view with a simple text field. I want that each action(write, delete etc.) in this text field will trigger the workbench actions in the main menu(actions like undo , redo and so on).
In other words how I can use the workbench actions (that I create from the ActionFactory) in my views and widgets
How can I achieve such ability?
You need to hook various Eclipse global actions. Assuming that you have your own delete action named "deleteAction", you would hook it to the Eclipse
Edit > Delete command like this...
- Code: Select all
private void hookGlobalActions() {
getViewSite().getActionBars().setGlobalActionHandler(
IWorkbenchActionConstants.DELETE,
deleteAction);
}
BTW, Eclipse plugin development questions like this are better directed to the Eclipse Platform (or RCP) newsgroup.
This is also discussed on pp314-315 of
our book.