private static class WrappedEditorAction extends EditorAction implements DelegatesToAction {
private final EditorAction originalAction;
protected WrappedEditorAction(final Listener listener, final EditorAction originalAction) {
super(new EditorActionHandler() {
@Override protected void doExecute(Editor editor, Caret caret, DataContext dataContext) {
listener.beforeAction();
originalAction.getHandler().execute(editor, caret, dataContext);
}