Search in sources :

Example 1 with AbstractHeader

use of org.ovirt.engine.ui.common.widget.table.header.AbstractHeader in project ovirt-engine by oVirt.

the class ColumnResizeCellTable method addColumnImpl.

private void addColumnImpl(Column<T, ?> column, Header<?> header) {
    // build resizable headers, if necessary
    if (columnResizingEnabled && header instanceof AbstractCheckboxHeader) {
        header = createResizableCheckboxHeader(header, column);
    } else if (columnResizingEnabled) {
        header = createResizableHeader(column, header);
    } else if (applyHeaderStyle && header instanceof SafeHtmlHeader) {
        SafeHtmlHeader safeHtmlHeader = (SafeHtmlHeader) header;
        // not using Resizeable header, but still want it to look that way.
        // nonResizeableColumnHeader does that.
        // TODO nonResizeableColumnHeader copy-pastes CSS. fix.
        SafeHtml newValue = templates.nonResizeableColumnHeader(safeHtmlHeader.getValue());
        header = new SafeHtmlHeader(newValue, safeHtmlHeader.getTooltip());
    }
    // actually add the column
    super.addColumn(column, header);
    // Add empty no-width column as the last column
    if (columnResizingEnabled) {
        if (isColumnPresent(emptyNoWidthColumn)) {
            removeColumn(emptyNoWidthColumn);
        }
        super.addColumn(emptyNoWidthColumn, emptyNoWidthColumnHeader);
    }
    // Add column to header context menu
    if (header instanceof AbstractHeader) {
        ((AbstractHeader) header).setContextMenuHandler(ensureContextMenuHandler());
        contextPopup.getContextMenu().addItem(column);
    }
}
Also used : SafeHtmlHeader(org.ovirt.engine.ui.common.widget.table.header.SafeHtmlHeader) AbstractHeader(org.ovirt.engine.ui.common.widget.table.header.AbstractHeader) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) AbstractCheckboxHeader(org.ovirt.engine.ui.common.widget.table.header.AbstractCheckboxHeader)

Aggregations

SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)1 AbstractCheckboxHeader (org.ovirt.engine.ui.common.widget.table.header.AbstractCheckboxHeader)1 AbstractHeader (org.ovirt.engine.ui.common.widget.table.header.AbstractHeader)1 SafeHtmlHeader (org.ovirt.engine.ui.common.widget.table.header.SafeHtmlHeader)1