[Richtext Editor] How to wait to load of browser [message #1743864] |
Tue, 20 September 2016 09:46 |
|
Hi,
I use the richtext editor in a view but, at the first opening I have:
!ENTRY org.eclipse.e4.ui.workbench 4 0 2016-09-20 11:36:58.467
!MESSAGE
!STACK 0
org.eclipse.swt.SWTException: Impossible d'obtenir la propriété « setReadOnly » d'une référence null ou non définie
at org.eclipse.swt.browser.WebBrowser$EvaluateFunction.function(WebBrowser.java:192)
at org.eclipse.swt.browser.WebSite.Invoke(WebSite.java:833)
Apparently the browser is not totally loaded and CKEditor function are not yet available.
Is there a way to wait or be sure that function are loaded before using them?
thanks a lot.
Mickaël
|
|
|
|
Re: [Richtext Editor] How to wait to load of browser [message #1743886 is a reply to message #1743874] |
Tue, 20 September 2016 12:20 |
|
The instanciation:
toolbarConfig = new UMLToolbarConfiguration();
toolbarConfig.toolbarCollapsible = true;
toolbarConfig.removeFormat = false;
toolbarConfig.toolbarInitialExpanded = Activator.getToolbarInitialExpendedPreference();
richtextEditor = new UMLRichtextEditorWithReferences(parent, toolbarConfig);
The refrech at the selection change on a diagram element or at the opening when an element is already selected:
// Refresh rich text text editor
richtextEditor.getDisplay().syncExec(new Runnable() {
@Override
public void run() {
if (null != richtextEditor && !richtextEditor.isDisposed()) {
richtextEditor.configureEdition(comment, null != comment ? UMLPackage.eINSTANCE.getComment_Body() : null);
richtextEditor.setText(text);
richtextEditor.setEditable(readOnly ? false : editable);
}
}
});
NB: I passe from asyncExec to syncExec due to synchronisation issue but I have now "permission refused issue" which comme back:
!ENTRY org.eclipse.e4.ui.workbench 4 0 2016-09-20 14:19:07.154
!MESSAGE
!STACK 0
org.eclipse.swt.SWTException: Permission refusée
at org.eclipse.swt.browser.WebBrowser$EvaluateFunction.function(WebBrowser.java:192)
at org.eclipse.swt.browser.WebSite.Invoke(WebSite.java:833)
at org.eclipse.swt.browser.WebSite$7.method6(WebSite.java:184)
at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:119)
at org.eclipse.swt.internal.ole.win32.COM.VtblCall(Native Method)
at org.eclipse.swt.internal.ole.win32.IDispatch.Invoke(IDispatch.java:64)
|
|
|
|
Powered by
FUDForum. Page generated in 0.04512 seconds