Bug 119219 Put the template publish to the template folder, system throws exception
Put the template publish to the template folder, system throws exception. Steps: 1.Create a template 2.Select "File-Publish To Template Folder" 3.Input name and image 4.Click "Finish" Expected Results: 1.Can be published Actual Results: 1.System throws exception java.lang.NullPointerException at org.eclipse.birt.report.designer.ui.actions.PublishPage.validate(PublishTemplateAction.java:439) at org.eclipse.birt.report.designer.ui.actions.PublishPage.access$000(PublishTemplateAction.java:231) at org.eclipse.birt.report.designer.ui.actions.PublishPage$1.modifyText(PublishTemplateAction.java:307) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:188) 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.Widget.sendEvent(Widget.java:867) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:848) at org.eclipse.swt.widgets.Text.wmCommandChild(Text.java:2061) at org.eclipse.swt.widgets.Control.WM_COMMAND(Control.java:3164) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3041) at org.eclipse.swt.widgets.Display.windowProc(Display.java:3706) at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:1580) at org.eclipse.swt.widgets.Text.callWindowProc(Text.java:131) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3123) at org.eclipse.swt.widgets.Text.windowProc(Text.java:1777) at org.eclipse.swt.widgets.Display.windowProc(Display.java:3706) at org.eclipse.swt.internal.win32.OS.SetWindowTextW(Native Method) at org.eclipse.swt.internal.win32.OS.SetWindowText(OS.java:2355) at org.eclipse.swt.widgets.Text.setText(Text.java:1593) at org.eclipse.birt.report.designer.ui.actions.PublishPage$2.widgetSelected(PublishTemplateAction.java:328) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90) 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.jface.window.Window.runEventLoop(Window.java:809) at org.eclipse.jface.window.Window.open(Window.java:787) at org.eclipse.birt.report.designer.ui.actions.PublishTemplateAction.run(PublishTemplateAction.java:84) at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:246) at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:223) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538) 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: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(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: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)
UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/actions/PublishTemplateAction.java
WizardDialog dialog = new WizardDialog( UIUtil.getDefaultShell( ),
				new PublishTemplateWizard( ) );
		dialog.setPageSize( 500, 250 );
		dialog.open( );
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
	 *      org.eclipse.jface.viewers.ISelection)
	 */
	public void selectionChanged( IAction action, ISelection selection )
	{
		action.setEnabled( isEnable( ) ); 
	}
	private boolean isEnable( )
	{
		IEditorPart editor = UIUtil.getActiveEditor( true );
		if ( editor != null )
		{
			return ( editor.getEditorInput( ).getName( )
					.endsWith( ".rpttemplate" ) ); 
		}
		return false;
	}
}
/**
 * PublishTemplateWizard
 */
class PublishTemplateWizard extends Wizard