Project: Birt
Bug 272649 Exception happened when dnd multiple level attributes into crosstab
Reported: 2009-04-17 03:52:33 | Status: closed fixed

Description: Exception happened when dnd multiple levels into crosstab Build number: 2.5.0.v20090417-0630 Steps to reproduce: 1, New a level with several attributes in cube builder 2, Multiple select more than two attributes and drag them into crosstab area Expected result: After step2, no exception happened. if we don't allow this operation we can disable the dragging Actual result: After step2, exception happened. Error log: java.lang.ClassCastException: org.eclipse.birt.report.model.api.LevelAttributeHandle at org.eclipse.birt.report.item.crosstab.internal.ui.editors.model.VirtualCrosstabCellAdapter.handleValidate(VirtualCrosstabCellAdapter.java:129) at org.eclipse.birt.report.item.crosstab.internal.ui.dnd.LevelAttributeHandleDropAdapter.canDrop(LevelAttributeHandleDropAdapter.java:64) at org.eclipse.birt.report.designer.internal.ui.dnd.DNDService.performDrop(DNDService.java:155) at org.eclipse.birt.report.designer.internal.ui.palette.ReportTemplateTransferDropTargetListener.handleDrop(ReportTemplateTransferDropTargetListener.java:120) at org.eclipse.gef.dnd.AbstractTransferDropTargetListener.drop(AbstractTransferDropTargetListener.java:171) at org.eclipse.jface.util.DelegatingDropAdapter$3.run(DelegatingDropAdapter.java:211) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:888) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) at org.eclipse.jface.util.DelegatingDropAdapter.drop(DelegatingDropAdapter.java:209) 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.Widget.sendEvent(Widget.java:1003) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:770) at org.eclipse.swt.dnd.DropTarget.Drop(DropTarget.java:456) at org.eclipse.swt.dnd.DropTarget$3.method6(DropTarget.java:258) at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:119) at org.eclipse.swt.internal.ole.win32.COM.DoDragDrop(Native Method) at org.eclipse.swt.dnd.DragSource.drag(DragSource.java:363) at org.eclipse.swt.dnd.DragSource.access$0(DragSource.java:289) at org.eclipse.swt.dnd.DragSource$1.handleEvent(DragSource.java:172) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3880) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2393) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2357) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2209) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:499) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:492) 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(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:556) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:511) at org.eclipse.equinox.launcher.Main.run(Main.java:1284)

Files changed in fix:
xtab/org.eclipse.birt.report.item.crosstab.ui/src/org/eclipse/birt/report/item/crosstab/internal/ui/editors/commands/AddLevelAttributeHandleCommand.java xtab/org.eclipse.birt.report.item.crosstab.ui/src/org/eclipse/birt/report/item/crosstab/internal/ui/editors/editpolicies/CrosstabCellFlowLayoutEditPolicy.java xtab/org.eclipse.birt.report.item.crosstab.ui/src/org/eclipse/birt/report/item/crosstab/internal/ui/editors/editpolicies/VirtualCrosstabCellFlowLayoutEditPolicy.java xtab/org.eclipse.birt.report.item.crosstab.ui/src/org/eclipse/birt/report/item/crosstab/internal/ui/editors/model/NormalCrosstabCellAdapter.java xtab/org.eclipse.birt.report.item.crosstab.ui/src/org/eclipse/birt/report/item/crosstab/internal/ui/editors/model/VirtualCrosstabCellAdapter.java