Is it me or does application.showURL() not work (anymore?) in the debug client.
When I use it in the debug (smart) client it returns false and I hear a system beep.
I am using Servoy 5.2.1
ROCLASI wrote:Is it me or does application.showURL() not work (anymore?) in the debug client.
When I use it in the debug (smart) client it returns false and I hear a system beep.
I am using Servoy 5.2.1
2010-08-31 13:25:18,656 ERROR [AWT-EventQueue-0] com.servoy.j2db.util.Debug - Throwable
java.io.IOException: java.lang.ClassNotFoundException: com.apple.mrj.MRJFileUtils
at com.servoy.j2db.util.BrowserLauncher.openURL(BrowserLauncher.java:60)
at com.servoy.j2db.smart.J2DBClient.showURL(J2DBClient.java:3938)
at com.servoy.j2db.scripting.JSApplication.js_showURL(JSApplication.java:1425)
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:179)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:353)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3666)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2680)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:166)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3127)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:165)
at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:458)
at com.servoy.j2db.debug.RemoteDebugScriptEngine.executeFunction(RemoteDebugScriptEngine.java:382)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3970)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3858)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3780)
at com.servoy.j2db.FormController$ScriptExecuter.executeFunction(FormController.java:3635)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:270)
at com.servoy.j2db.ui.BaseEventExecutor.fireActionCommand(BaseEventExecutor.java:217)
at com.servoy.j2db.smart.dataui.AbstractScriptLabel$5.mouseReleased(AbstractScriptLabel.java:1023)
at java.awt.Component.processMouseEvent(Component.java:6348)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6113)
at java.awt.Container.processEvent(Container.java:2085)
at java.awt.Component.dispatchEventImpl(Component.java:4714)
at java.awt.Container.dispatchEventImpl(Container.java:2143)
at java.awt.Component.dispatchEvent(Component.java:4544)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4618)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4282)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)
at java.awt.Container.dispatchEventImpl(Container.java:2129)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4544)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
function openFileWithDefaultViewer(file) {
// TODO: Support opening in the WC: either plugins.file.writeFile, but required to read the content first or showUrl, if file is accessible from the outside (see deprecated globals.svy_utl_open_file())
// TODO: test Linux support: SampleCode suggests using xdg-open here: https://www.servoy.com/forum/viewtopic.php?f=15&t=15237&p=81646&hilit=application+getosname+and+linux#p81653
// TODO param {String} [mimeType] Required for usage in the Web Client. Used by the browser to determine how to open the file
if (!scopes.svySystem.isSwingClient()) {
throw new scopes.svyExceptions.UnsupportedOperationException('Operation only supported in Smart or Runtime Client');
}
var osName = application.getOSName();
/** @type {String} */
var filePath = file;
if (file instanceof plugins.file.JSFile) {
filePath = file.getAbsolutePath();
}
if (/Windows/.test(osName)) {
application.executeProgram('rundll32', ['url.dll,FileProtocolHandler', filePath]);
} else if (/Linux|Freebsd/.test(osName)) {
application.executeProgram('mozilla', [filePath]);
} else if (/Mac/.test(osName)) {
application.executeProgram('open', [filePath]);
}
// What if no match?
}
Return to Programming with Servoy
Users browsing this forum: No registered users and 1 guest