Bug 284164 D&D in the UI model editor does not work (IllegalArgumentException from SWT)
eclipse.buildId=I20090720-2115 java.version=1.5.0_19 java.vendor=Apple Inc. BootLoader constants: OS=macosx, ARCH=x86, WS=cocoa, NL=en_US Framework arguments: -keyring /Users/bokowski/.eclipse_keyring -showlocation Command-line arguments: -os macosx -ws cocoa -arch x86 -keyring /Users/bokowski/.eclipse_keyring -showlocation Error Tue Jul 21 13:38:15 EDT 2009 Unhandled event loop exception java.lang.IllegalArgumentException: Widget has the wrong parent at org.eclipse.swt.SWT.error(SWT.java:3865) at org.eclipse.swt.SWT.error(SWT.java:3799) at org.eclipse.swt.SWT.error(SWT.java:3770) at org.eclipse.e4.ui.widgets.CTabItem.setControl(CTabItem.java:880) at org.eclipse.e4.workbench.ui.renderers.swt.StackRenderer.internalChildAdded(StackRenderer.java:212) at org.eclipse.e4.workbench.ui.renderers.swt.StackRenderer.childAdded(StackRenderer.java:238) at org.eclipse.e4.workbench.ui.renderers.PartRenderingEngine$2.notifyChanged(PartRenderingEngine.java:92) at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:280) at org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1033) at org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1038) at org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1038) at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:305) at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:307) at org.eclipse.e4.demo.viewer.ModelExplorer$2.drop(ModelExplorer.java:133) at org.eclipse.swt.dnd.DNDListener.handleEvent(DNDListener.java:90) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3542) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1247) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1270) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1255) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1076) at org.eclipse.swt.dnd.DropTarget.drop(DropTarget.java:706) at org.eclipse.swt.dnd.DropTarget.outlineView_acceptDrop_item_childIndex(DropTarget.java:724) at org.eclipse.swt.dnd.DropTarget.dropTargetProc(DropTarget.java:449) at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) at org.eclipse.swt.dnd.DropTarget.callSuper(DropTarget.java:196) at org.eclipse.swt.dnd.DropTarget.performDragOperation(DropTarget.java:717) at org.eclipse.swt.dnd.DropTarget.dropTargetProc(DropTarget.java:434) at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:202) at org.eclipse.swt.widgets.Widget.mouseDown(Widget.java:917) at org.eclipse.swt.widgets.Control.mouseDown(Control.java:2151) at org.eclipse.swt.widgets.Tree.mouseDown(Tree.java:1894) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4652) at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:202) at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:1750) at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:1821) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4712) at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:4284) at org.eclipse.swt.widgets.Display.applicationProc(Display.java:4351) at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method) at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:101) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3096) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2727) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2691) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2543) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:556) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:549) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514) at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/workbench/ui/renderers/swt/StackRenderer.java
import org.eclipse.e4.ui.widgets.ETabFolder;
import org.eclipse.e4.ui.widgets.ETabItem;
import org.eclipse.e4.workbench.ui.internal.IValueFunction;
import org.eclipse.e4.workbench.ui.renderers.AbstractPartRenderer;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.databinding.EMFObservables;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.databinding.swt.ISWTObservableValue;
import org.eclipse.jface.databinding.swt.SWTObservables;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.swt.widgets.Widget;
public class StackRenderer extends LazyStackRenderer {