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.moveRange(sheet, tRow, lCol, bRow, rCol, nRow, nCol);
        notifyMergeChange(refBook, info, ref, SSDataEvent.ON_CONTENTS_CHANGE, SSDataEvent.MOVE_NO);
      }
    }
  }
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> refs = BookHelper.setCellStyle(sheet, tRow, lCol, bRow, rCol, style);
          all.addAll(refs);
        }
        if (!all.isEmpty()) {
          final Book book = (Book) _sheet.getWorkbook();
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);
        clearContents(sheet, tRow, lCol, bRow, rCol);
      }
    }
  }
View Full Code Here

      if (_refs != null && !_refs.isEmpty()) {
        final Set<Ref> all = new HashSet<Ref>();
        for (Ref ref : _refs) {
          if (ref.isWholeRow()) {
            final RefSheet refSheet = ref.getOwnerSheet();
            final Worksheet sheet = BookHelper.getSheet(_sheet, refSheet);
            final int tRow = ref.getTopRow();
            final int bRow = ref.getBottomRow();
            final Set<Ref> refs = BookHelper.setRowsHidden(sheet, tRow, bRow, hidden);
            all.addAll(refs);
          } else if (ref.isWholeColumn()) {
            final RefSheet refSheet = ref.getOwnerSheet();
            final Worksheet sheet = BookHelper.getSheet(_sheet, refSheet);
            final int lCol = ref.getLeftCol();
            final int rCol = ref.getRightCol();
            final Set<Ref> refs = BookHelper.setColumnsHidden(sheet, lCol, rCol, hidden);
            all.addAll(refs);
          }
View Full Code Here

 
  @Override
  public void setDisplayGridlines(boolean show) {
    synchronized (_sheet) {
      final Ref ref = getRefs().iterator().next();
      final Worksheet sheet = BookHelper.getSheet(_sheet, ref.getOwnerSheet());
      final Set<Ref> all = new HashSet<Ref>();
      final boolean old = sheet.isDisplayGridlines();
      if (old != show) {
        sheet.setDisplayGridlines(show);
        //sheet is important, row, column is not in this event
        all.add(ref);
      }
      if (!all.isEmpty()) {
        final Book book = (Book) sheet.getWorkbook();
        BookHelper.notifyGridlines(book, all, show);
      }
    }
  }
View Full Code Here

 
  @Override
  public void protectSheet(String password) {
    synchronized (_sheet) {
      final Ref ref = getRefs().iterator().next();
      final Worksheet sheet = BookHelper.getSheet(_sheet, ref.getOwnerSheet());
      final Set<Ref> all = new HashSet<Ref>();
      final boolean oldProtected = sheet.getProtect();
      if (oldProtected && password == null) {
        sheet.protectSheet(null);
        all.add(ref);
      } else if (oldProtected == false && password != null) {
        sheet.protectSheet(password);
        all.add(ref);
      }
      if (!all.isEmpty()) {
        final Book book = (Book) sheet.getWorkbook();
        BookHelper.notifyProtectSheet(book, all, password);
      }
    }
  }
View Full Code Here

  }
 
  @Override
  public Range getColumns() {
    final Ref ref = getRefs().iterator().next();
    final Worksheet sheet = BookHelper.getSheet(_sheet, ref.getOwnerSheet());
    final int col1 = ref.getLeftCol();
    final int col2 = ref.getRightCol();
    final Book book = (Book) sheet.getWorkbook();
    return new RangeImpl(0, col1, book.getSpreadsheetVersion().getLastRowIndex(), col2, sheet, sheet);
  }
View Full Code Here

  }
 
  @Override
  public Range getRows() {
    final Ref ref = getRefs().iterator().next();
    final Worksheet sheet = BookHelper.getSheet(_sheet, ref.getOwnerSheet());
    final int row1 = ref.getTopRow();
    final int row2 = ref.getBottomRow();
    final Book book = (Book) sheet.getWorkbook();
    return new RangeImpl(row1, 0, row2, book.getSpreadsheetVersion().getLastColumnIndex(), sheet, sheet);
  }
View Full Code Here

 
  @Override
  public Range getDependents() {
    synchronized (_sheet) {
      final Ref ref = getRefs().iterator().next();
      final Worksheet sheet = BookHelper.getSheet(_sheet, ref.getOwnerSheet());
      final int row = ref.getTopRow();
      final int col = ref.getLeftCol();
      final RefSheet refSheet = ref.getOwnerSheet();
      Set<Ref> refs = ((RefSheetImpl)refSheet).getAllDependents(row, col);
      return refs != null && !refs.isEmpty() ?
View Full Code Here

 
  @Override
  public Range getDirectDependents() {
    synchronized (_sheet) {
      final Ref ref = getRefs().iterator().next();
      final Worksheet sheet = BookHelper.getSheet(_sheet, ref.getOwnerSheet());
      final int row = ref.getTopRow();
      final int col = ref.getLeftCol();
      final RefSheet refSheet = ref.getOwnerSheet();
      Set<Ref> refs = ((RefSheetImpl)refSheet).getDirectDependents(row, col);
      return refs != null && !refs.isEmpty() ?
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.