Package org.zkoss.zss.engine

Examples of org.zkoss.zss.engine.Ref


        bottom = lastrow;
      }
      org.zkoss.zk.ui.event.Events.postEvent(new CellSelectionEvent(Events.ON_CELL_CHANGE, Spreadsheet.this, sheet, CellSelectionEvent.SELECT_CELLS, left, top, right,  bottom));
    }
    private void onRangeInsert(SSDataEvent event) {
      final Ref rng = event.getRef();
      final Worksheet sheet = getSheet(rng);
      if (!getSelectedSheet().equals(sheet))
        return;
      _updateCellId.next();
      if (rng.isWholeColumn()) {
        final int left = rng.getLeftCol();
        final int right = rng.getRightCol();
        ((ExtraCtrl) getExtraCtrl()).insertColumns(sheet, left, right - left + 1);
      } else if (rng.isWholeRow()) {
        final int top = rng.getTopRow();
        final int bottom = rng.getBottomRow();
        ((ExtraCtrl) getExtraCtrl()).insertRows(sheet, top, bottom - top + 1);
      }
    }
View Full Code Here


        final int bottom = rng.getBottomRow();
        ((ExtraCtrl) getExtraCtrl()).insertRows(sheet, top, bottom - top + 1);
      }
    }
    private void onRangeDelete(SSDataEvent event) {
      final Ref rng = event.getRef();
      final Worksheet sheet = getSheet(rng);
      if (!getSelectedSheet().equals(sheet))
        return;
      _updateCellId.next();
      if (rng.isWholeColumn()) {
        final int left = rng.getLeftCol();
        final int right = rng.getRightCol();
        ((ExtraCtrl) getExtraCtrl()).removeColumns(sheet, left,
            right - left + 1);
      } else if (rng.isWholeRow()) {
        final int top = rng.getTopRow();
        final int bottom = rng.getBottomRow();
        ((ExtraCtrl) getExtraCtrl()).removeRows(sheet, top, bottom - top + 1);
      }
    }
View Full Code Here

        final int bottom = rng.getBottomRow();
        ((ExtraCtrl) getExtraCtrl()).removeRows(sheet, top, bottom - top + 1);
      }
    }
    private void onMergeChange(SSDataEvent event) {
      final Ref rng = event.getRef();
      final Ref orng = event.getOriginalRef();
      final Worksheet sheet = getSheet(orng);
      if (!getSelectedSheet().equals(sheet))
        return;
      ((ExtraCtrl) getExtraCtrl()).updateMergeCell(sheet,
          rng.getLeftCol(), rng.getTopRow(), rng.getRightCol(), rng.getBottomRow(),
          orng.getLeftCol(), orng.getTopRow(), orng.getRightCol(), orng.getBottomRow());
    }
View Full Code Here

      ((ExtraCtrl) getExtraCtrl()).updateMergeCell(sheet,
          rng.getLeftCol(), rng.getTopRow(), rng.getRightCol(), rng.getBottomRow(),
          orng.getLeftCol(), orng.getTopRow(), orng.getRightCol(), orng.getBottomRow());
    }
    private void onMergeAdd(SSDataEvent event) {
      final Ref rng = event.getRef();
      final Worksheet sheet = getSheet(rng);
      if (!getSelectedSheet().equals(sheet))
        return;
      ((ExtraCtrl) getExtraCtrl()).addMergeCell(sheet,
          rng.getLeftCol(), rng.getTopRow(), rng.getRightCol(), rng.getBottomRow());

    }
View Full Code Here

      ((ExtraCtrl) getExtraCtrl()).addMergeCell(sheet,
          rng.getLeftCol(), rng.getTopRow(), rng.getRightCol(), rng.getBottomRow());

    }
    private void onMergeDelete(SSDataEvent event) {
      final Ref orng = event.getRef();
      final Worksheet sheet = getSheet(orng);
      if (!getSelectedSheet().equals(sheet))
        return;
      ((ExtraCtrl) getExtraCtrl()).deleteMergeCell(sheet, orng.getLeftCol(),
          orng.getTopRow(), orng.getRightCol(), orng.getBottomRow());
    }
View Full Code Here

      ((ExtraCtrl) getExtraCtrl()).deleteMergeCell(sheet, orng.getLeftCol(),
          orng.getTopRow(), orng.getRightCol(), orng.getBottomRow());
    }
    private void onSizeChange(SSDataEvent event) {
      //TODO shall pass the range over to the client side and let client side do it; rather than iterate each column and send multiple command
      final Ref rng = event.getRef();
      final Worksheet sheet = getSheet(rng);
      if (!getSelectedSheet().equals(sheet))
        return;
      if (rng.isWholeColumn()) {
        final int left = rng.getLeftCol();
        final int right = rng.getRightCol();
        for (int c = left; c <= right; ++c) {
          updateColWidth(sheet, c);
        }
        final Rect rect = ((SpreadsheetCtrl) getExtraCtrl()).getVisibleRect();
        syncFriendFocusesPosition(left, rect.getTop(), rect.getRight(), rect.getBottom());
      } else if (rng.isWholeRow()) {
        final int top = rng.getTopRow();
        final int bottom = rng.getBottomRow();
        for (int r = top; r <= bottom; ++r) {
          updateRowHeight(sheet, r);
        }
        final Rect rect = ((SpreadsheetCtrl) getExtraCtrl()).getVisibleRect();
        syncFriendFocusesPosition(rect.getLeft(), top, rect.getRight(), rect.getBottom());
View Full Code Here

        final Rect rect = ((SpreadsheetCtrl) getExtraCtrl()).getVisibleRect();
        syncFriendFocusesPosition(rect.getLeft(), top, rect.getRight(), rect.getBottom());
      }
    }
    private void onBtnChange(SSDataEvent event) {
      final Ref rng = event.getRef();
      final Worksheet sheet = getSheet(rng);
      if (!getSelectedSheet().equals(sheet))
        return;
      updateAutoFilter(sheet.getAutoFilter());
    }
View Full Code Here

      if (!getSelectedSheet().equals(sheet))
        return;
      updateAutoFilter(sheet.getAutoFilter());
    }
    private void onDisplayGridlines(SSDataEvent event) {
      final Ref rng = event.getRef();
      final Worksheet sheet = getSheet(rng);
      if (!getSelectedSheet().equals(sheet))
        return;
      setDisplayGridlines(event.isShow());
    }
View Full Code Here

      if (!getSelectedSheet().equals(sheet))
        return;
      setDisplayGridlines(event.isShow());
    }
    private void onProtectSheet(SSDataEvent event) {
      final Ref rng = event.getRef();
      final Worksheet sheet = getSheet(rng);
      if (!getSelectedSheet().equals(sheet))
        return;
      setProtectSheet(event.getProtect());
    }
View Full Code Here

  }

  @Override
  public Hyperlink getHyperlink() {
    synchronized(_sheet) {
      Ref ref = _refs != null && !_refs.isEmpty() ? _refs.iterator().next() : null;
      if (ref != null) {
        final int tRow = ref.getTopRow();
        final int lCol = ref.getLeftCol();
        final RefSheet refSheet = ref.getOwnerSheet();
        final Cell cell = getCell(tRow, lCol, refSheet);
        if (cell != null)
          return BookHelper.getHyperlink(cell);
      }
      return null;
View Full Code Here

TOP

Related Classes of org.zkoss.zss.engine.Ref

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.