Package netscape.javascript

Examples of netscape.javascript.JSObject


    super(element, data, dataPath);

                                // fill the optionList value with the various
    optionList = new Vector()// OPTIONs that are a part of this SELECT tag.
    formOptions = (JSObject) element.getMember("options");
    JSObject option;
    int numOptions = NSFieldManager.intValue(formOptions.getMember("length"));
    for (int optIdx = 0;   optIdx < numOptions;   optIdx++)
      optionList.addElement(getOptionValue(formOptions, optIdx));

    if (variantValue != null) paint();
View Full Code Here


    return (String) optionList.elementAt(idx);
  }

  private static String getOptionValue(JSObject formOptions, int idx) {
    JSObject option = (JSObject) formOptions.getSlot(idx);
    String result = (String) option.getMember("value");
    if (result == null || result.trim().length() == 0) {
      result = (String) option.getMember("text");
      if (result != null) result = result.trim();
    }

    return result;
  }
View Full Code Here

        if (applicationHostApplet == null) {
            throw new IllegalArgumentException("No applet is hosting the given application.");
        }

        try {
            JSObject window = JSObject.getWindow(applicationHostApplet);
            return window.eval(script);
        } catch (Throwable throwable) {
            throw new UnsupportedOperationException(throwable);
        }
    }
View Full Code Here

        setWeight(weight);
    }

    // calls the setWeight(weight) JavaScript function on the current page
    private void setWeight(String weight) {
        JSObject win = JSObject.getWindow(this);
        String[] args = { weight };
        win.call("setWeight", args);
    }
View Full Code Here

     */
    JSObject getJSNamespace()
    {
        try
        {
            final JSObject window = JSObject.getWindow(this);
            final JSObject namespace = (JSObject) window.getMember("midi4js");
            return namespace;
        }
        catch (final Exception e)
        {
            System.err.println("Unable to get midi4js JavaScript " +
View Full Code Here

     *            Optional arguments.
     */
    void execJSMethod(final String methodName, final Object... arguments)
    {
        // Get the JavaScript midi4js namespace. Do nothing if not found.
        final JSObject namespace = getJSNamespace();
        if (namespace == null) return;

        try
        {
            namespace.call(methodName, arguments);
        }
        catch (final Exception e)
        {
            System.err.println("Unable to call method '" + methodName + "' " +
                "on midi4js namespace. Original exception: ");
View Full Code Here

     * Executed when all uploads are finished so if you want to do something
     * when all files are uplaoded you can do it in javascript (no data about
     * file uploads is passed !)
     */
    private void uploadProcessFinished() {
        JSObject jso = (JSObject) this.configHolder.getObject("global.jso");
        try {
            jso.call("JUP_eventhandler", new String[]{"uploadfinished"});
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

     * with this function we call javascript's "relocate" function, relocate
     * function accepts two parameter first is action which are "gofolder" or
     * "again" and second is "target folder id"
     */
    public void doAfterUploadProcess() {
        JSObject jso = (JSObject) this.configHolder.getObject("global.jso");
        try {
            jso.call("JUP_eventhandler", new String[]{"gofolder", targetID});
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

            e.printStackTrace();
        }
    }

    private void uploadAgain() {
        JSObject jso = (JSObject) this.configHolder.getObject("global.jso");
        try {
            jso.call("JUP_eventhandler", new String[]{"again", targetID});
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

    /**
     * Executed to indicate javascript event handler
     */
    private void raiseAppletDeniedEvent() {
        JSObject jso = (JSObject) this.configHolder.getObject("global.jso");
        try {
            jso.call("JUP_eventhandler", new String[]{"appletdenied"});
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

TOP

Related Classes of netscape.javascript.JSObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.