Example usage for org.apache.poi.xssf.streaming SXSSFSheet isColumnTrackedForAutoSizing

List of usage examples for org.apache.poi.xssf.streaming SXSSFSheet isColumnTrackedForAutoSizing

Introduction

In this page you can find the example usage for org.apache.poi.xssf.streaming SXSSFSheet isColumnTrackedForAutoSizing.

Prototype

public boolean isColumnTrackedForAutoSizing(int column) 

Source Link

Document

Returns true if column is currently tracked for auto-sizing.

Usage

From source file:com.dua3.meja.model.poi.PoiSheet.java

License:Apache License

@Override
public void autoSizeColumn(int j) {
    // for streaming implementation, only tracked columns can be autosized!
    if (poiSheet instanceof SXSSFSheet) {
        SXSSFSheet sxssfSheet = (SXSSFSheet) poiSheet;
        if (!sxssfSheet.isColumnTrackedForAutoSizing(j)) {
            return;
        }//w  w w.  ja  v a  2  s  .  com
    }

    poiSheet.autoSizeColumn(j);
    pcs.firePropertyChange(Sheet.PROPERTY_LAYOUT, null, null);
}

From source file:com.dua3.meja.model.poi.PoiSheet.java

License:Apache License

@Override
public void autoSizeColumns() {
    boolean layoutChanged = false;

    // for streaming implementation, only tracked columns can be autosized!
    if (poiSheet instanceof SXSSFSheet) {
        SXSSFSheet sxssfSheet = (SXSSFSheet) poiSheet;
        for (int j = 0; j < getColumnCount(); j++) {
            if (sxssfSheet.isColumnTrackedForAutoSizing(j)) {
                poiSheet.autoSizeColumn(j);
                layoutChanged = true;/*from ww w  .  j  a v a 2 s . com*/
            }
        }
    } else {
        for (int j = 0; j < getColumnCount(); j++) {
            poiSheet.autoSizeColumn(j);
            layoutChanged = true;
        }
    }

    // inform listeners
    if (layoutChanged) {
        pcs.firePropertyChange(Sheet.PROPERTY_LAYOUT, null, null);
    }
}