Summary: | MultiPageEditorPart is hard to close programmatically | ||
---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Ed Willink <ed> |
Component: | UI | Assignee: | Platform-UI-Inbox <Platform-UI-Inbox> |
Status: | NEW --- | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | rolf.theunissen |
Version: | 4.19 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows 10 | ||
Whiteboard: |
Description
Ed Willink
2021-04-11 04:05:20 EDT
The close method is an internal method that is used to close the MultiPageEditorPart in case the ServiceLocator (ISL) of the multipage editor is disposed. This to be compatible with 3.x behavior. The comment is there for platform developers to understand why this code is there. The close method is by no means public API, it should never be called by client code (package private should be a clear hint). We could argue that the method name is not the clearest, but it isn't API anyhow. The API offered to close any editor has always been IWorkbenchPage#closeEditor, see https://help.eclipse.org/2021-03/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fui%2FIWorkbenchPage.html&anchor=closeEditor(org.eclipse.ui.IEditorPart,boolean) I am not sure what problem you have with the current implementation? (In reply to Rolf Theunissen from comment #1) > The API offered to close any editor has always been > IWorkbenchPage#closeEditor Except that it is also ITextEditor.close() If you have an editor and want to close it, you expect to invoke a method on it, not go round the houses to find suitable conspirators. If the framework needs to go round the houses, then a close() implementation can do that for the user. so as per the report a close() implementation should do the obvious job. else as per the report the close() method should be helpfully documented. |