Java 类com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant 实例源码

项目:ontobrowser    文件:ActionIconCellDecorator.java   
private SafeHtml getImageHtml(ImageResource res, VerticalAlignmentConstant valign) {
    AbstractImagePrototype proto = AbstractImagePrototype.create(res);
    SafeHtml image = SafeHtmlUtils.fromTrustedString(proto.getHTML());

    // Create the wrapper based on the vertical alignment.
    SafeStylesBuilder cssStyles =
            new SafeStylesBuilder().appendTrustedString(direction + ":0px;");
    if (HasVerticalAlignment.ALIGN_TOP == valign) {
        return templates.imageWrapperTop(cssStyles.toSafeStyles(), image);
    } else if (HasVerticalAlignment.ALIGN_BOTTOM == valign) {
        return templates.imageWrapperBottom(cssStyles.toSafeStyles(), image);
    } else {
        int halfHeight = (int) Math.round(res.getHeight() / 2.0);
        cssStyles.appendTrustedString("margin-top:-" + halfHeight + "px;");
        return templates.imageWrapperMiddle(cssStyles.toSafeStyles(), image);
    }
}
项目:platypus-js    文件:StyleIconDecorator.java   
public static String decorate(SafeHtml toDecorate, String aId, PublishedCell aCell, VerticalAlignmentConstant valign, SafeHtmlBuilder sb) {
    SafeStylesBuilder stb = new SafeStylesBuilder();
    SafeUri imgSrc = null;
    if (aCell != null) {
        stb.append(SafeStylesUtils.fromTrustedString(aCell.toStyledWOBackground()));
        if (aCell.getIcon() != null) {
            ImageResource icon = aCell.getIcon();
            imgSrc = icon.getSafeUri();
        }
    }
    String decorId;
    if (aId != null && !aId.isEmpty()) {
        decorId = aId;
    } else {
        decorId = Document.get().createUniqueId();
    }
    if (imgSrc != null)
        sb.append(RenderedEditorCell.PaddedCell.INSTANCE.generate(stb.toSafeStyles(), imgSrc, decorId, toDecorate));
    else
        sb.append(RenderedEditorCell.PaddedCell.INSTANCE.generate(stb.toSafeStyles(), decorId, toDecorate));
    return decorId;
}
项目:ontobrowser    文件:ActionIconCellDecorator.java   
public ActionIconCellDecorator(ImageResource icon, Cell<C> cell,
        VerticalAlignmentConstant valign, int spacing,
        Delegate<C> delegate) {
    super(icon, cell, valign, spacing);
    this.delegate = delegate;
    this.iconHtml = getImageHtml(icon, valign);
}
项目:unitimes    文件:EnrollmentTable.java   
@Override
public VerticalAlignmentConstant getVerticalCellAlignment() {
    return HasVerticalAlignment.ALIGN_TOP;
}
项目:document-management-system    文件:TemplateWizardPopup.java   
/**
 * setCellVerticalAlignment
 */
public void setCellVerticalAlignment(Widget w, VerticalAlignmentConstant align) {
    vPanel.setCellVerticalAlignment(w, align);
}
项目:unitime    文件:EnrollmentTable.java   
@Override
public VerticalAlignmentConstant getVerticalCellAlignment() {
    return HasVerticalAlignment.ALIGN_TOP;
}
项目:consulo    文件:CellPanel.java   
@SuppressWarnings("deprecation")
protected void setCellVerticalAlignment(Element td,
                                        VerticalAlignmentConstant align) {
  setCellVerticalAlignment(DOM.asOld(td), align);
}
项目:consulo    文件:CellPanel.java   
/**
 * @deprecated Call and override {@link #setCellVerticalAlignment(Element,
 *             VerticalAlignmentConstant)} instead.
 */
@Deprecated
protected void setCellVerticalAlignment(com.google.gwt.user.client.Element td,
                                        VerticalAlignmentConstant align) {
  td.getStyle().setProperty("verticalAlign", align.getVerticalAlignString());
}
项目:gwt-gantt    文件:HTMLTable.java   
/**
 * Sets the vertical alignment of the specified cell.
 *
 * @param row the row of the cell whose alignment is to be set
 * @param column the column of the cell whose alignment is to be set
 * @param align the cell's new vertical alignment as specified in
 *          {@link HasVerticalAlignment}.
 * @throws IndexOutOfBoundsException
 */
public void setVerticalAlignment(int row, int column,
    VerticalAlignmentConstant align) {
  prepareCell(row, column);
  DOM.setStyleAttribute(getCellElement(bodyElem, row, column),
      "verticalAlign", align.getVerticalAlignString());
}
项目:consulo    文件:CellPanel.java   
/**
 * Sets the vertical alignment of the given widget within its cell.
 *
 * @param w the widget whose vertical alignment is to be set
 * @param align the widget's vertical alignment, as defined in
 *          {@link HasVerticalAlignment}.
 */
public void setCellVerticalAlignment(Widget w, HasVerticalAlignment.VerticalAlignmentConstant align) {
  Element td = getWidgetTd(w);
  if (td != null) {
    setCellVerticalAlignment(td, align);
  }
}
项目:document-management-system    文件:WizardPopup.java   
/**
 * setCellVerticalAlignment
 *
 * @param w
 * @param align
 */
public void setCellVerticalAlignment(Widget w, VerticalAlignmentConstant align) {
    vPanel.setCellVerticalAlignment(w, align);
}
项目:gwt-gantt    文件:HTMLTable.java   
/**
 * Sets the horizontal and vertical alignment of the specified cell's
 * contents.
 *
 * @param row the row of the cell whose alignment is to be set
 * @param column the column of the cell whose alignment is to be set
 * @param hAlign the cell's new horizontal alignment as specified in
 *          {@link HasHorizontalAlignment}
 * @param vAlign the cell's new vertical alignment as specified in
 *          {@link HasVerticalAlignment}
 * @throws IndexOutOfBoundsException
 */
public void setAlignment(int row, int column,
    HorizontalAlignmentConstant hAlign, VerticalAlignmentConstant vAlign) {
  setHorizontalAlignment(row, column, hAlign);
  setVerticalAlignment(row, column, vAlign);
}
项目:gwt-gantt    文件:HTMLTable.java   
/**
 * Sets the vertical alignment of the specified row.
 *
 * @param row the row whose alignment is to be set
 * @param align the row's new vertical alignment as specified in
 *          {@link HasVerticalAlignment}
 * @throws IndexOutOfBoundsException
 */
public void setVerticalAlign(int row, VerticalAlignmentConstant align) {
  DOM.setStyleAttribute(ensureElement(row), "verticalAlign",
      align.getVerticalAlignString());
}
项目:consulo    文件:CellPanel.java   
/**
 * Overloaded version for IsWidget.
 *
 * @see #setCellVerticalAlignment(Widget,HasVerticalAlignment.VerticalAlignmentConstant)
 */
public void setCellVerticalAlignment(IsWidget w, VerticalAlignmentConstant align) {
  this.setCellVerticalAlignment(w.asWidget(),align);
}
项目:unitimes    文件:UniTimeTable.java   
public VerticalAlignmentConstant getVerticalCellAlignment();
项目:unitimes    文件:WebTable.java   
public VerticalAlignmentConstant getVerticalAlignment() { return iVerticalAlignment; }
项目:unitimes    文件:WebTable.java   
public void setVerticalAlignment(VerticalAlignmentConstant vertical) { iVerticalAlignment = vertical; }
项目:unitime    文件:UniTimeTable.java   
public VerticalAlignmentConstant getVerticalCellAlignment();
项目:unitime    文件:WebTable.java   
public VerticalAlignmentConstant getVerticalAlignment() { return iVerticalAlignment; }
项目:unitime    文件:WebTable.java   
public void setVerticalAlignment(VerticalAlignmentConstant vertical) { iVerticalAlignment = vertical; }