@Override public Object function (Object[] arguments) { if (arguments[0] instanceof String) { String string = (String)arguments[0]; if (string.startsWith (ERROR_ID)) { String errorString = ExtractError (string); if (errorString.length () > 0) { evaluateResult = new SWTException (SWT.ERROR_FAILED_EVALUATE, errorString); } else { evaluateResult = new SWTException (SWT.ERROR_FAILED_EVALUATE); } return null; } } evaluateResult = arguments[0]; return null; } }
static void SetPendingCookies (List<String[]> pendingCookies) { for (String[] current : pendingCookies) { SetCookie (current[0], current[1], false); } }
} catch (Exception e) { returnValue = WebBrowser.CreateErrorString (e.getLocalizedMessage ()); function.function (new String[] {WebBrowser.CreateErrorString (new SWTException (SWT.ERROR_INVALID_RETURN_VALUE).getLocalizedMessage ())}); returnValue = WebBrowser.CreateErrorString (e.getLocalizedMessage ());
/** * Returns the value of a cookie that is associated with a URL. * Note that cookies are shared amongst all Browser instances. * * @param name the cookie name * @param url the URL that the cookie is associated with * @return the cookie value, or <code>null</code> if no such cookie exists * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the name is null</li> * <li>ERROR_NULL_ARGUMENT - if the url is null</li> * </ul> * * @since 3.5 */ public static String getCookie (String name, String url) { if (name == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); if (url == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); return WebBrowser.GetCookie (name, url); }
/** * Adds the listener to the collection of listeners who will be * notified when a progress is made during the loading of the current * URL or when the loading of the current URL has been completed. * * @param listener the listener which should be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li> * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li> * </ul> * * @since 3.0 */ public void addProgressListener (ProgressListener listener) { checkWidget(); if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); webBrowser.addProgressListener (listener); }
/** * Adds the listener to the collection of listeners who will be * notified when the status text is changed. * <p> * The status text is typically displayed in the status bar of * a browser application. * </p> * * @param listener the listener which should be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li> * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li> * </ul> * * @since 3.0 */ public void addStatusTextListener (StatusTextListener listener) { checkWidget(); if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); webBrowser.addStatusTextListener (listener); }
/** * Adds the listener to the collection of listeners who will be * notified when authentication is required. * <p> * This notification occurs when a page requiring authentication is * encountered. * </p> * * @param listener the listener which should be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li> * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li> * </ul> * * @since 3.5 */ public void addAuthenticationListener (AuthenticationListener listener) { checkWidget(); if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); webBrowser.addAuthenticationListener (listener); }
/** * Adds the listener to the collection of listeners who will be * notified when the window hosting the receiver should be closed. * <p> * This notification occurs when a javascript command such as * <code>window.close</code> gets executed by a <code>Browser</code>. * </p> * * @param listener the listener which should be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li> * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li> * </ul> * * @since 3.0 */ public void addCloseWindowListener (CloseWindowListener listener) { checkWidget(); if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); webBrowser.addCloseWindowListener (listener); }
/** * Adds the listener to the collection of listeners who will be * notified when the current location has changed or is about to change. * <p> * This notification typically occurs when the application navigates * to a new location with {@link #setUrl(String)} or when the user * activates a hyperlink. * </p> * * @param listener the listener which should be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li> * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li> * </ul> * * @since 3.0 */ public void addLocationListener (LocationListener listener) { checkWidget(); if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); webBrowser.addLocationListener (listener); }
/** * Adds the listener to the collection of listeners who will be * notified when a new window needs to be created. * <p> * This notification occurs when a javascript command such as * <code>window.open</code> gets executed by a <code>Browser</code>. * </p> * * @param listener the listener which should be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li> * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li> * </ul> * * @since 3.0 */ public void addOpenWindowListener (OpenWindowListener listener) { checkWidget(); if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); webBrowser.addOpenWindowListener (listener); }
} catch (Exception e) { returnValue = WebBrowser.CreateErrorString (e.getLocalizedMessage ()); function.function (new String[] {WebBrowser.CreateErrorString (new SWTException (SWT.ERROR_INVALID_RETURN_VALUE).getLocalizedMessage ())}); returnValue = WebBrowser.CreateErrorString (e.getLocalizedMessage ());
/** * Returns the value of a cookie that is associated with a URL. * Note that cookies are shared amongst all Browser instances. * * @param name the cookie name * @param url the URL that the cookie is associated with * @return the cookie value, or <code>null</code> if no such cookie exists * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the name is null</li> * <li>ERROR_NULL_ARGUMENT - if the url is null</li> * </ul> * * @since 3.5 */ public static String getCookie (String name, String url) { if (name == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); if (url == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); return WebBrowser.GetCookie (name, url); }
/** * Adds the listener to the collection of listeners who will be * notified when a progress is made during the loading of the current * URL or when the loading of the current URL has been completed. * * @param listener the listener which should be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li> * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li> * </ul> * * @since 3.0 */ public void addProgressListener (ProgressListener listener) { checkWidget(); if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); webBrowser.addProgressListener (listener); }
/** * Adds the listener to the collection of listeners who will be * notified when the status text is changed. * <p> * The status text is typically displayed in the status bar of * a browser application. * </p> * * @param listener the listener which should be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li> * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li> * </ul> * * @since 3.0 */ public void addStatusTextListener (StatusTextListener listener) { checkWidget(); if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); webBrowser.addStatusTextListener (listener); }
/** * Adds the listener to the collection of listeners who will be * notified when authentication is required. * <p> * This notification occurs when a page requiring authentication is * encountered. * </p> * * @param listener the listener which should be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li> * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li> * </ul> * * @since 3.5 */ public void addAuthenticationListener (AuthenticationListener listener) { checkWidget(); if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); webBrowser.addAuthenticationListener (listener); }
/** * Adds the listener to the collection of listeners who will be * notified when the window hosting the receiver should be closed. * <p> * This notification occurs when a javascript command such as * <code>window.close</code> gets executed by a <code>Browser</code>. * </p> * * @param listener the listener which should be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li> * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li> * </ul> * * @since 3.0 */ public void addCloseWindowListener (CloseWindowListener listener) { checkWidget(); if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); webBrowser.addCloseWindowListener (listener); }
/** * Adds the listener to the collection of listeners who will be * notified when the current location has changed or is about to change. * <p> * This notification typically occurs when the application navigates * to a new location with {@link #setUrl(String)} or when the user * activates a hyperlink. * </p> * * @param listener the listener which should be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li> * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li> * </ul> * * @since 3.0 */ public void addLocationListener (LocationListener listener) { checkWidget(); if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); webBrowser.addLocationListener (listener); }
/** * Adds the listener to the collection of listeners who will be * notified when a new window needs to be created. * <p> * This notification occurs when a javascript command such as * <code>window.open</code> gets executed by a <code>Browser</code>. * </p> * * @param listener the listener which should be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * * @exception SWTException <ul> * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li> * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li> * </ul> * * @since 3.0 */ public void addOpenWindowListener (OpenWindowListener listener) { checkWidget(); if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); webBrowser.addOpenWindowListener (listener); }
} catch (Exception e) { returnValue = WebBrowser.CreateErrorString (e.getLocalizedMessage ()); function.function (new String[] {WebBrowser.CreateErrorString (new SWTException (SWT.ERROR_INVALID_RETURN_VALUE).getLocalizedMessage ())}); returnValue = WebBrowser.CreateErrorString (e.getLocalizedMessage ());
static void SetPendingCookies (List<String[]> pendingCookies) { for (String[] current : pendingCookies) { SetCookie (current[0], current[1], false); } }