Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.AbstractImagePrototype$ImagePrototypeElement


    private static Images              images          = (Images) GWT.create( Images.class );
    private static final String        HTML_ERROR_ICON = makeImage( images.error() );
    private static final String        HTML_INFO_ICON  = makeImage( images.information() );

    private static String makeImage(ImageResource resource) {
        AbstractImagePrototype prototype = AbstractImagePrototype.create( resource );
        return prototype.getHTML();
    }
View Full Code Here


    // Get the HTML for the image.
    SafeHtml image;
    if (isPlaceholder) {
      image = SafeHtmlUtils.fromTrustedString("<div></div>");
    } else {
      AbstractImagePrototype proto = AbstractImagePrototype.create(res);
      image = SafeHtmlUtils.fromTrustedString(proto.getHTML());
    }

    // Create the wrapper based on the vertical alignment.
    if (HasVerticalAlignment.ALIGN_TOP == valign) {
      return template.imageWrapperTop(direction, image);
View Full Code Here

   * @param res the {@link ImageResource} to render as HTML
   * @return the rendered HTML
   */
  private SafeHtml getImageHtml(ImageResource res) {
    // Right-justify image if LTR, left-justify if RTL
    AbstractImagePrototype proto = AbstractImagePrototype.create(res);
    SafeHtml image = SafeHtmlUtils.fromTrustedString(proto.getHTML());
    return template.imageWrapper((LocaleInfo.getCurrentLocale().isRTL()
        ? "left" : "right"), res.getWidth(), res.getHeight(), image);
  }
View Full Code Here

      direction = "right";
    } else {
      direction = "left";
    }

    AbstractImagePrototype proto = AbstractImagePrototype.create(res);
    SafeHtml image = SafeHtmlUtils.fromTrustedString(proto.getHTML());
    return TREE_IMPL.imageWrapper(classesBuilder.toString(), direction,
        res.getWidth(), res.getHeight(), image);
  }
View Full Code Here

      cssBuilder.appendTrustedString("left: 0px;");
    }
    cssBuilder.appendTrustedString("width: " + res.getWidth() + "px;");
    cssBuilder.appendTrustedString("height: " + res.getHeight() + "px;");

    AbstractImagePrototype proto = AbstractImagePrototype.create(res);
    SafeHtml image = SafeHtmlUtils.fromTrustedString(proto.getHTML());
    return template
        .imageWrapper(classesBuilder.toString(), cssBuilder.toSafeStyles(), image);
  }
View Full Code Here

  @Override
  protected void onRender(Element target, int index) {
    super.onRender(target, index);

    AbstractImagePrototype icon = null;
    for (RangeItem item : rangeItems) {
      NumberField field = new NumberField() {
        @Override
        protected void onKeyUp(FieldEvent fe) {
          super.onKeyUp(fe);
View Full Code Here

    }
    return joint;
  }

  protected AbstractImagePrototype calculateIconStyle(M model) {
    AbstractImagePrototype style = null;
    if (iconProvider != null) {
      AbstractImagePrototype iconStyle = iconProvider.getIcon((M) model);
      if (iconStyle != null) {
        return iconStyle;
      }
    }
    TreeNode node = findNode(model);
View Full Code Here

  }

  protected void refresh(M model) {
    TreeNode node = findNode(model);
    if (rendered && viewReady && node != null) {
      AbstractImagePrototype style = calculateIconStyle(model);
      treeGridView.onIconStyleChange(node, style);
      Joint j = calcualteJoint(model);
      treeGridView.onJointChange(node, j);
    }
  }
View Full Code Here

    assert grid instanceof TreeGrid : "TreeGridCellRenderer can only be used in a TreeGrid";

    TreeGrid tree = (TreeGrid) grid;
    TreeStore ts = tree.getTreeStore();
    Joint j = tree.calcualteJoint(model);
    AbstractImagePrototype iconStyle = tree.calculateIconStyle(model);
    int level = ts.getDepth(model);

    String text = String.valueOf(model.get(property));
    String id = tree.findNode(model).id;
    return tree.getTreeView().getWidgetTemplate(model, id, text, iconStyle, false, j, level - 1);
View Full Code Here

    assert grid instanceof TreeGrid : "TreeGridCellRenderer can only be used in a TreeGrid";
   
    TreeGrid tree = (TreeGrid) grid;
    TreeStore ts = tree.getTreeStore();
    Joint j = tree.calcualteJoint(model);
    AbstractImagePrototype iconStyle = tree.calculateIconStyle(model);
    int level = ts.getDepth(model);

    String text = String.valueOf(model.get(property));
    String id = tree.findNode(model).id;
    return tree.getTreeView().getTemplate(model, id, text, iconStyle, false, j, level - 1);
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.AbstractImagePrototype$ImagePrototypeElement

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.