Example usage for com.google.gwt.gen2.table.client DefaultTableDefinition removeColumnDefinition

List of usage examples for com.google.gwt.gen2.table.client DefaultTableDefinition removeColumnDefinition

Introduction

In this page you can find the example usage for com.google.gwt.gen2.table.client DefaultTableDefinition removeColumnDefinition.

Prototype

public void removeColumnDefinition(ColumnDefinition<RowType, ?> columnDef) 

Source Link

Document

Remove a ColumnDefinition .

Usage

From source file:org.apache.hupa.client.widgets.DragRefetchPagingScrollTable.java

License:Apache License

public void setDragHandler(int newCellIndex, int cellWidth, DragHandlerFactory factory) {
    this.factory = factory;

    if (newCellIndex < 0) {
        throw new IllegalArgumentException("cellIndex needs to be higher then 0");
    }/*from   ww  w .j  a  va2 s .  c o  m*/

    DefaultTableDefinition<RowType> tableDef = (DefaultTableDefinition<RowType>) getTableDefinition();

    // remove old definition 
    if (cellIndex != -1) {
        tableDef.removeColumnDefinition(tableDef.getColumnDefinition(cellIndex));
    }

    this.cellIndex = newCellIndex;

    // Create new ghost definition which will get used later to add the drag widget
    DragColumnDefinition def = new DragColumnDefinition();
    def.setColumnSortable(false);
    def.setColumnTruncatable(false);
    def.setMaximumColumnWidth(cellWidth);
    def.setPreferredColumnWidth(cellWidth);
    def.setMinimumColumnWidth(cellWidth);
    tableDef.addColumnDefinition(cellIndex, def);
}