Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orion-dev] Orion Firebug integration

Hi John,

I see that you are adding a listener directly to the model (model.addListener(this)). I don't know your code (so maybe it doesn't matter), but probably you want to use textview.addEventListener("ModelChanging", context, func, data).
The difference is that the textview is a listener of the model and using textview.addEventListener() makes sure the textview is the last listener of the model to run. If your listener is doing something that changes how the view display the content (like syntax highlighter) then you definitely want to use textview.addEventListener instead of of model.addListener.

Felipe





From: John J Barton <johnjbarton@xxxxxxxxxxxxxxx>
To: Boris Bokowski/Ottawa/IBM@IBMCA
Cc: Orion developer discussions <orion-dev@xxxxxxxxxxx>
Date: 06/10/2011 08:35 PM
Subject: Re: [orion-dev] Orion Firebug integration
Sent by: orion-dev-bounces@xxxxxxxxxxx





Boris Bokowski wrote:
>
>
> You mentioned notifications about changes to the editor buffer, what
> else do you need from the Orion editor?
>
I made progress on understanding the Orion plugin model.

One very cool thing is that you can simply create an Orion project for
your plugin and install the dev version (or so it seems).

So for example I have my plugin at:
http://localhost:8080/edit/edit.html#/file/h/content/orionPlugin/firebugConnection.html
then I can install
http://localhost:8080/file/h/content/orionPlugin/firebugConnection.html

The plugin registration code needs to run when the html file loads
(onload event). Makes sense. The plugin is loaded in an iframe
immediately below the top level, so your implementation objects need to
be in that scope. I've previously worked out how to connect to Firebug,
so I can connect the plugin to orion and the plugin to firebug.

But now I'm stuck. I need to implement
       // eclipse.TextModel listener
       onChanged: function(start, removedCharCount, addedCharCount,
removedLineCount, addedLineCount)
     
then listen to the editor model:
           this.model = editorContainer.getEditorWidget().getModel();
           this.model.addListener(this);

But I don't have editorContainer, it's in another window. (In the
embedded case I was injecting my code in the same window as the editor.)

Any hints?

jjb




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



Back to the top