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)

Thank you. BTW, I did write a JavaScript script to try to put text in the clipboard and to be called from a context menu, but I got an NPE when running it when the script tried to create a Display with executeUI using this line of code (as pretty much the first thing it does):

   var display = new org.eclipse.swt.widgets.Display();

When I tried that code without executeUI, or from the Rhino shell, I got a "An internal error occurred during: "Rhino". Not implemented [multiple displays]", and then the workbench recommended a restart. I have three displays on my development machine (Mac OS X) and so maybe there is some issue there...

I think your recent changes will be good enough for me for now. However, I've included the NPE trace from running the above code on the UI thread if it is of interest:

java.lang.NullPointerException
	at org.eclipse.ease.lang.javascript.rhino.RhinoScriptEngine.execute(RhinoScriptEngine.java:162)
	at org.eclipse.ease.AbstractScriptEngine.inject(AbstractScriptEngine.java:182)
	at org.eclipse.ease.AbstractScriptEngine.internalInject(AbstractScriptEngine.java:140)
	at org.eclipse.ease.AbstractScriptEngine.injectUI(AbstractScriptEngine.java:131)
	at org.eclipse.ease.modules.platform.UIModule.executeUI(UIModule.java:50)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
	at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
	at org.mozilla.javascript.gen.unnamed_script_19._c_executeUI_9(Unknown Source)
	at org.mozilla.javascript.gen.unnamed_script_19.call(Unknown Source)
	at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
	at org.mozilla.javascript.gen._experiments_scripting_active_hello_word_into_clipboard_js_18._c_script_0(Unknown Source)
	at org.mozilla.javascript.gen._experiments_scripting_active_hello_word_into_clipboard_js_18.call(Unknown Source)
	at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
	at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
	at org.mozilla.javascript.gen._experiments_scripting_active_hello_word_into_clipboard_js_18.call(Unknown Source)
	at org.mozilla.javascript.gen._experiments_scripting_active_hello_word_into_clipboard_js_18.exec(Unknown Source)
	at org.mozilla.javascript.Context.evaluateReader(Context.java:1110)
	at org.eclipse.ease.lang.javascript.rhino.RhinoScriptEngine.internalExecute(RhinoScriptEngine.java:188)
	at org.eclipse.ease.lang.javascript.rhino.RhinoScriptEngine.execute(RhinoScriptEngine.java:169)
	at org.eclipse.ease.AbstractScriptEngine.inject(AbstractScriptEngine.java:182)
	at org.eclipse.ease.AbstractScriptEngine.run(AbstractScriptEngine.java:229)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

--Paul Fernhout
http://www.pdfernhout.net/
====
The biggest challenge of the 21st century is the irony of technologies of abundance in the hands of those still thinking in terms of scarcity. 

On 11/20/14 3:11 PM, Christian Pontesegger wrote:
> 
> On 20.11.2014 20:17, Paul D. Fernhout wrote:
>> It still might be useful to have a convenience method in the UI module 
>> to put text in the clipboard (or retrieve it), but it looks like it 
>> should not be too hard to do this just with pure JavaScript code.
> 
> Your wish is my command. Implemented getClipboard() / setClipboard() in 
> UI module. You know, available with the next nightly build...
> 
> Please use the bugtracker for future feature requests. And keep 'em 
> coming :)
> 
> -- 
> Christian
> _______________________________________________
> ease-dev mailing list
> ease-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe 
> from this list, visit
> https://dev.eclipse.org/mailman/listinfo/ease-dev
> 
> 


Back to the top