-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Rich Text] Exception when opening a second rich text editor #434
Comments
Hi I've checked the code and I did not see something special. Can you please specify your JDK and your OS please ? |
Hi, I'm running OpenJDK: on Debian Bullseye. The whole thing I integrated the rich text editor into is an Eclipse RCP with the org.eclipse.ide.ui.workbench application. My target platform consists of:
|
We have an E4 application example here: In that example we have 3 tabs, one with only the editor, one with editor and viewer, and one with a JFace table that integrates the editor as cell editor. So we have a similar setup with multiple tabs that each contains a RichTextEditor. On Windows I do not see that exception. getAllOptions is a BrowserFunction that is created and added to the internal Browser instance in the RichTextEditor constructor. It is called by the Javascript once the loading of the page is completed. And the responsible ProgressListener is added after the BrowserFunction is created and added. So that should all be instance local and from looking in the RichTextEditor code I would not see any concurrency issue as even initialization and and creation is in the correct order (the ProgressListener can not be called before the BrowserFuntion is added). To get closer to the issue, could you please try if you can run the E4 example in your environment and if that reproduces the issue? For me it looks like a concurrency issue that the init function is somehow triggered although the BrowserFunction is not ready. Maybe it is an SWT Browser issue on Linux? We need to check that so we are not searching in the wrong direction. |
I've cloned the nebula repo and run the E4 example. When I switch from the first tab to the second one I get the same exception (see below). Anything I can do to help finding the root cause of the issue? /myworkspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.eclipse.nebula.widgets.richtext_1.4.0.202106201019/org/eclipse/nebula/widgets/richtext/resources/template.html:214:50: ReferenceError: Can't find variable: getAllOptions |
Seems to be an issue in SWT with the latest webkit https://bugs.eclipse.org/bugs/show_bug.cgi?id=573616 Not sure if there is anything we or you can do. Despite you are an expert with webkit and the SWT integration, then the SWT team would surely appreciate any help. |
Although I'm trying to learn more about SWT internals I may not be the right person then. Thanks for finding this. |
Postponed to 2.8.0 |
FWIW, https://bugs.eclipse.org/bugs/show_bug.cgi?id=573616 is fixed for eclipse 4.24 (2022-06) and it works for me, now (I tested with eclipse 4.25). So from my POV, this can be closed, no changes in Nebula needed. |
Great news ! |
The least, I can do. Thank you so much for maintaining Nebula! ❤️ |
I'm currently expermenting with Nebula's rich text editor integrated in one tab of a multi page editor. This works in general very nice.
However this only works for the first editor. As soon as a try to open further multipage editors (for other files) I get for each the exception as attached below and no rich text editor is shown in my editor tab. Am I doing something wrong? Is there some special configuration needed. Sofar there is not much code around the rich text editor. My code can be found here: https://git.eclipse.org/r/c/4diac/org.eclipse.4diac.ide/+/189068
/myworkspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.eclipse.nebula.widgets.richtext_1.4.0.202106201019/org/eclipse/nebula/widgets/richtext/resources/template.html:214:50: ReferenceError: Can't find variable: getAllOptions
Script that was evaluated:
function SWTWebkit2TempFunc37(){initEditor();}; SWTWebkit2TempFunc37()
at org.eclipse.swt.browser.WebKit$Webkit2AsyncToSync.runjavascript(WebKit.java:1211)
at org.eclipse.swt.browser.WebKit$Webkit2AsyncToSync.evaluate(WebKit.java:1154)
at org.eclipse.swt.browser.WebKit.evaluate(WebKit.java:1475)
at org.eclipse.swt.browser.WebBrowser.evaluate(WebBrowser.java:406)
at org.eclipse.swt.browser.Browser.evaluate(Browser.java:666)
at org.eclipse.swt.browser.Browser.evaluate(Browser.java:615)
at org.eclipse.nebula.widgets.richtext.RichTextEditor$3.completed(RichTextEditor.java:284)
at org.eclipse.swt.browser.WebKit.lambda$7(WebKit.java:1945)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:5101)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4584)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1154)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1045)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
at org.eclipse.equinox.launcher.Main.main(Main.java:1440)
The text was updated successfully, but these errors were encountered: