Examples of CellCacheAggeration


Examples of org.zkoss.test.zss.CellCacheAggeration

  }
 
  @Test
  public void paste_from_cut() {
    CellCacheAggeration.Builder builder = getCellCacheAggerationBuilder(11, 5, 12, 5);
    CellCacheAggeration copyFrom = builder.build();
    Assert.assertFalse(spreadsheet.isHighlight(11, 5, 12, 5));
   
    spreadsheet.setSelection(11, 5, 12, 5);
    click(".zstbtn-cut");
   
    Assert.assertTrue(spreadsheet.isHighlight(11, 5, 12, 5));
   
    focus(11, 10);
    click(".zstbtn-paste");
   
    CellCacheAggeration pasteTo = builder.offset(11, 10).build();
    Assert.assertEquals(copyFrom, pasteTo);
   
    //clear copy from
    for (CellCache c : copyFrom) {
      Assert.assertEquals(Cell.CellType.BLANK, getCellType(c.getRow(), c.getCol()));
View Full Code Here

Examples of org.zkoss.test.zss.CellCacheAggeration

    Assert.assertTrue(spreadsheet.isHighlight(tRow, lCol, bRow, rCol));
  }
 
  private void pasteAllExpectBorderAndVerify(int tRow, int lCol, int bRow, int rCol, int pasteToRow, int pasteToCol) {
    CellCacheAggeration.Builder builder = getCellCacheAggerationBuilder(tRow, lCol, bRow, rCol);
    CellCacheAggeration copyFrom = builder.build();
//    CellCacheAggeration pasteDestination = builder.offset(pasteToRow, pasteToCol).build();
//    copyFrom.merge(pasteDestination, CellCache.Field.BOTTOM_BORDER, CellCache.Field.RIGHT_BORDER);
   
    prepareCopySource(copyFrom.getTop(), copyFrom.getLeft(), copyFrom.getBottom(), copyFrom.getRight());
   
    focus(pasteToRow, pasteToCol);
    click(".zstbtn-paste .zstbtn-arrow");
    click(".zsmenuitem-pasteAllExceptBorder");
   
    CellCacheAggeration pasteTo = builder.offset(pasteToRow, pasteToCol).build();
    Assert.assertTrue(copyFrom.equals(pasteTo, EqualCondition.EXPECT_BORDER));
  }
View Full Code Here

Examples of org.zkoss.test.zss.CellCacheAggeration

  }
 
  //paste formula remain original's style
  private void pasteFormulaAndVerify(int tRow, int lCol, int bRow, int rCol, int pasteToRow, int pasteToCol) {
    CellCacheAggeration.Builder builder = getCellCacheAggerationBuilder(tRow, lCol, bRow, rCol);
    CellCacheAggeration copyFrom = builder.build();
    CellCacheAggeration pasteDestination = builder.offset(pasteToRow, pasteToCol).build();
    //when paste formula, it remain same style: align color, border etc
    copyFrom.merge(pasteDestination, CellCache.Field.VERTICAL_ALIGN, CellCache.Field.HORIZONTAL_ALIGN, CellCache.Field.FONT_COLOR, CellCache.Field.FILL_COLOR, CellCache.Field.BOTTOM_BORDER, CellCache.Field.RIGHT_BORDER);
   
    prepareCopySource(copyFrom.getTop(), copyFrom.getLeft(), copyFrom.getBottom(), copyFrom.getRight());
   
    focus(pasteToRow, pasteToCol);
    click(".zstbtn-paste .zstbtn-arrow");
    click(".zsmenuitem-pasteFormula");
   
    CellCacheAggeration pasteTo = builder.offset(pasteToRow, pasteToCol).build();
    Assert.assertEquals(copyFrom, pasteTo);
  }
View Full Code Here

Examples of org.zkoss.test.zss.CellCacheAggeration

    Assert.assertEquals(copyFrom, pasteTo);
  }
 
  private void pasteValueAndVerify(int tRow, int lCol, int bRow, int rCol, int pasteToRow, int pasteToCol) {
    CellCacheAggeration.Builder builder = getCellCacheAggerationBuilder(tRow, lCol, bRow, rCol);
    CellCacheAggeration copyFrom = builder.build();
    CellCacheAggeration pasteDestination = builder.offset(pasteToRow, pasteToCol).build();
    //remain style
    copyFrom.merge(pasteDestination, CellCache.Field.VERTICAL_ALIGN, CellCache.Field.HORIZONTAL_ALIGN, CellCache.Field.FONT_COLOR, CellCache.Field.FILL_COLOR, CellCache.Field.BOTTOM_BORDER, CellCache.Field.RIGHT_BORDER);
   
    prepareCopySource(copyFrom.getTop(), copyFrom.getLeft(), copyFrom.getBottom(), copyFrom.getRight());
   
    focus(pasteToRow, pasteToCol);
    click(".zstbtn-paste .zstbtn-arrow");
    click(".zsmenuitem-pasteValue");
   
    CellCacheAggeration pasteTo = builder.offset(pasteToRow, pasteToCol).build();
    Assert.assertTrue(copyFrom.equals(pasteTo, EqualCondition.VALUE, EqualCondition.IGNORE_NUMBER_FORMAT));
  }
View Full Code Here

Examples of org.zkoss.test.zss.CellCacheAggeration

    int tRow = 12;
    int lCol = 5;
    int bRow = 13;
    int rCol = 6;
    CellCacheAggeration.Builder srcBuilder = getCellCacheAggerationBuilder(tRow, lCol, bRow, rCol);
    CellCacheAggeration src = srcBuilder.build();
   
    spreadsheet.setSelection(tRow, lCol, bRow, rCol);
    click(".zstbtn-insert .zstbtn-arrow");
    click(".zsmenu-insertCell");
    click(".zsmenuitem-shiftCellRight");
View Full Code Here

Examples of org.zkoss.test.zss.CellCacheAggeration

    int tRow = 12;
    int lCol = 5;
    int bRow = 13;
    int rCol = 6;
    CellCacheAggeration.Builder srcBuilder = getCellCacheAggerationBuilder(tRow, lCol, bRow, rCol);
    CellCacheAggeration src = srcBuilder.build();
   
    spreadsheet.setSelection(tRow, lCol, bRow, rCol);
    click(".zstbtn-insert .zstbtn-arrow");
    click(".zsmenu-insertCell");
    click(".zsmenuitem-shiftCellDown");
View Full Code Here

Examples of org.zkoss.test.zss.CellCacheAggeration

    int bRow = 13;
    int rCol = 6;
    //exam whole row will be inefficient, only expand 5 cells to check
    CellCacheAggeration.Builder builder = getCellCacheAggerationBuilder(tRow, lCol, bRow, rCol)
      .expandRight(5);
    CellCacheAggeration cache = builder.build();
   
    spreadsheet.setSelection(tRow, lCol, bRow, rCol);
    click(".zstbtn-insert .zstbtn-arrow");
    click(".zsmenuitem-insertSheetRow");
    verifyInsert(Insert.CELL_DOWN, cache, builder);
View Full Code Here

Examples of org.zkoss.test.zss.CellCacheAggeration

    int bRow = 13;
    int rCol = 6;
    //exam whole column will be inefficient, only expand 5 cells to check
    CellCacheAggeration.Builder builder = getCellCacheAggerationBuilder(tRow, lCol, bRow, rCol)
      .expandDown(5);
    CellCacheAggeration cache = builder.build();
   
    spreadsheet.setSelection(tRow, lCol, bRow, rCol);
    click(".zstbtn-insert .zstbtn-arrow");
    click(".zsmenuitem-insertSheetColumn");
    verifyInsert(Insert.CELL_RIGHT, cache, builder);
View Full Code Here

Examples of org.zkoss.test.zss.CellCacheAggeration

    int tRow = 15;
    int lCol = 6;
    int bRow = 18;
    int rCol = 7;
    CellCacheAggeration.Builder builder = getCellCacheAggerationBuilder(tRow, lCol, bRow, rCol);
    CellCacheAggeration copyFrom = builder.build();
    keyboardDirector.ctrlCopy(tRow, lCol, bRow, rCol);
   
    mouseDirector.openCellContextMenu(11, 10);
    click(".z-menupopup:visible .zsmenuitem-pasteSpecial");
    click("$_pasteSpecialDialog $okBtn");
View Full Code Here

Examples of org.zkoss.test.zss.CellCacheAggeration

    int tRow = 15;
    int lCol = 6;
    int bRow = 18;
    int rCol = 7;
    CellCacheAggeration.Builder builder = getCellCacheAggerationBuilder(tRow, lCol, bRow, rCol);
    CellCacheAggeration copyFrom = builder.build();
    keyboardDirector.ctrlCopy(tRow, lCol, bRow, rCol);
   
    mouseDirector.openCellContextMenu(11, 10);
    click(".z-menupopup:visible .zsmenuitem-pasteSpecial");
   
    jq("$allExcpetBorder input").getWebElement().click();
    click("$_pasteSpecialDialog $okBtn");
   
    Assert.assertTrue(copyFrom.equals(builder.offset(11, 10).build(), EqualCondition.EXPECT_BORDER));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.