I am working on a multi-page editor that loads several separate files (e.g. java, html) into separate tabs of a multi-page editor. Files are opened by default by editors associated with the file type, and these editors are, by default, embedded in the multi-page editor as tabs.
This is how I determine which editor to load (for file type):
void createPage() throws PartInitException
{
IEditorRegistry editorRegistry = Activator.getDefault().getWorkbench().getEditorRegistry();
IEditorDescriptor editorDescriptor = editorRegistry.getDefaultEditor(((IFileEditorInput)getEditorInput()).getFile().getName());
if (editorDescriptor == null)
{
IEditorRegistry registry = Activator.getDefault().getWorkbench().getEditorRegistry();
editorDescriptor = registry.findEditor(EditorsUI.DEFAULT_TEXT_EDITOR_ID);
}
IConfigurationElement configuration = ((EditorDescriptor) editorDescriptor).getConfigurationElement();
String className = configuration.getAttribute("class");
IEditorPart editor;
try
{
editor = (IEditorPart) WorkbenchPlugin.createExtension(configuration, "class");
} catch (CoreException e) {
throw new RuntimeException(e);
}
final int index = addPage(editor, getEditorInput());
setPageText(index, "TAB_NAME");
}
The multi-page tab editor is created without any problems and the correct editors are loaded inside the tabs.
But the "Mark Occurrences" function does not work in the Java editor when loading on a tab.
, . java , .
java java, java, java, .
, , , , , .
, java, ?
, Mark Occurences , , , , - . , , ?
. , java .