Package com.google.gwt.core.client

Examples of com.google.gwt.core.client.JavaScriptObject


   * This function delegates to the native method <code>replaceChild</code> in
   * XMLParserImpl.
   */
  public Node replaceChild(Node newChild, Node oldChild) {
    try {
      final JavaScriptObject newChildJs = ((DomItemXml) newChild).getJsObject();
      final JavaScriptObject oldChildJs = ((DomItemXml) oldChild).getJsObject();
      final JavaScriptObject replaceChildResults = XMLParserImpl.replaceChild(
          this.getJsObject(), newChildJs, oldChildJs);
      return NodeXml.build(replaceChildResults);
    } catch (JavaScriptException e) {
      throw new DOMNodeExceptionXml(DOMException.INVALID_MODIFICATION_ERR, e, this);
    }
View Full Code Here


    {
        // Processing instructions not in HTML DOM - but added for XML DOM
      // TODO: Note that Node is a GWT HTML DOM object so an exception may be raised
      // by appending the wrong node type!
      if (mode == WriteMode.XML) {
        JavaScriptObject pi = createProcessingInstruction(document, target, data.toString());
        addNode(pi, "processing-instruction");
     
    }
View Full Code Here

    public void comment(CharSequence chars) throws XPathException
    {
        // Added for XML compatibility
      if (mode == WriteMode.XML) {
        JavaScriptObject comment = createComment(document, chars.toString());
        addNode(comment, "comment");
      }
    }
View Full Code Here

          handleException(le, "onModuleLoad");
          return;
        } */
       
        // perform JavaScript callback or use <script> element to initate transform
        JavaScriptObject saxonceLoadCallback = getCallback();
        if (saxonceLoadCallback != null) {
          logger.log(Level.FINE, "Executing 'onSaxonceLoad' callback...");
          try {
          executeCallback(saxonceLoadCallback);
          } catch(JavaScriptException jse) {
View Full Code Here

              logger.info("Saxon-CE API initialised");
              return;
            } else if (styleURI == null)
              { throw new XPathException("No XSLT stylesheet reference found"); }

            JavaScriptObject sourceDoc = null;
            String absSourceURI = null;
            if (sourceURI != null && sourceURI.length() != 0) {
              String pageHref = Window.Location.getHref();
                absSourceURI = (new URI(pageHref).resolve(sourceURI)).toString();
                if (pageHref.equals(absSourceURI)) {
View Full Code Here

              registeredProcessorForNonDomEvents = true;
              Controller.addNonDomEventProcessor(this);
            }
            String eventName = eventMode.getModeName().getLocalName();
            for (Rule r : nonDomRules) {
              JavaScriptObject eventTarget = null;
              eventTarget = ((JSObjectPattern)r.getPattern()).evaluate(controller.newXPathContext());
              bindTemplateToWindowEvent(eventName, eventTarget);
            }
          }
         
View Full Code Here

    public static native String bindTemplateToWindowEvent(String eventName, JavaScriptObject target) /*-{
    target[eventName] = $entry(function(eventArg) {@client.net.sf.saxon.ce.Xslt20ProcessorImpl::relayNonDomEvent(Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;)(eventName, target, eventArg)});
  }-*/;
   
    public static void relayNonDomEvent(String name, JavaScriptObject obj, JavaScriptObject eventArg){
      JavaScriptObject event = (eventArg == null)? getWindowEvent(): eventArg;
      Controller.relayNonDomEvent(name, obj, event);
    }
View Full Code Here

   * @param errorType
   *            - The error type - can be any type used by GWT-Logging
   */
  public static void makeCallback(String message, String errorType,
      String milliseconds) {
    JavaScriptObject currentHandler = getErrorHandler();
    setErrorMessage(message);
    if (currentHandler == null && !isLogHandlerExternal())
      return;

    if (!callbackErrorReported) {
      boolean success = false;

      if (currentHandler != null) {
        JavaScriptObject evt = createEventObject(message, errorType,
            milliseconds);
        success = initCallback(currentHandler, evt);
        logAnyCallbackError(success, "JS");
      }

View Full Code Here

    }
    return (JavaScriptObject) o;
  }

  private JavaScriptObject getWrapper(Object type) {
    JavaScriptObject wrapper = null;
    if (!GWT.isScript()) {
      wrapper = wrapperMap.get(type);
    } else {
      wrapper = getWrapperJS(type, WRAPPER_PROPERTY);
    }
View Full Code Here

  public JavaScriptObject setWrapper(Object type) {
    if (type.getClass().isArray()) {
      return JavaScriptObject.createArray();
    }
    JavaScriptObject cons = typeConstructor(type);
    assert cons != null : "No constructor for type: " + type.getClass().getName() + " " + type.getClass().getSuperclass();
    JavaScriptObject wrapper = wrap0(type, cons);
    setWrapper(type, wrapper);
    return wrapper;
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.core.client.JavaScriptObject

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.