Bug 184161 [Regression] Exception is thrown out when insert cross tab in layout [1102]
Description: Exception is thrown out when insert cross tab in layout. Build number: 2.2.0.v20070426-0630 Steps to reproduce: 1. Insert a cross tab in layout. Expected result: No exception is thrown out. Actual result: Exception is thrown out. Error log: org.eclipse.birt.report.designer.core.runtime.GUIException: org.eclipse.birt.report.designer.core.model.ReportDesignHandleAdapter at org.eclipse.birt.report.designer.core.runtime.GUIException.createGUIException(GUIException.java:76) at org.eclipse.birt.report.designer.internal.ui.util.ExceptionHandler.handle(ExceptionHandler.java:135) at org.eclipse.birt.report.designer.internal.ui.util.ExceptionHandler.handle(ExceptionHandler.java:117) at org.eclipse.birt.report.designer.ui.actions.BaseInsertMenuAction.run(BaseInsertMenuAction.java:231) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:545) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:402) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3673) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3284) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2337) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2301) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2176) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:463) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:458) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:101) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:146) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:356) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:171) 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:476) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:416) at org.eclipse.equinox.launcher.Main.run(Main.java:1141) Caused by: java.lang.ClassCastException: org.eclipse.birt.report.designer.core.model.ReportDesignHandleAdapter at org.eclipse.birt.report.designer.core.model.schematic.HandleAdapterFactory.getLibraryHandleAdapter(HandleAdapterFactory.java:306) at org.eclipse.birt.report.designer.core.model.schematic.HandleAdapterFactory.getLibraryHandleAdapter(HandleAdapterFactory.java:322) at org.eclipse.birt.report.item.crosstab.internal.ui.CreateCrosstabHandler.execute(CreateCrosstabHandler.java:105) at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:221) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:471) at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:173) at org.eclipse.birt.report.designer.internal.ui.command.CommandUtils.executeCommand(CommandUtils.java:127) at org.eclipse.birt.report.designer.internal.ui.extension.experimental.PaletteEntryExtension.executeCreate(PaletteEntryExtension.java:102) at org.eclipse.birt.report.designer.ui.actions.BaseInsertMenuAction.run(BaseInsertMenuAction.java:227) ... 28 more
xtab/org.eclipse.birt.report.item.crosstab.ui/src/org/eclipse/birt/report/item/crosstab/internal/ui/CreateCrosstabHandler.java
{
	private static String itemName = "Crosstab";
	public Object execute( ExecutionEvent event ) throws ExecutionException
	{
		SessionHandleAdapter.getInstance( )
				.getReportDesignHandle( )
				.getCommandStack( )
				.startTrans( "Create " + itemName ); 
		ExtendedItemHandle handle = null;
			handle = DesignElementFactory.getInstance( ).newExtendedItem( null,
					itemName );
			
			
			
			
			
			Map map = new HashMap( );
			map.put( DesignerConstants.KEY_NEWOBJECT, handle );
			CreateCommand command = new CreateCommand( map );
			
			
			
			
			IEvaluationContext context = (IEvaluationContext) event.getApplicationContext( );
			EditPart targetEditPart = (EditPart) context.getVariable( "targetEditPart" );
			if ( targetEditPart != null )
			{