Bug 152694 NPE when converting an autotext to template report item
Steps to reproduce: 1.Add an autotext, say "Page", to the master page header/footer 2.Right click the autotext, choose "Create a template report item" Expected result: Autotext can be converted to a template report item Actual result: org.eclipse.birt.report.designer.core.runtime.GUIException: Caused by java.lang.NullPointerException. 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:123) at org.eclipse.birt.report.designer.internal.ui.util.ExceptionHandler.handle(ExceptionHandler.java:105) at org.eclipse.birt.report.designer.internal.ui.editors.parts.event.ModelEventManager.postModelEvent(ModelEventManager.java:132) at org.eclipse.birt.report.designer.internal.ui.editors.parts.event.ModelEventManager.postEvent(ModelEventManager.java:102) at org.eclipse.birt.report.designer.internal.ui.editors.parts.event.ModelEventManager.access$000(ModelEventManager.java:36) at org.eclipse.birt.report.designer.internal.ui.editors.parts.event.ModelEventManager$1.stackChanged(ModelEventManager.java:62) at org.eclipse.birt.report.model.activity.ActivityStack.sendNotifcations(ActivityStack.java:845) at org.eclipse.birt.report.model.activity.ActivityStack.commit(ActivityStack.java:719) at org.eclipse.birt.report.designer.internal.ui.views.actions.AbstractElementAction.run(AbstractElementAction.java:71) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.actions.WrapperSelectionAction.run(WrapperSelectionAction.java:61) at org.eclipse.jface.action.Action.runWithEvent(Action.java:499) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) 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:324) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952) Caused by: java.lang.NullPointerException at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.PlaceHolderEditPart.refreshFigure(PlaceHolderEditPart.java:78) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.ReportElementEditPart.refreshVisuals(ReportElementEditPart.java:514) at org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractEditPart.java:676) at org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh(AbstractGraphicalEditPart.java:554) at org.eclipse.gef.editparts.AbstractEditPart.addNotify(AbstractEditPart.java:235) at org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotify(AbstractGraphicalEditPart.java:212) at org.eclipse.gef.editparts.AbstractEditPart.addChild(AbstractEditPart.java:198) at org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(AbstractEditPart.java:727) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.ReportElementEditPart.refreshChildren(ReportElementEditPart.java:525) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.MasterPageEditPart.refreshChildren(MasterPageEditPart.java:236) at org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractEditPart.java:677) at org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh(AbstractGraphicalEditPart.java:554) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.ReportElementEditPart.contentChange(ReportElementEditPart.java:857) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.AbstractReportEditPart.contentChange(AbstractReportEditPart.java:199) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.AbstractReportEditPart$1.runModelChange(AbstractReportEditPart.java:67) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.AbstractReportEditPart$EditpartReportEventRunnable.run(AbstractReportEditPart.java:227) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.AbstractModelEventProcessor.postElementEvent(AbstractModelEventProcessor.java:96) at org.eclipse.birt.report.designer.internal.ui.editors.parts.event.ModelEventManager.postModelEvent(ModelEventManager.java:127) ... 33 more
model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/core/DesignElement.java
*/
	public void setID( long newID )
	{
		id = newID;
	}
	/**
	 * Returns the unique element ID. The ID will be valid only if element IDs
	 * were enabled in the MetaDataDictionary.
	 * 
	 * @return The unique ID. Returns 0 if element IDs are not enabled.
	 */
	public long getID( )
	{
		return this.id;
	}
	/**
	 * Determines if this element is contained in the given element. Checks up
	 * the containment hierarchy.
	 * 
	 * @param element
	 *            The potential container.
	 * @return True if this element is contained in the container either
	 *         directly or indirectly. False if this element is not contained.
	 *         If the given element is this element itself, return true.
	 */
	public boolean isContentOf( DesignElement element )
	{
		DesignElement e = this;
		while ( e != null )
		{