Package netscape.javascript

Examples of netscape.javascript.JSObject.call()


        if (n.isdir && !n.path.equals("/"))
          params2[0] = n.path+"/";
        win.call("add_file", params2);
        }
      String params3[] = { "" };
      win.call("finished", params3);
      }
    catch(Exception e) {
      e.printStackTrace();
      new ErrorWindow("Failed to set files : "+
          e.getMessage());
View Full Code Here


     * Sends the current text of the text field to JavaScript.
     */
    void sendToJavaScript()
    {
        JSObject win = JSObject.getWindow(this);
        win.call("textChanged", new Object[] { getText() });
    }

    /**
     * Sets the current text.
     *
 
View Full Code Here

    }
   
  public void print(String message) {
    JSObject window = JSObject.getWindow(this);
    Object[] args = { message };
    window.call("println", args);
    }
   
    public int getAppletCount() {
      return appletCount;
    }
View Full Code Here

      JSObject jsRoot = webWrapper.getJsRoot();
      JSObject window = (JSObject) jsRoot.getMember("window");
      String dataUri = "data:text/plain;charset=utf-8,"
          + URLEncoder.encode(text, "UTF-8").replace("+", "%20");
      Object[] params = new Object[] { dataUri, "_blank" };
      window.call("open", params);
    } else {
      JFileChooser fc = new JFileChooser();
      fc.setSelectedFile(new File(fileNameProposal));
      if (fc.showSaveDialog(webWrapper.getContainer()) == JFileChooser.APPROVE_OPTION) {
        File file = fc.getSelectedFile();
View Full Code Here

    }
  }

  public void executeJS(short[] pcmData) {
    JSObject j = JSObject.getWindow(this);
    j.call("passAudio", new Object[] {pcmData});
  }

  public class SamplingThread extends Thread {
    boolean running = false;
View Full Code Here

    else if (is_html_filename(f.path) && !force_text) {
      // Open HTML editor
      try {
        JSObject win = JSObject.getWindow(this);
        String params[] = { f.path, "" };
        win.call("htmledit", params);
        }
      catch(Exception e) {
        new ErrorWindow(text("html_efailed",
                 e.getMessage()));
        }
View Full Code Here

  else if (b == hnew_b) {
    // Open a window for creating an HTML file
    try {
      JSObject win = JSObject.getWindow(this);
      String params[] = { "", showing_files.path };
      win.call("htmledit", params);
      }
    catch(Exception e) {
      new ErrorWindow(text("html_efailed",
               e.getMessage()));
      }
View Full Code Here

  else if (b == upload_b) {
    // Call javascript to open an upload window
    try {
      JSObject win = JSObject.getWindow(this);
      String params[] = { showing_files.path };
      win.call("upload", params);
      }
    catch(Exception e) {
      new ErrorWindow(text("upload_efailed", e.getMessage()));
      }
    }
View Full Code Here

    else if (is_html_filename(f.path) && !force_text) {
      // Open HTML editor
      try {
        JSObject win = JSObject.getWindow(this);
        String params[] = { f.path, "" };
        win.call("htmledit", params);
        }
      catch(Exception e) {
        new ErrorWindow(text("html_efailed",
                 e.getMessage()));
        }
View Full Code Here

  else if (b == hnew_b) {
    // Open a window for creating an HTML file
    try {
      JSObject win = JSObject.getWindow(this);
      String params[] = { "", showing_files.path };
      win.call("htmledit", params);
      }
    catch(Exception e) {
      new ErrorWindow(text("html_efailed",
               e.getMessage()));
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.