Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ease-dev] Feature request: clipboard support (or instead loading arbitrary classes by name for DIY)


On 20.11.2014 19:43, Paul D. Fernhout wrote:
[...] is there a way to import an arbitrary class into the JavaScript Rhino environment from a name (in this case, "org.eclipse.swt.dnd.Clipboard") so that I can access its fields or use a constructor on a class?


Yes, just use the full qualified name, eg
var myString = new java.lang.String("foo");


Although, even if that worked, it seems like the next hurdle I might run into is then creating an object array in EASE to pass into API calls.

See the Rhino FAQ: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino/FAQ

For your case

java.lang.reflect.Array.newInstance(java.lang.Object, 5);

works.

--
Christian


Back to the top