Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [che-dev] [Che][Orion]What is the best way to get the Orion editor object?

Hi Artem,
 Thank you for the info. Seems like I'm on the right path.

Thanks,
Randika

On Mon, May 23, 2016 at 2:52 PM, Artem Zatsarynnyi <azatsarynnyy@xxxxxxxxxxx> wrote:
Hi, Randika.

You shouldn't use embedded Orion editor directly. Try to use Che Editor API like this:

1. Get an active editor and make sure if it's really an instance of the text editor:

EditorPartPresenter activeEditor = editorAgent.getActiveEditor();
if (activeEditor instanceof TextEditorPresenter) {
   TextEditorPresenter textEditor = (TextEditorPresenter)activeEditor;
   ...
}


2. Get text range that you're interested in:

final TextPosition from = textEditor.getDocument().getPositionFromIndex(50);
final TextPosition to = textEditor.getDocument().getPositionFromIndex(60);
final TextRange textRange = new TextRange(from, to);

3. Finally add a marker for the text range:

textEditor.getHasTextMarkers().addMarker(textRange, resources.getCss().markerStyle());

Hope that my advice will help you to solve your problem.

On Mon, May 23, 2016 at 11:31 AM, Randika Navagamuwa <randika.12@xxxxxxxxxxxxx> wrote:
Hi all,
 Yes that's what I wanted to know. I tried @AssistedInject here but couldn't do it without getting compilation errors on superdev.


Thanks,

On Mon, May 23, 2016 at 12:18 AM, Sun Tan <sun.tan@xxxxxxxxx> wrote:
Randika is looking for a way to get or inject the OrionEditorWidget, from there, he would use addMarker or something similar
How can he inject or get the orioneditorwidget of an active or open editor from his extension ?

Le dim. 22 mai 2016 à 16:58, Tyler Jewell <tyler@xxxxxxxxxxx> a écrit :
The model overaly is returned by the Editor Widget, which is what is used by the rest of the product.  So, making improvements to the core OrionAnnotationModelOverlay, then the overall EditorWidget will get those improvements.


Tyler Jewell | CEO | tyler@​codenvy.​com | 9​78​.8​84​.53​55


On Fri, May 20, 2016 at 11:14 PM, Randika Navagamuwa <randika.12@xxxxxxxxxxxxx> wrote:
Hi vitalli,
  To get the OrionAnnotationModelOverlay we need OrionEditorOveral right? I'm still stuck at that point. Can't figure out a way to get that?

Thanks,

On Sat, May 21, 2016 at 2:05 AM, Vitalii Parfonov <vparfonov@xxxxxxxxxxx> wrote:
Hello, Randika.
Ok, so lets try to help you.
1. About Orion JS Annotation Model in Che you can start look here.
2. When we need to change original Orion JS we use patch maybe not best way but it work for us (examples of patches, applying with maven build here

Hope it help you. Any way ask again if need help. 





Vitaly Parfonov -- codenvy

On Fri, May 20, 2016 at 8:25 PM, Randika Navagamuwa <randika.12@xxxxxxxxxxxxx> wrote:
Hi Vitalii and Stevan,
  Yes that's exactly what I want to do Stevan. I was thinking about injecting the editor so I can add the annotation to that active editor. I have found some classes such as EditorAgent to get the active editor and used it in my extension. But I can't find a way to add the custom annotations to the editor.

Thanks,

On Fri, May 20, 2016 at 10:47 PM, Stevan Le Meur <slemeur@xxxxxxxxxxx> wrote:
Hi Vitalii,

Yes, that's exactly what Randika did.
He has been able to customize a standalone Orion Editor and add some custom annotations for it, you can see them here: http://rnavagamuwa.github.io/orion-editor/ 

Now his question is really, how he can apply the same changes and custom annotations to the Orion Editor that is embedded inside of Che. He is looking for a potential method which allow to get the embedded Orion Editor object. 

Thanks

On Fri, May 20, 2016 at 6:42 PM, Vitalii Parfonov <vparfonov@xxxxxxxxxxx> wrote:
Hi, Randika. If i understand correctly you modified Orion Editor in some way and want to see this changes in Eclipse Editor?  

Vitaly Parfonov -- codenvy

On Mon, May 16, 2016 at 2:40 PM, Randika Navagamuwa <randika.12@xxxxxxxxxxxxx> wrote:
Hi all,
 I am involved in a GSoC project[1] which is related to Embedded Orion Editor of Eclipse Che. I need to add some annotations to the Orion editor which is embedded inside CHE. I have already added them to the standalone Orion editor[2] and now I need to add them to the embedded editor. But I can't find a method to get the editor object. What will be the best way to get the Editor object and update that?


Thanks and regards,
Randika
--
Best Regards
Randika Navagamuwa,
Department of Computer Science & Engineering,
University of Moratuwa,
Sri Lanka.

_______________________________________________
che-dev mailing list
che-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/che-dev



_______________________________________________
che-dev mailing list
che-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/che-dev




--

Stévan Le Meur | Product Manager | stevan@​codenvy.​com +33​.6.​8​7.​1​1.​2​7.​5​5​


_______________________________________________
che-dev mailing list
che-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/che-dev




--
Regards
Randika Navagamuwa,
Department of Computer Science & Engineering,
University of Moratuwa,
Sri Lanka.

_______________________________________________
che-dev mailing list
che-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/che-dev



_______________________________________________
che-dev mailing list
che-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/che-dev




--
Regards
Randika Navagamuwa,
Department of Computer Science & Engineering,
University of Moratuwa,
Sri Lanka.

_______________________________________________
che-dev mailing list
che-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/che-dev


_______________________________________________
che-dev mailing list
che-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/che-dev
--


-- 

Sun Seng David TAN
Senior Java Developer
Eclipse Che commiter


Mobile : +33 21 02 41 73

Email : sun.tan@xxxxxxxxx

Site Web : www.serli.com


Suivez-nous sur Twitter : @SerliFr @sunsengdavidtan et Facebook : SerliFr  


_______________________________________________
che-dev mailing list
che-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/che-dev




--
Regards
Randika Navagamuwa,
Department of Computer Science & Engineering,
University of Moratuwa,
Sri Lanka.

_______________________________________________
che-dev mailing list
che-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/che-dev




--

Artem Zatsarynnyi | Software Engineer | azatsarynnyy@​codenvy.​com


_______________________________________________
che-dev mailing list
che-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/che-dev




--
Regards
Randika Navagamuwa,
Department of Computer Science & Engineering,
University of Moratuwa,
Sri Lanka.

Back to the top