Package org.zkoss.zss.model

Examples of org.zkoss.zss.model.Worksheet


        final RefBook refBook = refSheet.getOwnerBook();
        final int tRow = ref.getTopRow();
        final int lCol = ref.getLeftCol();
        final int bRow = ref.getBottomRow();
        final int rCol = ref.getRightCol();
        final Worksheet sheet = BookHelper.getSheet(_sheet, refSheet);
        final ChangeInfo info = BookHelper.merge(sheet, tRow, lCol, bRow, rCol, across);
        notifyMergeChange(refBook, info, ref, SSDataEvent.ON_CONTENTS_CHANGE, SSDataEvent.MOVE_NO);
      }
    }
  }
View Full Code Here


        final RefBook refBook = refSheet.getOwnerBook();
        final int tRow = ref.getTopRow();
        final int lCol = ref.getLeftCol();
        final int bRow = ref.getBottomRow();
        final int rCol = ref.getRightCol();
        final Worksheet sheet = BookHelper.getSheet(_sheet, refSheet);
        final ChangeInfo info = BookHelper.unMerge(sheet, tRow, lCol, bRow, rCol);
        notifyMergeChange(refBook, info, ref, SSDataEvent.ON_CONTENTS_CHANGE, SSDataEvent.MOVE_NO);
      }
    }
  }
View Full Code Here

        final int right = ref.getRightCol();
        final int top = ref.getTopRow();
        final int bottom = ref.getBottomRow();
       
        //ZSS-22: Shall not allow Copy and Paste operation in a protected spreadsheet
        final Worksheet sheet = BookHelper.getSheet(_sheet, refSheet);
        if (sheet.getProtect()) {
          for (int r = top; r <= bottom; ++r) {
            final Row row = sheet.getRow(r);
            if (row != null) {
              for (int c = left; c <= right; ++c) {
                final Cell cell = row.getCell(c);
                if (cell != null) {
                  final CellStyle cs = cell.getCellStyle();
View Full Code Here

    final int dstColCount = transpose ? srcRowCount * rowRepeat : srcColCount * colRepeat;
    final int dstB = dstT + dstRowCount - 1;
    final int dstR = dstL + dstColCount - 1;
   
    //ZSS-22: Shall not allow Copy and Paste operation in a protected spreadsheet
    final Worksheet dstSheet = BookHelper.getSheet(_sheet, dstRefSheet);
    final Ref pasteRef = new AreaRefImpl(dstT, dstL, dstB, dstR, dstRefSheet);
    return new RangeImpl(pasteRef, dstSheet).isAnyCellProtected() ? null : pasteRef;
  }
View Full Code Here

    }
    if (pasteType == Range.PASTE_COLUMN_WIDTHS) {
      final Integer lastKey = srcRefs.lastKey();
      final Ref srcRef = srcRefs.get(lastKey);
      final int srclCol = srcRef.getLeftCol();
      final Worksheet srcSheet = BookHelper.getSheet(_sheet, srcRef.getOwnerSheet());
      final int widthRepeatCount = srcRef.getColumnCount();
      copyColumnWidths(srcSheet, widthRepeatCount, srclCol, pasteRef);
      return pasteRef;
    }
   
View Full Code Here

  private void copyColumnWidths(Worksheet srcSheet, int widthRepeatCount, int srclCol, Ref dstRef) {
    final int dstlCol = dstRef.getLeftCol();
    final int dstColCount = dstRef.getColumnCount();
    final RefSheet dstRefSheet = dstRef.getOwnerSheet();
    final Worksheet dstSheet = BookHelper.getSheet(_sheet, dstRefSheet);
    for (int count = 0; count < dstColCount; ++count) {
      final int dstCol = dstlCol + count;
      final int srcCol = srclCol + count % widthRepeatCount;
      final int char256 = srcSheet.getColumnWidth(srcCol);
      BookHelper.setColumnWidth(dstSheet, dstCol, dstCol, char256);
    }
    final Book book = (Book) dstSheet.getWorkbook();
    //bug# ZSS-52: Past special, copy column width's behavior doesn't correct
    final int maxrow = book.getSpreadsheetVersion().getLastRowIndex();
    final Set<Ref> affected = new HashSet<Ref>();
    affected.add(dstRef.isWholeColumn() ? dstRef : new AreaRefImpl(0, dstlCol, maxrow, dstRef.getRightCol(), dstRefSheet));
    BookHelper.notifySizeChanges(book, affected);
View Full Code Here

    if (pasteRef == null) {
      return null;
    }
    if (pasteType == Range.PASTE_COLUMN_WIDTHS) {
      final int srclCol = srcRef.getLeftCol();
      final Worksheet srcSheet = BookHelper.getSheet(_sheet, srcRef.getOwnerSheet());
      copyColumnWidths(srcSheet, srcColCount, srclCol, pasteRef);
      return pasteRef;
    }
    final int tRow = srcRef.getTopRow();
    final int lCol = srcRef.getLeftCol();
    final int bRow = srcRef.getBottomRow();
    final int rCol = srcRef.getRightCol();
    final RefSheet dstRefsheet = dstRef.getOwnerSheet();
    final Worksheet srcSheet = BookHelper.getSheet(_sheet, srcRef.getOwnerSheet());
    final Worksheet dstSheet = BookHelper.getSheet(_sheet, dstRefsheet);
    final Set<Ref> toEval = info.getToEval();
    final Set<Ref> affected = info.getAffected();
    final List<MergeChange> mergeChanges = info.getMergeChanges();
    if (!transpose) {
      int dstRow = dstRef.getTopRow();
View Full Code Here

        final RefSheet refSheet = ref.getOwnerSheet();
        final int tRow = ref.getTopRow();
        final int lCol = ref.getLeftCol();
        final int bRow = ref.getBottomRow();
        final int rCol = ref.getRightCol();
        final Worksheet sheet = BookHelper.getSheet(_sheet, refSheet);
        final Set<Ref> all = BookHelper.setBorders(sheet, tRow, lCol, bRow, rCol, borderIndex, lineStyle, color);
        if (all != null) {
          final Book book = (Book) _sheet.getWorkbook();
          BookHelper.notifyCellChanges(book, all);
        }
View Full Code Here

      if (_refs != null && !_refs.isEmpty()) {
        final Ref ref = _refs.iterator().next();
        final RefSheet refSheet = ref.getOwnerSheet();
        final int lCol = ref.getLeftCol();
        final int rCol = ref.getRightCol();
        final Worksheet sheet = BookHelper.getSheet(_sheet, refSheet);
        final Set<Ref> all = BookHelper.setColumnWidth(sheet, lCol, rCol, char256);
        if (all != null) {
          final Book book = (Book) _sheet.getWorkbook();
          BookHelper.notifySizeChanges(book, all);
        }
View Full Code Here

      if (_refs != null && !_refs.isEmpty()) {
        final Ref ref = _refs.iterator().next();
        final RefSheet refSheet = ref.getOwnerSheet();
        final int tRow = ref.getTopRow();
        final int bRow = ref.getBottomRow();
        final Worksheet sheet = BookHelper.getSheet(_sheet, refSheet);
        final Set<Ref> all = BookHelper.setRowHeight(sheet, tRow, bRow, (short) (points * 20), customHeight); //in twips, set customHeight
        if (all != null) {
          final Book book = (Book) _sheet.getWorkbook();
          BookHelper.notifySizeChanges(book, all);
        }
View Full Code Here

TOP

Related Classes of org.zkoss.zss.model.Worksheet

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.