Java源码示例:org.apache.poi.ss.util.PaneInformation

示例1
/**
 * Returns the information regarding the currently configured pane (split or freeze).
 * @return <code>null</code> if no pane configured, or the pane information.
 */
public PaneInformation getPaneInformation() {
  PaneRecord rec = (PaneRecord)findFirstRecordBySid(PaneRecord.sid);
  if (rec == null)
    return null;

  return new PaneInformation(rec.getX(), rec.getY(), rec.getTopRow(),
                             rec.getLeftColumn(), (byte)rec.getActivePane(), windowTwo.getFreezePanes());
}
 
示例2
private void processSpreadsheetUpload(Workbook wb, List<Map<QName,String>> users)
    throws IOException
{
    if (wb.getNumberOfSheets() > 1)
    {
        logger.info("Uploaded Excel file has " + wb.getNumberOfSheets() + 
                " sheets, ignoring  all except the first one"); 
    }
    
    int firstRow = 0;
    Sheet s = wb.getSheetAt(0);
    DataFormatter df = new DataFormatter();
    
    String[][] data = new String[s.getLastRowNum()+1][];
                                 
    // If there is a heading freezepane row, skip it
    PaneInformation pane = s.getPaneInformation();
    if (pane != null && pane.isFreezePane() && pane.getHorizontalSplitTopRow() > 0)
    {
        firstRow = pane.getHorizontalSplitTopRow();
        logger.debug("Skipping excel freeze header of " + firstRow + " rows");
    }
    
    // Process each row in turn, getting columns up to our limit
    for (int row=firstRow; row <= s.getLastRowNum(); row++)
    {
        Row r = s.getRow(row);
        if (r != null)
        {
            String[] d = new String[COLUMNS.length];
            for (int cn=0; cn<COLUMNS.length; cn++)
            {
                Cell cell = r.getCell(cn);
                if (cell != null && cell.getCellType() != CellType.BLANK)
                {
                    d[cn] = df.formatCellValue(cell);
                }
            }
            data[row] = d;
        }
    }
    
    // Handle the contents
    processSpreadsheetUpload(data, users);
}
 
示例3
/**
 * Not supported
 */
@Override
public PaneInformation getPaneInformation() {
    throw new UnsupportedOperationException();
}
 
示例4
/**
 * Not supported
 */
@Override
public PaneInformation getPaneInformation() {
  throw new UnsupportedOperationException();
}
 
示例5
/**
 * Returns the information regarding the currently configured pane (split or freeze)
 *
 * @return null if no pane configured, or the pane information.
 */
PaneInformation getPaneInformation();
 
示例6
/**
 * Returns the information regarding the currently configured pane (split or freeze).
 *
 * @return null if no pane configured, or the pane information.
 */
@Override
public PaneInformation getPaneInformation() {
    return getSheet().getPaneInformation();
}