Bug 212372 [regression]NPE when apply style from css file in Layout[0303]
Description: NPE when apply style from css file in Layout Build number:2.3.0.v20071210 Steps to reproduce: 1. Copy attached css file to your birt project. 2. New a report. 3. Insert a label. 4. In outline->Styles, right click,select Use CSS File..., select the css file. 5. Right click the label, apply the style "table1" to it. Expected result: Style can be applied to label item. Actual result: No available styles in apply style menu, and then click Layout, NPE throws out. Error log: java.lang.NullPointerException at org.eclipse.birt.report.designer.internal.ui.editors.schematic.actions.EditStyleAction.<init>(EditStyleAction.java:50) at org.eclipse.birt.report.designer.ui.actions.EditStyleMenuAction.getItems(EditStyleMenuAction.java:56) at org.eclipse.birt.report.designer.ui.actions.MenuUpdateAction.run(MenuUpdateAction.java:114) at org.eclipse.birt.report.designer.ui.actions.MenuUpdateAction.updateMenu(MenuUpdateAction.java:146) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.providers.SchematicContextMenuProvider.updateDynamicItems(SchematicContextMenuProvider.java:776) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.providers.SchematicContextMenuProvider.access$0(SchematicContextMenuProvider.java:771) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.providers.SchematicContextMenuProvider$1.menuAboutToShow(SchematicContextMenuProvider.java:682) at org.eclipse.jface.action.MenuManager.fireAboutToShow(MenuManager.java:326) at org.eclipse.jface.action.MenuManager.handleAboutToShow(MenuManager.java:441) at org.eclipse.jface.action.MenuManager.access$1(MenuManager.java:437) at org.eclipse.jface.action.MenuManager$2.menuShown(MenuManager.java:463) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:947) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:971) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:952) at org.eclipse.swt.widgets.Control.WM_INITMENUPOPUP(Control.java:4096) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3800) at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:334) at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1559) at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:1880) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4423) at org.eclipse.swt.internal.win32.OS.TrackPopupMenu(Native Method) at org.eclipse.swt.widgets.Menu._setVisible(Menu.java:230) at org.eclipse.swt.widgets.Display.runPopups(Display.java:3770) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3349) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2395) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2359) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2225) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:468) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:463) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) 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:362) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:175) 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:515) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:455) at org.eclipse.equinox.launcher.Main.run(Main.java:1193)
UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/editors/schematic/actions/EditStyleAction.java
if ( handle.canEdit( ) )
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.jface.action.Action#run()
	 */
	public void run( )
	{
		
		CommandUtils.setVariable(ICommandParameterNameContants.EDIT_STYLE_SHARED_STYLE_HANDLE_NAME, handle);
		try
		{
			CommandUtils.executeCommand( "org.eclipse.birt.report.designer.ui.command.editStyleCommand", null );
		}
		catch ( Exception e )
		{
			
			logger.log( Level.SEVERE, e.getMessage( ),e );
		};
		
	}
}