Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 311467

Summary: Nested Editors
Product: [Eclipse Project] e4 Reporter: Dan Rubel <danrubel>
Component: UIAssignee: Project Inbox <e4.ui-inbox>
Status: RESOLVED FIXED QA Contact: Eric Moffatt <emoffatt>
Severity: normal    
Priority: P3 CC: Konstantin.Scheglov, remy.suen
Version: 1.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Dan Rubel CLA 2010-05-03 22:24:57 EDT
In all 2.x and 3.x versions of Eclipse, the SWT Designer team has been successfully subclassing org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor. Obviously, this is internal code we are dabbling with, and we understand there are no commitments to backward compatibility, but this was the only way that we could, at the time, provide a tabbed editor with one tab that provides a rich java editing experience without having to reinvent/copy the existing JDT java editor. When SWT Designer is run in e4, I get the following exception (see below). What is the recommended way for us to embed one editor in a tab of another editor? Is this "composing" or "grouping" of editors something we want to support in e4, where each secondary tab provides a different view of the same underlying resource? It would be nice that if I open a different editor type on the same underlying resource, they all appear under the same primary tab but have different secondary tabs so that I visually "know" that I'm editing the same underlying resource. If we had that type of visual editor grouping, then SWT Designer would not need to subclass the existing JDT compilation unit editor any longer.

java.lang.NullPointerException
	at org.eclipse.ui.internal.EditorSiteDragAndDropServiceImpl.addMergedDropTarget(EditorSiteDragAndDropServiceImpl.java:165)
	at org.eclipse.ui.texteditor.AbstractTextEditor.installTextDragAndDrop(AbstractTextEditor.java:3580)
	at org.eclipse.ui.texteditor.AbstractTextEditor.initializeDragAndDrop(AbstractTextEditor.java:3178)
	at org.eclipse.ui.texteditor.AbstractTextEditor.createPartControl(AbstractTextEditor.java:3265)
	at org.eclipse.ui.texteditor.StatusTextEditor.createPartControl(StatusTextEditor.java:53)
	at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.createPartControl(AbstractDecoratedTextEditor.java:432)
	at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.createPartControl(JavaEditor.java:3104)
	at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.createPartControl(CompilationUnitEditor.java:1475)
	at com.instantiations.designer.core.editor.multi.MultiPageEditor.super_createPartControl(MultiPageEditor.java:137)
	at com.instantiations.designer.core.editor.multi.SourcePage.createControl(SourcePage.java:66)
	at com.instantiations.designer.core.editor.multi.DefaultMultiMode.createTab(DefaultMultiMode.java:56)
	at com.instantiations.designer.core.editor.multi.MultiPagesMode.create(MultiPagesMode.java:74)
	at com.instantiations.designer.core.editor.multi.MultiPageEditor.createPartControl(MultiPageEditor.java:68)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:115)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPartControl(CompatibilityEditor.java:48)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:168)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.e4.core.internal.di.MethodRequestor.callMethod(MethodRequestor.java:57)
Comment 1 Remy Suen CLA 2010-05-03 22:37:30 EDT
I'm rather surprised by the NPE personally. We should probably actually fix the code so that it gets the right workbench window instead of just asking for it from the workbench.
Comment 2 Remy Suen CLA 2010-05-06 08:05:05 EDT
(In reply to comment #1)
> I'm rather surprised by the NPE personally.

For example, the PDE editors come up just fine and they nest a text editor in their editor.
Comment 3 Eric Moffatt CLA 2010-06-21 11:02:34 EDT
Is this still an issue ?
Comment 4 Dan Rubel CLA 2010-06-23 11:07:23 EDT
It works fine in RC0... Thanks!