I'm sorry, I've read everything I can and dug through the source code
and I still can't figure out what must be so simple to everyone else:
I'm using Eclipse Monkey to run scripts inside of Eclipse and while I
can access the various workbench classes using Packages, I cannot
access the classes in my own plug-in.

My eyes are blurry.  The best I can figure is that the classes from my
plug-in are not in the classpath for my scripts.  I'm sure the best
thing I can do is to simply create my own DOM.  It's not all that
difficult, I don't think, but I was hoping to avoid that little extra
step, especially for prototyping.  It was so cool to create things
like TitleDialogs and whatnot purely through the use of things like
Packages.org.eclipse.jface.dialogs.

I'm just going to post a few things I found, and maybe someone can
answer them.

1. I'm able to access nearly all the classes in the workbench (e.g.,
org.eclipse.jface.dialog.TitleDialog) using the Packages object but I
cannot access the classes in my own plug-in.  I've tried both running
the plug-in as an Eclipse Application and installing Script Monkey
into that workbench, as well as building a local site for the plug-in
and installing it into a workbench that also has Script Monkey.
Neither case lets me access the classes.  The quickest way I test this
is by trying to access a public static variable: var a =
Packages.com.pbd.em.DialogFactory.TITLE.  Variable a gets set to
"[Package com.pbd.em.DialogFactory.TITLE]".  I can't for the life of
me figure out how to access an arbitrary class in a JAR in another
plug-in.

2. I spent a lot of time poring through the source, and I can't figure
out exactly where in the source code the org. and java. classes get
loaded as top level objects.  Could someone tell me which source file
contains that particular code?  I thought I found it when I found
Context.initStandardObjects, but the more I read that the more
confused I became.  So, some insight into the initial load process for
the Rhino globals would be appreciated.

3. Finally, I've had no particular luck with either importClass or
importPackage in a script; it seems to me they really aren't intended
to be used in a script.  I create a TopLevelImporter, then execute the
importClass/importPackage on a class or package that I know I can
access using the Packages object, and it returns an undefined.  Seems
I probably don't understand how that works at all.  That's about the
time that things starting getting really blurry and I noticed a twitch
in my left eye so I thought I should finally ask for help.

Note that this is all running on Eclipse 3.2.2, and more specifically
WebSphere Development Studio Client, which itself is based on Rational
Application Developer.  Any help would be appreciated.  I'm going to
move on and try to create my own DOM, but I really would like to be
able to prototype before I have to actually build a plug-in.  How do I
expose arbitrary jars to Rhino (through Eclipse Monkey)?
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to