Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 326289

Summary: NullPointerException in Workbenchpage with disabled coolbar
Product: [RT] RAP Reporter: Patrick Haun <P.Haun>
Component: WorkbenchAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: holger.staudacher, P.Haun
Version: unspecified   
Target Milestone: 1.4 M5   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 309661    
Bug Blocks:    

Description Patrick Haun CLA 2010-09-27 07:24:43 EDT
Build Identifier: Rap 1.3

Using the business demo theme and disable the coolbar raises a NullPointerException.


 java.lang.NullPointerException
         at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:3562)
         at org.eclipse.ui.handlers.ShowPerspectiveHandler.openPerspective(ShowPerspectiveHandler.java:152)
         at org.eclipse.ui.handlers.ShowPerspectiveHandler.openOther(ShowPerspectiveHandler.java:124)
         at org.eclipse.ui.handlers.ShowPerspectiveHandler.execute(ShowPerspectiveHandler.java:63)
         at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:274)
         at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
         at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
         at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:167)
         at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:245)
         at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:155)
         at org.eclipse.ui.internal.actions.CommandAction.run(CommandAction.java:169)
         at org.eclipse.rap.internal.design.example.builder.PerspectiveSwitcherBuilder$2.widgetSelected(PerspectiveSwitcherBuilder.java:156)


Reproducible: Always

Steps to Reproduce:
1. Disable the Coolbar
2. Switch the Perspective
Comment 1 Ivan Furnadjiev CLA 2010-10-04 10:46:37 EDT
Patrick, could you provide a snippet that demonstrate the problem? Could you test your code in RCP? Does it work there?
Comment 2 Patrick Haun CLA 2010-10-05 02:40:02 EDT
It's a problem using the rap demo business theme. I don't know how to test this in RCP. 

@Override
   public void preWindowOpen()
   {
      final IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
      final Rectangle bounds = Display.getDefault().getBounds();
      configurer.setInitialSize(new Point(bounds.width, bounds.height));
      configurer.setShowCoolBar(false);
      configurer.setShowStatusLine(true);
      configurer.setShowFastViewBars(false);
      configurer.setShowPerspectiveBar(false);
      configurer.setShowProgressIndicator(false);
      configurer.setShellStyle(SWT.NO_TRIM);
  }

The coolbar will not be initialized. This is the reason for the NPE. This is the code that raises the exception:

getClientComposite().setRedraw(true);
mgr.getControl2().setRedraw(true);


The Control2 is the coolbar.
Comment 3 Ivan Furnadjiev CLA 2010-10-06 07:40:16 EDT
Hi Patrick, this is a bug in the original workbench code. See bug 254936.
It has been fixed in Workbench 3.5, but RAP is still based on Workbench code 3.4.
This should be fixed as part of Workbench code update to 3.7 ( see bug 309661 ).
Comment 4 Ivan Furnadjiev CLA 2011-04-15 05:07:35 EDT
Fixed with bug 309661.