Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orion-dev] Fw: [flux-dev] Orion plugins questions

Hi,

You need to get a hold of the editor context service which gives you the ability to get/setText() into the editor from plugins (amongst other things like get/setSelection, etc).   The editor context is provide as a parameter in several other services:  orion.edit.contentAssist,   orion.edit.outliner,   orion.edit.validator,  etc.   I am not sure which one would be the best one for you to hook into.   Maybe we should provide the editor context in another service that makes more sense for what you are trying to do.  It could be provided in the "orion.edit.model" service for instance.

As for getting the file path, I believe it is only exposed to the orion.edit.validator service today (see [1]).  There are requests in bugzilla to exposed it in other services as well (see [2]).  One option is to provide it  via the editor context.

I cannot recall anyway to get the current user. I am not sure this is something that should be exposed to plugins for security reasons.  Why is it necessary?

Finally, I wonder if doing the synchronization of the changes in a orion plugin is feasible.  It might be something that has to run in the host page for performance reasons.

Please open bug reports for anything you might and we will try to address them.  Having shared editing support is a cool feature.

[1] https://orion.eclipse.org/help/index.jsp
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=419499

Silenio




From:        John Arthorne/Ottawa/IBM@IBMCA
To:        orion-dev@xxxxxxxxxxx,
Date:        05/29/2014 08:35 PM
Subject:        [orion-dev] Fw: [flux-dev] Orion plugins questions
Sent by:        orion-dev-bounces@xxxxxxxxxxx




Forwarding this question from Flux project. Silenio or Bogdan do you have any thoughts on this. Is there a way for a plugin to post incoming changes back into the editor model?

John


----- Forwarded by John Arthorne/Ottawa/IBM on 05/29/2014 08:29 PM -----


From:        
Alex Boyko <aboyko@xxxxxxxxxxxxx>
To:        
flux-dev@xxxxxxxxxxx,
Date:        
05/29/2014 05:59 PM
Subject:        
[flux-dev] Orion plugins questions
Sent by:        
flux-dev-bounces@xxxxxxxxxxx




Hi all,


I'm trying to create an editor plugin for Orion that would allow live (collaborative) editing of a file in Orion. For example if multiple people changing the same file resource I'd like to see live changes in my editor. In other words I'd like to see changes in my editor not after someone saves the resource, but as someone types characters. Suppose i have a messaging server which receives and broadcasts changes to all clients editing the same resource.
Looks like i can create a plugin for Orion editor to transmit changes to the messaging server using "orion.edit.model" extension with onModelChanging event.
How can I sync back changes from others coming from the messaging server back to my Orion editor? Is this possible with a plugin?


Orion extension plugin that hooks to “orion.edit.model” onModelChanging event only has info about the event ni the editor: text added, number of chars added, number of lines added and same for chars removed. At best, some extensions get editor context object that can give a reference to the contents of the editor via a deferred. Is it possible to gather some additional information not available within the event such as current user, file opened in the editor (file path)? If it’s not available within the ModelChanging event perhaps it might be extracted from somewhere else?


Thanks in advance.


Cheers,

Alex
_______________________________________________
flux-dev mailing list
flux-dev@xxxxxxxxxxx

https://dev.eclipse.org/mailman/listinfo/flux-dev_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev


Back to the top