Hi Marius,
Since the first approach which is "1) edit the wysiwyg_createEditor velocity
macro from macros.vm" is simpler, I will modify macros.vm. You said "new
WysiwygEditor($jsVarName); with something like window["${fieldId}_editor"] =
new WysiwygEditor($jsVarName);" Could you please explain briefly what does
"window["${fieldId}_editor"]" mean? What is it for? Is it a function
of
javascript? In the macros.vm I found "Wysiwyg.onModuleLoad(function() {new
WysiwygEditor($jsVarName); $jsVarName = undefined;});", I did not find any
"window" stuff.
So after the first step, I got the reference, is the reference stored
in window["${fieldId}_editor"]
variable?
Since don't depend at all on WYSIWYG Java code is not possible and do not
bring you more work, I think should go with "i) access the editor in Java
(GWT) code by writing a simple native getter". For the code you provided
"editorJSReference.@com.xpn.xwiki.wysiwyg.client.editor.WysiwygEditorApi::editor;"
I never saw code like this, is the @ for Java annotation or Component? Is
there any document I can read to learn about the related
rationale/knowledge? 'cause I have no clue what it means. So this line will
return the WYSIWYG editor's reference restored/declared in the macros.vm
file?
I tried to add a new page in the draft document for Loading GWT in Xwiki
page, It seems I can't add new page, only editing existing document. Should
I add something behind your "Writing GWT applications in XWiki", so you
could create a new one or something else. If there are work I can do to save
your time or to make Xwiki better, feel free to assign me the work. I am
more than happy to help.
Thank you for taking your time to help me!
-Leon