Package org.apache.poi.hssf.record.cf

Examples of org.apache.poi.hssf.record.cf.PatternFormatting


    if (containsBorderFormattingBlock()) {
      borderFormatting = new BorderFormatting(in);
    }

    if (containsPatternFormattingBlock()) {
      patternFormatting = new PatternFormatting(in);
    }

    // "You may not use unions, intersections or array constants in Conditional Formatting criteria"
    field_17_formula1 = Formula.read(field_3_formula1_len, in);
    field_18_formula2 = Formula.read(field_4_formula2_len, in);
View Full Code Here


        assertFalse(record.isBottomLeftTopRightBorderModified());
        record.setBottomLeftTopRightBorderModified(true);
        assertTrue(record.isBottomLeftTopRightBorderModified());


        PatternFormatting patternFormatting = new PatternFormatting();
        testPatternFormattingAccessors(patternFormatting);
        assertFalse(record.containsPatternFormattingBlock());
        record.setPatternFormatting(patternFormatting);
        assertTrue(record.containsPatternFormattingBlock());
View Full Code Here

    public void testWrite() {
        HSSFWorkbook workbook = new HSSFWorkbook();
        HSSFSheet sheet = workbook.createSheet();
        CFRuleRecord rr = CFRuleRecord.create(sheet, ComparisonOperator.BETWEEN, "5", "10");

        PatternFormatting patternFormatting = new PatternFormatting();
        patternFormatting.setFillPattern(PatternFormatting.BRICKS);
        rr.setPatternFormatting(patternFormatting);

        byte[] data = rr.serialize();
        assertEquals(26, data.length);
        assertEquals(3, LittleEndian.getShort(data, 6));
View Full Code Here

        assertFalse(record.isBottomLeftTopRightBorderModified());
        record.setBottomLeftTopRightBorderModified(true);
        assertTrue(record.isBottomLeftTopRightBorderModified());


        PatternFormatting patternFormatting = new PatternFormatting();
        testPatternFormattingAccessors(patternFormatting);
        assertFalse(record.containsPatternFormattingBlock());
        record.setPatternFormatting(patternFormatting);
        assertTrue(record.containsPatternFormattingBlock());
View Full Code Here

    public void testWrite() {
        HSSFWorkbook workbook = new HSSFWorkbook();
        HSSFSheet sheet = workbook.createSheet();
        CFRuleRecord rr = CFRuleRecord.create(sheet, ComparisonOperator.BETWEEN, "5", "10");

        PatternFormatting patternFormatting = new PatternFormatting();
        patternFormatting.setFillPattern(PatternFormatting.BRICKS);
        rr.setPatternFormatting(patternFormatting);

        byte[] data = rr.serialize();
        assertEquals(26, data.length);
        assertEquals(3, LittleEndian.getShort(data, 6));
View Full Code Here

    if (containsBorderFormattingBlock()) {
      _borderFormatting = new BorderFormatting(in);
    }

    if (containsPatternFormattingBlock()) {
      _patternFormatting = new PatternFormatting(in);
    }

    // "You may not use unions, intersections or array constants in Conditional Formatting criteria"
    field_17_formula1 = Formula.read(field_3_formula1_len, in);
    field_18_formula2 = Formula.read(field_4_formula2_len, in);
View Full Code Here

    return getBorderFormatting(true);
  }
 
  private HSSFPatternFormatting getPatternFormatting(boolean create)
  {
    PatternFormatting patternFormatting = cfRuleRecord.getPatternFormatting();
    if ( patternFormatting != null)
    {
      cfRuleRecord.setPatternFormatting(patternFormatting);
      return new HSSFPatternFormatting(cfRuleRecord);
    }
    else if( create )
    {
      patternFormatting = new PatternFormatting();
      cfRuleRecord.setPatternFormatting(patternFormatting);
      return new HSSFPatternFormatting(cfRuleRecord);
    }
    else
    {
View Full Code Here

    assertFalse(record.isBottomLeftTopRightBorderModified());
    record.setBottomLeftTopRightBorderModified(true);
    assertTrue(record.isBottomLeftTopRightBorderModified());


    PatternFormatting patternFormatting = new PatternFormatting();
    testPatternFormattingAccessors(patternFormatting);
    assertFalse(record.containsPatternFormattingBlock());
    record.setPatternFormatting(patternFormatting);
    assertTrue(record.containsPatternFormattingBlock());
View Full Code Here

  public void testWrite() {
    HSSFWorkbook workbook = new HSSFWorkbook();
    CFRuleRecord rr = CFRuleRecord.create(workbook, ComparisonOperator.BETWEEN, "5", "10");

    PatternFormatting patternFormatting = new PatternFormatting();
    patternFormatting.setFillPattern(PatternFormatting.BRICKS);
    rr.setPatternFormatting(patternFormatting);

    byte[] data = rr.serialize();
    assertEquals(26, data.length);
    assertEquals(3, LittleEndian.getShort(data, 6));
View Full Code Here

      if (containsBorderFormattingBlock()) {
        borderFormatting = new BorderFormatting(in);
      }

      if (containsPatternFormattingBlock()) {
        patternFormatting = new PatternFormatting(in);
      }

      if (field_3_formula1_len > 0) {
        Stack ptgs = Ptg.createParsedExpressionTokens(field_3_formula1_len, in);
        // Now convert any fields as required
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.record.cf.PatternFormatting

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.