pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gkbr...@mac.com>
Subject Pivot/DOM interaction
Date Sun, 15 Mar 2009 17:00:54 GMT
Hi Noel,

Sorry for the delay in responding to your message - it was posted to the user mailing list
before we had subscribed.  :-)

> A couple of topics I find interesting:
> Topic #1: How might Pivot manipulate the DOM for the page on which it sits?

This can be done via LiveConnect, which is a feature of the Java plugin. Prior to J6u10, it
wasn't universally supported, but now is. 

We had previously exposed LiveConnect via a static eval() method in the pivot.wtk.BrowserApplicationContext
class, but this was problematic because only one applet instance could set the static member
that provided access to LiveConnect. As a result, all applets from the same origin would appear
to be running within the same page. Since this isn't necessarily true, behavior would be ambiguous,
and we removed the feature.

However, I can think of a couple workarounds:

1) Pass some reference to LiveConnect directly to the application (non-static). For example,
we could add a non-static, abstract eval() method to ApplicationContext and pass the application
context to the application. However, this would be a no-op for DesktopApplicationContext,
which could be confusing. 

A better approach along these lines might be to pass a "page context" object to the application.
DesktopApplicationContext could pass null, and BrowserApplicationContext could pass an inner
class instance that delegated to the applet itself. If the page context is null, it would
be clear that the application is not running in a browser and doesn't have access to the DOM.

2) Revert to the static approach and require the applet to set the separate_jvm parameter
to true. This parameter requires J6u10, but since LiveConnect isn't reliably supported in
prior releases anyways, it is arguably OK. This way, there would be no ambiguity about which
page the application is running in.

Thoughts?

> Topic #2: How might Pivot respond to JavaScript events on its page?

I think Todd did some prototyping in this area - Todd, can you comment on this one?

Greg



Mime
View raw message