Skip to main content



      Home
Home » Modeling » TMF (Xtext) » xtext.createEditor issue by using orion codeEdit plugin(I want to ask how to call xtext.createEditor() more than once in one page when take orion editor as plugin.)
xtext.createEditor issue by using orion codeEdit plugin [message #1733202] Wed, 25 May 2016 07:18 Go to next message
Eclipse UserFriend
I'm trying to create web editor by using Orion CodeEditor 11.0 and above.
But unfortunately, I found when I call xtext.createEditor() twice to create two editors separately, it always failed.

require([ "orion/code_edit/built-codeEdit-amd" ], function() {
require([ "xtext/xtext-orion" ], function(xtext) {
xtext.createEditor({
baseUrl : baseUrl,
...
position : "absolute",
sendFullText: onlyInBrowser
}).done(function(editorViewer) {
editorViewer.xtextServices.successListeners.push(handleSuccessResponse);
editorViewer.xtextServices.errorListeners.push(handleErrorResponse)

Actually, I know xtext.createEditor() can create multi editors during one invocation.
But what I want to do is to create these editors on demand and dynamically.

After I search for Orion CodeEditor example and source code, I found, Orion CodeEdit couldn't be new twice in the same document/page.
That means (I think), in xtext-orion.js, the following statement will introduce problem.
var startupOptions = options.startupOptions;
if (!startupOptions)
startupOptions = { defaultPlugins: ['webToolsPlugin.html'] };
--> var embeddedEditor = new mEmbeddedEditor(startupOptions);
var editorData = [];

Does any one meet the same problem? Or any one knows how to fix this?

BTW, it seems, xtext-orion.js can't work with orion editor 10.0. But I can't find where to mention this limitation.
Re: xtext.createEditor issue by using orion codeEdit plugin [message #1733205 is a reply to message #1733202] Wed, 25 May 2016 00:30 Go to previous messageGo to next message
Eclipse UserFriend
Seems https://github.com/eclipse/xtext/blob/master/web/org.eclipse.xtext.web.example.jetty/src/main/webapp/orion-statemachine-resource-multi.html calls it once only as well
Re: xtext.createEditor issue by using orion codeEdit plugin [message #1733282 is a reply to message #1733205] Wed, 25 May 2016 20:32 Go to previous messageGo to next message
Eclipse UserFriend
HI Christian,

I know that example.
But just as I mentioned in the topic.
That's just static call. You have to decide how many editors do you want to create at the beginning.

My target is to invoke xtext.createEdtior on demand.
That means when user wants to create new editor, then we create it.

It (calling xtext.createEditor on demand) works when I use ace editor plugin, but it doesn't work when I use orion editor plugin.

Actually, I think it is a bug or at least an improvement point for xtext-orion.js. I registered a bug in Eclipse Bug.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=494315

But it seems no one read it at all.
Re: xtext.createEditor issue by using orion codeEdit plugin [message #1733285 is a reply to message #1733282] Thu, 26 May 2016 03:50 Go to previous messageGo to next message
Eclipse UserFriend
its just a matter of "we are all too busy"
Re: xtext.createEditor issue by using orion codeEdit plugin [message #1733296 is a reply to message #1733285] Wed, 25 May 2016 22:24 Go to previous messageGo to next message
Eclipse UserFriend
Currently Orion CodeEdit does not work well with the Xtext integration when multiple editors are used:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=482594

If you want multiple editors, at the moment I would recommend to use Ace or CodeMirror.
Re: xtext.createEditor issue by using orion codeEdit plugin [message #1733354 is a reply to message #1733285] Thu, 26 May 2016 14:35 Go to previous message
Eclipse UserFriend
Get it. Sad
Previous Topic:Separate model project
Next Topic:Using Names from a text file inside the DSL
Goto Forum:
  


Current Time: Sun Mar 23 08:32:27 EDT 2025

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

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

Back to the top