Package com.google.gwt.core.client

Examples of com.google.gwt.core.client.JavaScriptObject.cast()


    {
        JavaScriptObject xrfm = getArray(Attribute.TRANSFORM.getProperty());

        if (null != xrfm)
        {
            TransformJSO pjso = xrfm.cast();

            return new Transform(pjso);
        }
        return null;
    }
View Full Code Here


    {
        JavaScriptObject shadow = getObject(Attribute.SHADOW.getProperty());

        if (null != shadow)
        {
            ShadowJSO sjso = shadow.cast();

            return new Shadow(sjso);
        }
        return null;
    }
View Full Code Here

    {
        JavaScriptObject bounds = getObject(Attribute.DRAG_BOUNDS.getProperty());

        if (null != bounds)
        {
            DragBoundsJSO djso = bounds.cast();

            return new DragBounds(djso);
        }
        return null;
    }
View Full Code Here

    {
        JavaScriptObject offset = getObject(name);

        if (null != offset)
        {
            Point2DJSO pjso = offset.cast();

            return new Point2D(pjso);
        }
        return null;
    }
View Full Code Here

            {
                JavaScriptObject grad = attr.getObject(Attribute.FILL.getProperty());

                if (null != grad)
                {
                    GradientJSO base = grad.cast();

                    if (LinearGradient.TYPE.equals(base.getType()))
                    {
                        context.setFillGradient(new LinearGradient((LinearGradientJSO) base));
View Full Code Here

      if (relatedTargetJSO == null) {
         return null;
      }

      return relatedTargetJSO.cast();
   }

   @PatchMethod
   static int eventGetScreenX(Object domImpl, NativeEvent evt) {
      return JavaScriptObjects.getInteger(evt, JsoProperties.EVENT_MOUSE_SCREENX);
View Full Code Here

            // cloning
         } else if (JsoProperties.NODE_OWNER_DOCUMENT.equals(entry.getKey())) {
            JavaScriptObjects.setProperty(newJso, JsoProperties.NODE_OWNER_DOCUMENT,
                     JavaScriptObjects.getObject(oldJso, JsoProperties.NODE_OWNER_DOCUMENT));
         } else if (GwtStyleUtils.STYLE_OBJECT_FIELD.equals(entry.getKey())) {
            Style newStyle = GwtStyleUtils.getStyle(newJso.<Element> cast());
            GwtStyleUtils.cloneStyle(newStyle, (Style) entry.getValue());
         } else if (NODE_LIST_FIELD.equals(entry.getKey())) {
            Node newNode = newJso.cast();
            Node oldNode = oldJso.cast();
            cloneChildNodes(newNode, oldNode, deep);
View Full Code Here

                     JavaScriptObjects.getObject(oldJso, JsoProperties.NODE_OWNER_DOCUMENT));
         } else if (GwtStyleUtils.STYLE_OBJECT_FIELD.equals(entry.getKey())) {
            Style newStyle = GwtStyleUtils.getStyle(newJso.<Element> cast());
            GwtStyleUtils.cloneStyle(newStyle, (Style) entry.getValue());
         } else if (NODE_LIST_FIELD.equals(entry.getKey())) {
            Node newNode = newJso.cast();
            Node oldNode = oldJso.cast();
            cloneChildNodes(newNode, oldNode, deep);
         } else if (ELEM_PROPERTIES.equals(entry.getKey())) {
            PropertyContainer newPc = getDomProperties(newJso.<Element> cast());
            PropertyContainer oldPc = getDomProperties(oldJso.<Element> cast());
View Full Code Here

         } else if (NODE_LIST_FIELD.equals(entry.getKey())) {
            Node newNode = newJso.cast();
            Node oldNode = oldJso.cast();
            cloneChildNodes(newNode, oldNode, deep);
         } else if (ELEM_PROPERTIES.equals(entry.getKey())) {
            PropertyContainer newPc = getDomProperties(newJso.<Element> cast());
            PropertyContainer oldPc = getDomProperties(oldJso.<Element> cast());

            for (Map.Entry<String, Object> entry2 : oldPc.entrySet()) {
               newPc.put(entry2.getKey(), entry2.getValue());
            }
View Full Code Here

      // SimpleJS.getString() native method by default will try to get "string" property in
      // gwt-test-utils's related PropertyContainer
      JavaScriptObjects.setProperty(jso, "string", "my string for testing");

      // Act
      SimpleJS simpleJs = jso.cast();

      // Assert
      assertThat(simpleJs.getString()).isEqualTo("my string for testing");
   }
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.