Bug 118768 [Regression]Drop a grid closely near the left ruler in Layout will cause exception.
Description: Drop a grid closely near the left ruler in Layout will cause exception. Steps to reproduce: 1.create a report 2.drop a grid closely near the left ruler or right side Expected result: No exception and dimension dialog appears. Actual Result: org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException) at org.eclipse.swt.SWT.error(SWT.java:2942) at org.eclipse.swt.SWT.error(SWT.java:2865) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:126) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3057) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2716) at org.eclipse.jface.window.Window.runEventLoop(Window.java:809) at org.eclipse.jface.window.Window.open(Window.java:787) at org.eclipse.birt.report.designer.internal.ui.dialogs.BaseDialog.open(BaseDialog.java:145) at org.eclipse.birt.report.designer.internal.ui.palette.BasePaletteFactory$GridToolExtends.preHandleMouseUp(BasePaletteFactory.java:607) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.tools.ReportCreationTool.performCreation(ReportCreationTool.java:83) at org.eclipse.gef.tools.CreationTool.handleButtonUp(CreationTool.java:178) at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java:1053) at org.eclipse.gef.EditDomain.mouseUp(EditDomain.java:259) at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseReleased(DomainEventDispatcher.java:374) at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(LightweightSystem.java:548) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:137) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3080) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2713) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163) 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.core.launcher.Main.invokeFramework(Main.java:334) at org.eclipse.core.launcher.Main.basicRun(Main.java:278) at org.eclipse.core.launcher.Main.run(Main.java:973) at org.eclipse.core.launcher.Main.main(Main.java:948) Caused by: java.lang.NullPointerException at org.eclipse.gef.tools.TargetingTool.updateTargetUnderMouse(TargetingTool.java:376) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.tools.ReportCreationTool.handleMove(ReportCreationTool.java:298) at org.eclipse.gef.tools.TargetingTool.handleAutoexpose(TargetingTool.java:180) at org.eclipse.gef.tools.TargetingTool.doAutoexpose(TargetingTool.java:96) at org.eclipse.gef.tools.TargetingTool$QueuedAutoexpose.run(TargetingTool.java:285) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123) ... 33 more
UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/editors/schematic/tools/ReportCreationTool.java
.getCommandStack( )
				.commit( );
		selectAddedObject( );
		isCreating = false;
	}
	/**
	 * Performs the creation. Runs the creation via simulating the mouse move event.
	 * 
	 * @param editPart
	 *            the current EditPart
	 */
	public void performCreation( EditPart editPart )
	{
		if ( editPart == null )
			return;
		setTargetEditPart( editPart );
		boolean validateCurr = handleValidatePalette( getFactory( ).getObjectType( ),
				getTargetEditPart( ) );
		if ( !validateCurr )
		{
			
			setTargetEditPart( editPart.getParent( ) );
		}
		if ( validateCurr
				|| handleValidatePalette( getFactory( ).getObjectType( ),
						getTargetEditPart( ) ) )
		{
			
			IFigure figure = ( (GraphicalEditPart) editPart ).getFigure( );
			Rectangle rect = figure.getBounds( ).getCopy( );