RCP to RAP : getDefault in no-UI thread [message #1298322] |
Wed, 16 April 2014 07:21 |
Clément Chausson Messages: 16 Registered: November 2013 |
Junior Member |
|
|
Hi,
I currently try to convert a big RCP application in RAP but i have some troubles :
When i tried to call Display.getDefault() in my function it returns null :
Quote:!ENTRY org.eclipse.core.jobs 4 2 2014-04-16 09:13:05.265
!MESSAGE An internal error occurred during: "Create operation launched".
!STACK 0
java.lang.NullPointerException
at thales.themis.em.gene.gem.ui.api.MassObjectEditorManager.findMassObjectEditor(MassObjectEditorManager.java:97)
at thales.themis.em.gene.gem.ui.api.MassObjectEditorManager.<init>(MassObjectEditorManager.java:61)
at thales.themis.em.gene.gem.ui.api.MassObjectEditorManager.getInstance(MassObjectEditorManager.java:175)
at thales.themis.em.gene.gem.ui.operations.GemOperation.potentiallyAddMassEditorContext(GemOperation.java:130)
at thales.themis.em.gene.gem.ui.operations.CreateOperation.<init>(CreateOperation.java:109)
at thales.themis.em.gene.gem.ui.operations.CreateOperation.<init>(CreateOperation.java:147)
at thales.themis.em.gene.gem.ui.action.CreateObjectAction.run(CreateObjectAction.java:129)
at thales.themis.em.gene.gem.ui.wizards.AssociateObjectWizard$1.run(AssociateObjectWizard.java:197)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
I know that is because i don't call it in the UI thread but i don't know how to solve it .
private void findMassObjectEditor() {
if (this.editor == null) {
[color=red]Display.getDefault()[/color].syncExec(new Runnable() {
@Override
public void run() {
final IWorkbenchWindow activeWorkbenchWindow =
PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (activeWorkbenchWindow != null) {...
I already read all about it in the RAP/FAQ, in particular section "How to update the UI from a background thread using Jobs?" and "Why does Display#getDefault() work different than in SWT" but i don't find any solution.
I would be very grateful for any help you could might be able to give me on my problem.
Thank you.
Clément
[Updated on: Wed, 16 April 2014 07:40] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03064 seconds