List of usage examples for org.apache.poi.ss.util PaneInformation getVerticalSplitLeftColumn
public short getVerticalSplitLeftColumn()
From source file:com.vaadin.addon.spreadsheet.SpreadsheetFactory.java
License:Open Source License
/** * Loads freeze pane configuration for the currently active sheet and sets * it into the shared state./* w w w. j a va 2 s . co m*/ * * @param spreadsheet * Target Spreadsheet */ static void loadFreezePane(Spreadsheet spreadsheet) { final Sheet sheet = spreadsheet.getActiveSheet(); PaneInformation paneInformation = sheet.getPaneInformation(); // only freeze panes supported if (paneInformation != null && paneInformation.isFreezePane()) { /* * In POI, HorizontalSplitPosition means rows and * VerticalSplitPosition means columns. Changed the meaning for the * component internals. The left split column / top split row is the * *absolute* index of the first unfrozen column / row. */ spreadsheet.getState().horizontalSplitPosition = paneInformation.getVerticalSplitLeftColumn(); spreadsheet.getState().verticalSplitPosition = paneInformation.getHorizontalSplitTopRow(); /* * If the view was scrolled down / right when panes were frozen, the * invisible frozen rows/columns are effectively hidden in Excel. We * mimic this behavior here. */ for (int col = 0; col < Math.max(0, paneInformation.getVerticalSplitLeftColumn() - paneInformation.getVerticalSplitPosition()); col++) { spreadsheet.setColumnHidden(col, true); } for (int row = 0; row < Math.max(0, paneInformation.getHorizontalSplitTopRow() - paneInformation.getHorizontalSplitPosition()); row++) { spreadsheet.setRowHidden(row, true); } } else { spreadsheet.getState().verticalSplitPosition = 0; spreadsheet.getState().horizontalSplitPosition = 0; } }
From source file:org.bbreak.excella.reports.ReportsTestUtil.java
License:Open Source License
/** * ????// ww w.j a v a 2s . c o m * * @param information * @return ?? */ private static String getPaneInformationString(PaneInformation information) { StringBuffer sb = new StringBuffer(); if (information != null) { sb.append("HorizontalSplitPosition=").append(information.getHorizontalSplitPosition()).append(","); sb.append("HorizontalSplitTopRow=").append(information.getHorizontalSplitTopRow()).append(","); sb.append("VerticalSplitPosition=").append(information.getVerticalSplitPosition()).append(","); sb.append("VerticalSplitLeftColumn=").append(information.getVerticalSplitLeftColumn()); } return sb.toString(); }