Example usage for com.google.gwt.dom.client TableCellElement setVAlign

List of usage examples for com.google.gwt.dom.client TableCellElement setVAlign

Introduction

In this page you can find the example usage for com.google.gwt.dom.client TableCellElement setVAlign.

Prototype

public void setVAlign(String vAlign) 

Source Link

Document

Vertical alignment of data in cell.

Usage

From source file:com.extjs.gxt.ui.client.widget.layout.TableLayout.java

License:sencha.com license

protected Element getNextCell(Component widget) {
    if (cells == null) {
        cells = new ArrayList<List<Boolean>>();
    }/*from  www  .j  a  v a2  s. c om*/

    TableData data = (TableData) getLayoutData(widget);
    if (data == null) {
        data = new TableData();
        setLayoutData(widget, data);
    }

    TableCellElement td = DOM.createTD().cast();
    td.setClassName("x-table-layout-cell");
    td.setAttribute("role", "presentation");

    int[] cell = getNextNonSpan(currentColumn, currentRow);
    int curCol = currentColumn = cell[0];
    int curRow = currentRow = cell[1];

    for (int rowIndex = curRow; rowIndex < curRow
            + (data.getRowspan() != -1 ? data.getRowspan() : 1); rowIndex++) {
        setupList(rowIndex);
        for (int colIndex = curCol; colIndex < curCol
                + (data.getColspan() != -1 ? data.getColspan() : 1); colIndex++) {
            cells.get(rowIndex).set(colIndex, true);
        }
    }

    if (data.getColspan() != 1) {
        td.setColSpan(data.getColspan());
    }

    if (data.getRowspan() != 1) {
        td.setRowSpan(data.getRowspan());
    }

    if (data.getPadding() > 0) {
        td.getStyle().setPropertyPx("padding", data.getPadding());
    } else if (cellPadding > 0) {
        td.getStyle().setPropertyPx("padding", cellPadding);
    }

    if (data.getStyleName() != null) {
        fly(td).addStyleName(data.getStyleName());
    }

    if (data.horizontalAlign != null) {
        td.setAlign(data.horizontalAlign.name());
    } else if (cellHorizontalAlign != null) {
        td.setAlign(cellHorizontalAlign.name());
    }

    if (data.verticalAlign != null) {
        td.setVAlign(data.verticalAlign.name());
    } else if (cellVerticalAlign != null) {
        td.setVAlign(cellVerticalAlign.name());
    }

    if (data.getHeight() != null) {
        td.setAttribute("height", data.getHeight());
    }
    if (data.getWidth() != null) {
        td.setAttribute("width", data.getWidth());
    }

    if (data.getStyle() != null) {
        fly(td).applyStyles(data.getStyle());
    }
    getRow(curRow).dom.appendChild(td);
    return td.cast();
}

From source file:org.rstudio.studio.client.common.compile.errorlist.CompileErrorItemCodec.java

License:Open Source License

protected TableCellElement maybeCreateDisclosureButton(CompileError entry) {
    if (entry.getLogLine() != -1) {
        TableCellElement td = Document.get().createTDElement();
        td.setClassName(resources_.styles().disclosure());
        td.setVAlign("middle");

        DivElement div = Document.get().createDivElement();
        div.setTitle("View error or warning within the log file");
        div.setClassName(resources_.styles().disclosure());

        td.appendChild(div);/*from   w ww  .  jav a 2  s  .  c  o  m*/
        return td;
    } else {
        return null;
    }
}

From source file:org.rstudio.studio.client.common.compilepdf.CompilePdfErrorItemCodec.java

License:Open Source License

protected TableCellElement maybeCreateDisclosureButton(CompilePdfError entry) {
    if (entry.getLogLine() != -1) {
        TableCellElement td = Document.get().createTDElement();
        td.setClassName(resources_.styles().disclosure());
        td.setVAlign("middle");

        DivElement div = Document.get().createDivElement();
        div.setTitle("View error or warning within the log file");
        div.setClassName(resources_.styles().disclosure());

        td.appendChild(div);//  ww  w.  j av  a2 s . c o m
        return td;
    } else {
        return null;
    }
}

From source file:org.rstudio.studio.client.common.sourcemarkers.SourceMarkerItemCodec.java

License:Open Source License

protected TableCellElement maybeCreateDisclosureButton(SourceMarker entry) {
    if (entry.getLogLine() != -1) {
        TableCellElement td = Document.get().createTDElement();
        td.setClassName(resources_.styles().disclosure());
        td.setVAlign("middle");

        DivElement div = Document.get().createDivElement();
        div.setTitle("View error or warning within the log file");
        div.setClassName(resources_.styles().disclosure());
        div.addClassName(ThemeResources.INSTANCE.themeStyles().handCursor());

        td.appendChild(div);//from   w  w w  .j av a2 s  . c  o m
        return td;
    } else {
        return null;
    }
}

From source file:org.rstudio.studio.client.workbench.views.history.view.HistoryEntryItemCodec.java

License:Open Source License

protected TableCellElement maybeCreateDisclosureButton(HistoryEntry entry) {
    if (!disclosureButton_)
        return null;

    TableCellElement td = Document.get().createTDElement();
    td.setClassName(res_.styles().disclosure());
    td.addClassName(ThemeStyles.INSTANCE.handCursor());
    td.setVAlign("middle");

    DivElement div = Document.get().createDivElement();
    div.setTitle("Show command in original context");
    div.setClassName(res_.styles().disclosure());
    div.addClassName(ThemeStyles.INSTANCE.handCursor());

    td.appendChild(div);// ww  w .j av  a  2  s . co  m
    return td;
}