To reproduce you will need to define an editor part in an e4 fragment.
It should be marked as closable and given the 'Editor' tag.
Run the code and launch the editor
The Close menu option is available as a right click popup on the editor tab and it works.
However the File->Close Editor menu option is disabled.
From debuging I can see that the handler code (CloseEditorHandler) doesn't consider e4 editors.
It expects IEditorPart and checks that ISources.ACTIVE_EDITOR_NAME is set on the evaluation context.
E4 editors dont use IEditorPart or set ISources.ACTIVE_EDITOR_NAME.
From a quick prototype it seems to work for all editors (e4 and legacy) if the menu handlers are defined using an e4 fragment.
e.g. This seems to work for both E4 and legacy editors.
Steps to reproduce
To reproduce you will need to define an editor part in an e4 fragment. It should be marked as closable and given the 'Editor' tag. Run the code and launch the editor The Close menu option is available as a right click popup on the editor tab and it works.
However the File->Close Editor menu option is disabled.
From debuging I can see that the handler code (CloseEditorHandler) doesn't consider e4 editors. It expects IEditorPart and checks that ISources.ACTIVE_EDITOR_NAME is set on the evaluation context. E4 editors dont use IEditorPart or set ISources.ACTIVE_EDITOR_NAME.
From a quick prototype it seems to work for all editors (e4 and legacy) if the menu handlers are defined using an e4 fragment.
e.g. This seems to work for both E4 and legacy editors.
public class CloseActiveEditorHandlerE4 { @CanExecute boolean canExecute(@Named(IServiceConstants.ACTIVE_PART) MPart part) { boolean isEditor = part.getTags().stream().filter(t -> t.equals(Workbench.EDITOR_TAG)).count() > 0; return isEditor && part.isCloseable();
}
}
The same issue exists with File->'Close All Editors'.