Examples of JSONObj


Examples of org.zkoss.zss.ui.impl.JSONObj

   * for example after user click a outside button or menu item.
   */
  public void focus(){
    //retrieve focus should work when spreadsheet init or after invalidate.
    //so I use response to implement it.
    JSONObj result = new JSONObj();
    result.setData("type", "retrive");
    response("zssfocus"+this.getUuid(),new AuRetrieveFocus(this,result.toString()));
  }
View Full Code Here

Examples of org.zkoss.zss.ui.impl.JSONObj

   * Retrieve client side spreadhsheet focus, move cell focus to position (row,column) and also scroll the cell to into visible view.
   * @param row row of cell to move
   * @param column column of cell to move
   */
  public void focusTo(int row,int column){
    JSONObj result = new JSONObj();
    result.setData("row",row);
    result.setData("column",column);
    result.setData("type", "moveto");
   
    response("zssfocusto"+this.getUuid(),new AuRetrieveFocus(this,result.toString()));
    _focusRect.setLeft(column);
    _focusRect.setRight(column);
    _focusRect.setTop(row);
    _focusRect.setBottom(row);
    _selectionRect.setLeft(column);
View Full Code Here

Examples of org.zkoss.zss.ui.impl.JSONObj

    try{
     
      Utils.setCellText(sheet,row,col,value==null?"":value.toString());
     
     
      JSONObj result = new JSONObj();
      result.setData("r", row);
      result.setData("c", col);
      result.setData("type", "stopedit");
      result.setData("val", "");
     
      responseUpdateCell("stop",token,Utils.getId(sheet),result.toString());
    }catch(RuntimeException x){
      processCancelEditing0(token,sheet,row,col);
      throw x;
    }
  }
View Full Code Here

Examples of org.zkoss.zss.ui.impl.JSONObj

    }
  }

  private void processStartEditing0(String token, Sheet sheet, int row, int col, Object value) {
    try{
      JSONObj result = new JSONObj();
      result.setData("r", row);
      result.setData("c", col);
      result.setData("type", "startedit");
      result.setData("val", value==null?"":value.toString());
      responseUpdateCell("start",token,Utils.getId(sheet),result.toString());
    }catch(RuntimeException x){
      processCancelEditing0(token,sheet,row,col);
      throw x;
    }
  }
View Full Code Here

Examples of org.zkoss.zss.ui.impl.JSONObj

      throw x;
    }
  }
 
  private void processCancelEditing0(String token, Sheet sheet, int row, int col) {
    JSONObj result = new JSONObj();
    result.setData("r", row);
    result.setData("c", col);
    result.setData("type", "canceledit");
    result.setData("val", "");
    responseUpdateCell("cancel",token,Utils.getId(sheet),result.toString());
  }
View Full Code Here

Examples of org.zkoss.zss.ui.impl.JSONObj

    if (maxrows < 1) {
      throw new UiException("maxrow must be greater than 0: " + maxrows);
    }
    if(_maxRows != maxrows) {
      _maxRows = maxrows;
      JSONObj result = new JSONObj();
      result.setData("maxrow", _maxRows);
      if(_rowFreeze>=_maxRows){
        _rowFreeze=_maxRows-1;
      }
      result.setData("rowfreeze", _rowFreeze);
      smartUpdate("maxrow", result.toString());
    }
  }
View Full Code Here

Examples of org.zkoss.zss.ui.impl.JSONObj

      throw new UiException("maxcolumn must be greater than 0: " + maxcols);
    }
   
    if(_maxColumns != maxcols) {
      _maxColumns = maxcols;
      JSONObj result = new JSONObj();
      if(_colFreeze>=_maxColumns){
        _colFreeze=_maxColumns-1;
      }
      result.setData("maxcol", _maxColumns);
      result.setData("colfreeze", _colFreeze);
      smartUpdate("maxcol", result.toString());
    }
   
   
  }
View Full Code Here

Examples of org.zkoss.zss.ui.impl.JSONObj

    _loadedTop = loadResult.loadedTop;
    _loadedBottom = loadResult.loadedBottom;
  }
 
  private String ackResult(){
    JSONObj jresult = new JSONObj();
    jresult.setData("type", "ack");
    return jresult.toString();
  }
View Full Code Here

Examples of org.zkoss.zss.ui.impl.JSONObj

    jresult.setData("type", "ack");
    return jresult.toString();
  }
 
  private String ackError(String message){
    JSONObj jresult = new JSONObj();
    jresult.setData("type","error");
    jresult.setData("message",message);
    return jresult.toString();
  }
View Full Code Here

Examples of org.zkoss.zss.ui.impl.JSONObj

      //updateCell(sheet, left > 0 ? left - 1 : 0, top > 1 ? top - 1 : 0, right + 1, bottom + 1);
      updateCell(sheet, left, top, right, bottom);
    }

    private void updateMergeCell0(Worksheet sheet, MergedRect block, String type) {
      JSONObj result = new JSONObj();
      result.setData("type", type);
      result.setData("id", block.getId());
      int left = block.getLeft();
      int top = block.getTop();
      int right = block.getRight();
      int bottom = block.getBottom();

      // don't check range to ignore update case,
      // because I still need to sync merge cell data to client side

      result.setData("left", left);
      result.setData("top", top);
      result.setData("right", right);
      result.setData("bottom", bottom);

      HeaderPositionHelper helper = Spreadsheet.this
          .getColumnPositionHelper(sheet);
      final int w = helper.getStartPixel(block.getRight() + 1) - helper.getStartPixel(block.getLeft());
      result.setData("width", w);

      HeaderPositionHelper rhelper = Spreadsheet.this
          .getRowPositionHelper(sheet);
      final int h = rhelper.getStartPixel(block.getBottom() + 1) - rhelper.getStartPixel(block.getTop());
      result.setData("height", h);

      /**
       * merge_ -> mergeCell
       */
      response("mergeCell" + Utils.nextUpdateId(), new AuMergeCell(Spreadsheet.this, "", Utils.getSheetUuid(sheet), result.toString()));
    }
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.