org.apache.poi.ss.usermodel.SheetVisibility Java Examples

The following examples show how to use org.apache.poi.ss.usermodel.SheetVisibility. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HSSFWorkbook.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
@Removal(version="3.18")
@Deprecated
@Override
public void setSheetHidden(int sheetIx, int hidden) {
    switch (hidden) {
        case Workbook.SHEET_STATE_VISIBLE:
            setSheetVisibility(sheetIx, SheetVisibility.VISIBLE);
            break;
        case Workbook.SHEET_STATE_HIDDEN:
            setSheetVisibility(sheetIx, SheetVisibility.HIDDEN);
            break;
        case Workbook.SHEET_STATE_VERY_HIDDEN:
            setSheetVisibility(sheetIx, SheetVisibility.VERY_HIDDEN);
            break;
        default:
            throw new IllegalArgumentException("Invalid sheet state : " + hidden + "\n" +
                    "Sheet state must beone of the Workbook.SHEET_STATE_* constants");
    }
}
 
Example #2
Source File: InternalWorkbook.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets the hidden flag for a given sheet.
 * Note that a sheet could instead be
 *  set to be very hidden, which is different
 *  ({@link #isSheetVeryHidden(int)})
 *
 * @param sheetnum the sheet number (0 based)
 * @return True if sheet is hidden
 * @since 3.16 beta 2
 */
public SheetVisibility getSheetVisibility(int sheetnum) {
    final BoundSheetRecord bsr = getBoundSheetRec(sheetnum);
    if (bsr.isVeryHidden()) {
        return SheetVisibility.VERY_HIDDEN;
    }
    if (bsr.isHidden()) {
        return SheetVisibility.HIDDEN;
    }
    return SheetVisibility.VISIBLE;
}
 
Example #3
Source File: HSSFWorkbook.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public SheetVisibility getSheetVisibility(int sheetIx) {
    return workbook.getSheetVisibility(sheetIx);
}
 
Example #4
Source File: HSSFWorkbook.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void setSheetHidden(int sheetIx, boolean hidden) {
    setSheetVisibility(sheetIx, hidden ? SheetVisibility.HIDDEN : SheetVisibility.VISIBLE);
}
 
Example #5
Source File: HSSFWorkbook.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void setSheetVisibility(int sheetIx, SheetVisibility visibility) {
    validateSheetIndex(sheetIx);
    workbook.setSheetHidden(sheetIx, visibility);
}
 
Example #6
Source File: StreamingWorkbook.java    From data-prep with Apache License 2.0 4 votes vote down vote up
/**
 * Not supported
 */
@Override
public SheetVisibility getSheetVisibility(int sheetIx) {
    throw new UnsupportedOperationException();
}
 
Example #7
Source File: StreamingWorkbook.java    From data-prep with Apache License 2.0 4 votes vote down vote up
/**
 * Not supported
 */
@Override
public void setSheetVisibility(int sheetIx, SheetVisibility sheetVisibility) {
    throw new UnsupportedOperationException();
}
 
Example #8
Source File: StreamingWorkbook.java    From excel-streaming-reader with Apache License 2.0 4 votes vote down vote up
/**
 * Not supported
 */
@Override
public SheetVisibility getSheetVisibility(int i) {
  throw new UnsupportedOperationException();
}
 
Example #9
Source File: StreamingWorkbook.java    From excel-streaming-reader with Apache License 2.0 4 votes vote down vote up
/**
 * Not supported
 */
@Override
public void setSheetVisibility(int i, SheetVisibility sheetVisibility) {
  throw new UnsupportedOperationException();
}
 
Example #10
Source File: InternalWorkbook.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Hide or unhide a sheet
 *
 * @param sheetnum The sheet number
 * @param hidden True to mark the sheet as hidden, false otherwise
 */
public void setSheetHidden(int sheetnum, boolean hidden) {
    setSheetHidden(sheetnum, hidden ? SheetVisibility.HIDDEN : SheetVisibility.VISIBLE);
}
 
Example #11
Source File: InternalWorkbook.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Hide or unhide a sheet.
 *
 * @param sheetnum   The sheet number
 * @param visibility the sheet visibility to set (visible, hidden, very hidden)
 * @since 3.16 beta 2
 */
public void setSheetHidden(int sheetnum, SheetVisibility visibility) {
    BoundSheetRecord bsr = getBoundSheetRec(sheetnum);
    bsr.setHidden(visibility == SheetVisibility.HIDDEN);
    bsr.setVeryHidden(visibility == SheetVisibility.VERY_HIDDEN);
}