Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326289 - NullPointerException in Workbenchpage with disabled coolbar
Summary: NullPointerException in Workbenchpage with disabled coolbar
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: Workbench (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.4 M5   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 309661
Blocks:
  Show dependency tree
 
Reported: 2010-09-27 07:24 EDT by Patrick Haun CLA
Modified: 2011-04-15 05:07 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.