Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orion-dev] Plugin -> editor actions

On 7/6/2011 3:17 PM, Simon Kaegi wrote:

The plugin model does not permit a plugin from directly calling anything in the main window but there is indeed an event mechanism that we can use where the event listener residing in the main page could call a particular function based on the service. What we need is for the editor page to register interest in a service that your plugin provides and in addition listens to the service for events. So, for example if we had something like a "content.updater" service that edit.html was aware of and listened to for events then your plugin could register the service and fire content updated event and we could react to the event and update the content.

Ok I was able to sort this out.

In the editor I get my plugin:
var modelListeners = serviceRegistry.getServiceReferences("orion.edit.listener");

Then I wire it to the editor events (Orion -> Firebug as before). And at the same time I add:
  listener.addEventListener("content.update", contentUpdater);

In my plugin I issue
    this.serviceProvider.dispatchEvent('content.update', event);
where this.serviceProvider is the return value from registerServiceProvider and event ultimately gets delivered to the handler contentUpdater.

So this wires Firebug -> Orion...if I can just send it the correct data...

jjb

-Simon

(p.s. John have to split now but will be on again in a bit if you want to ping me on IRC or IM)

Inactive hide details for "John J. Barton"
          ---07/06/2011 05:44:01 PM---I have my Firebug to Orion sending
          edit updates to Fireb"John J. Barton" ---07/06/2011 05:44:01 PM---I have my Firebug to Orion sending edit updates to Firebug. Now I am working on Firebug sending edi


From:

"John J. Barton" <johnjbarton@xxxxxxxxxxxxxxx>

To:

Orion developer discussions <orion-dev@xxxxxxxxxxx>

Date:

07/06/2011 05:44 PM

Subject:

[orion-dev] Plugin -> editor actions

Sent by:

orion-dev-bounces@xxxxxxxxxxx





I have my Firebug to Orion sending edit updates to Firebug. Now I am
working on Firebug sending edit updates to Orion. What is the
recommended way for a plugin to send an event to the editor that will
call a function in the edit window?

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




Back to the top