Package org.apache.poi.hssf.record

Examples of org.apache.poi.hssf.record.ProtectRecord


    records.add( createVCenterRecord() );
    records.add( createPrintSetupRecord() );
    // unknown 33
    records.add( createFontBasisRecord1() );
    records.add( createFontBasisRecord2() );
    records.add(new ProtectRecord(false));
    records.add( createUnitsRecord() );
    records.add( createChartRecord( 0, 0, 30434904, 19031616 ) );
    records.add( createBeginRecord() );
    records.add( createSCLRecord( (short) 1, (short) 1 ) );
    records.add( createPlotGrowthRecord( 65536, 65536 ) );
View Full Code Here


     * @return a new Protect record with protect set to false.
     */
    private static ProtectRecord createProtect() {
        // by default even when we support it we won't
        // want it to be protected
        return new ProtectRecord(false);
    }
View Full Code Here

   */
  public void testProtect() {
    HSSFWorkbook workbook = new HSSFWorkbook();
    HSSFSheet hssfSheet = workbook.createSheet();
    Sheet sheet = hssfSheet.getSheet();
    ProtectRecord protect = sheet.getProtect();
  
    assertFalse(protect.getProtect());

    // This will tell us that cloneSheet, and by extension,
    // the list forms of createSheet leave us with an accessible
    // ProtectRecord.
    hssfSheet.setProtect(true);
View Full Code Here

    short expected = (short)0xfef1;
  HSSFWorkbook wb = new HSSFWorkbook();
    HSSFSheet s = wb.createSheet();
    s.protectSheet("abcdefghij");
    Sheet sheet = s.getSheet();
  ProtectRecord protect = sheet.getProtect();
  PasswordRecord pass = sheet.getPassword();
    assertTrue("protection should be on",protect.getProtect());
    assertTrue("object protection should be on",sheet.isProtected()[1]);
    assertTrue("scenario protection should be on",sheet.isProtected()[2]);
    assertEquals("well known value for top secret hash should be "+Integer.toHexString(expected).substring(4),expected,pass.getPassword());
  }
View Full Code Here

     * @return a new Protect record with protect set to false.
     */
    private static ProtectRecord createProtect() {
        // by default even when we support it we won't
        // want it to be protected
        return new ProtectRecord(false);
    }
View Full Code Here

     * @return a new Protect record with protect set to false.
     */
    private static ProtectRecord createProtect() {
        // by default even when we support it we won't
        // want it to be protected
        return new ProtectRecord(false);
    }
View Full Code Here

    records.add( createVCenterRecord() );
    records.add( createPrintSetupRecord() );
    // unknown 33
    records.add( createFontBasisRecord1() );
    records.add( createFontBasisRecord2() );
    records.add(new ProtectRecord(false));
    records.add( createUnitsRecord() );
    records.add( createChartRecord( 0, 0, 30434904, 19031616 ) );
    records.add( createBeginRecord() );
    records.add( createSCLRecord( (short) 1, (short) 1 ) );
    records.add( createPlotGrowthRecord( 65536, 65536 ) );
View Full Code Here

   */
  public void testProtect() {
    HSSFWorkbook workbook = new HSSFWorkbook();
    HSSFSheet hssfSheet = workbook.createSheet();
    Sheet sheet = hssfSheet.getSheet();
    ProtectRecord protect = sheet.getProtect();
    
    assertFalse(protect.getProtect());

    // This will tell us that cloneSheet, and by extension,
    // the list forms of createSheet leave us with an accessible
    // ProtectRecord.
    hssfSheet.setProtect(true);
View Full Code Here

        return r;
    }

    private ProtectRecord createProtectRecord()
    {
        ProtectRecord r = new ProtectRecord();
        r.setProtect(false);
        return r;
    }
View Full Code Here

   */
  public void testProtect() {
    HSSFWorkbook workbook = new HSSFWorkbook();
    HSSFSheet hssfSheet = workbook.createSheet();
    Sheet sheet = hssfSheet.getSheet();
    ProtectRecord protect = sheet.getProtect();

    assertFalse(protect.getProtect());

    // This will tell us that cloneSheet, and by extension,
    // the list forms of createSheet leave us with an accessible
    // ProtectRecord.
    hssfSheet.setProtect(true);
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.record.ProtectRecord

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.