Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Error with Opening an editor in new Window(Migrating RCP to e4)
Error with Opening an editor in new Window [message #1053618] Mon, 06 May 2013 21:19 Go to next message
Xihui Chen is currently offline Xihui ChenFriend
Messages: 35
Registered: June 2011
Member
I'm migrating our RCP product to e4 and got a problem when I trying to open a new editor in a new window I just created.

Here is the code:

IWorkbenchWindow targetWindow = PlatformUI.getWorkbench().openWorkbenchWindow(OPIRunnerPerspective.ID, null);
Shell shell = targetWindow.getShell(); if(shell.getMinimized())
shell.setMinimized(false);
targetWindow.getShell().forceActive();
targetWindow.getShell().forceFocus();
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(runnerInput, OPIRunner.ID);

Here is the error:
Caused by: java.lang.NullPointerException
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:3063)
at org.eclipse.ui.internal.WorkbenchPage.access$22(WorkbenchPage.java:2969)
at org.eclipse.ui.internal.WorkbenchPage$8.run(WorkbenchPage.java:2951)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2947)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2911)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2894)
at org.csstudio.opibuilder.runmode.RunModeService$1$2.run(RunModeService.java:176)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
... 24 more

Is this a bug of compatibility layer? Is that possible to work around it?

Thanks!
Re: Error with Opening an editor in new Window [message #1053658 is a reply to message #1053618] Tue, 07 May 2013 07:52 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5467
Registered: July 2009
Senior Member
What version of Eclipse 4.2 or 4.3? If you can reproduce with one of the
latest builds file a bugzilla.

Tom

On 06.05.13 23:19, Xihui Chen wrote:
> I'm migrating our RCP product to e4 and got a problem when I trying to
> open a new editor in a new window I just created.
>
> Here is the code:
>
> IWorkbenchWindow targetWindow =
> PlatformUI.getWorkbench().openWorkbenchWindow(OPIRunnerPerspective.ID,
> null);
> Shell shell = targetWindow.getShell();
> if(shell.getMinimized())
> shell.setMinimized(false);
> targetWindow.getShell().forceActive();
> targetWindow.getShell().forceFocus();
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(runnerInput,
> OPIRunner.ID);
>
> Here is the error:
> Caused by: java.lang.NullPointerException
> at
> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:3063)
>
> at
> org.eclipse.ui.internal.WorkbenchPage.access$22(WorkbenchPage.java:2969)
> at
> org.eclipse.ui.internal.WorkbenchPage$8.run(WorkbenchPage.java:2951)
> at
> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
> at
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2947)
> at
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2911)
> at
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2894)
> at
> org.csstudio.opibuilder.runmode.RunModeService$1$2.run(RunModeService.java:176)
>
> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
> at
> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
>
> ... 24 more
>
> Is this a bug of compatibility layer? Is that possible to work around it?
>
> Thanks!
Previous Topic:Key bindings for custom controls not working with compatibility layer
Next Topic:Editor pane tab display policy
Goto Forum:
  


Current Time: Wed Nov 26 10:27:20 GMT 2014

Powered by FUDForum. Page generated in 0.02168 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software