Project: Eclipse_Platform_UI
Bug 47600 [EditorMgmt] EditorDescriptor.setInternal is gone in M5
Reported: 2003-11-26 19:28:21 | Status: resolved fixed

For editors that have long startup times or consume a lot of resources it is necessary to use a singleton, i.e. one editor instance is always reused for a file type whether it be opened by double-clicking the file, or opened programatically or from the navigation history (A 3D editor might want this, for example). Up to and including Eclipse 3.0 M4 it was possible to achieve this using the following workaround: - define an external editor launcher in whose open() method we do the following: if the editor is already open { editor.markInNavigationHistory editor.setInput(newInput) } else { EditorDescriptor desc = ...; desc.setInternal( true ) workbenchpage.openEditor(newInput) // set the editor as external so this launcher will be used again desc.setInternal( false ) } From M5, the required method calls have changed slightly and look as though they would be: desc.setOpenMode( EditorDescriptor.OPEN_INTERNAL/EXTERNAL ); Unfortunately, this method now has package visibility and can't be used. In the medium to long term it would be nice to have a proper solution to this requirement by adding something like "reuse=true" into the editor's extension point in the plugin.xml. But in the very short term (in time for M6 or before would be good!) could we revert setOpenMode() back to public visibility? For a discussion on some of the other things that were tried (and failed) for solving this problem see the "Eclipse reuse broken in M5" thread in the platform newsgroup. Thanks, Henrietta

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/EditorDescriptor.java