Package org.zkoss.zss.model

Examples of org.zkoss.zss.model.Worksheet


    String act = (String) data.get("act");
    if ("toolbar".equals(tag)) {
      spreadsheet.getActionHandler().dispatch(act, data);
    } else if ("sheet".equals(tag) && spreadsheet.getBook() != null) {
      String sheetId = (String) data.get("sheetId");
      Worksheet sheet = Utils.getSheetByUuid(spreadsheet.getBook(), sheetId);
      if (sheet != null) {
        processSheet(act, data, sheet, spreadsheet);
      }
    }
  }
View Full Code Here


      int numSheet = book.getNumberOfSheets();
      Ranges.range(sheet).createSheet(prefix + " " + (numSheet + 1));
    } else if ("delete".equals(action)) {
      int numSheet = book.getNumberOfSheets();
      if (numSheet > 1) {
        Worksheet sel = null;
        int index = book.getSheetIndex(sheet);
        if (index == numSheet - 1) {//delete last sheet, move select sheet left
          sel = book.getWorksheetAt(index - 1);
        } else { //move sheet right
          sel = book.getWorksheetAt(index + 1);
        }
        Ranges.range(sheet).deleteSheet();
        spreadsheet.setSelectedSheet(sel.getSheetName());
      }
    } else if ("rename".equals(action)) {
      String name = (String) data.get("name");
      Ranges.range(sheet).setSheetName(name);
    } else if ("protect".equals(action)) {
View Full Code Here

      throw new UiException(MZk.ILLEGAL_REQUEST_WRONG_DATA, new Object[] {Objects.toString(data), this });
    String token = (String) data.get("token");
    String sheetId = (String) data.get("sheetId");
    String clienttxt = (String) data.get("clienttxt");

    Worksheet sheet = ((Spreadsheet) comp).getSelectedSheet();
    if (!Utils.getSheetUuid(sheet).equals(sheetId)) {
      return;
    }
    EditboxEditingEvent event = new EditboxEditingEvent(org.zkoss.zss.ui.event.Events.ON_EDITBOX_EDITING, comp, sheet, clienttxt);
    Events.postEvent(event);
View Full Code Here

    }
  }
 
  private void processTopHeader(Spreadsheet spreadsheet, Map data){
    String sheetId = (String) data.get("sheetId");
    Worksheet sheet = spreadsheet.getSelectedSheet();
    if(!Utils.getSheetUuid(sheet).equals(sheetId)) {
      return;
    }
    String event = (String) data.get("event");
    int index = (Integer) data.get("index");
View Full Code Here

   
  }
 
  private void processLeftHeader(Spreadsheet spreadsheet, Map data){
    String sheetId = (String) data.get("sheetId");
    Worksheet sheet = spreadsheet.getSelectedSheet();
    if(!Utils.getSheetUuid(sheet).equals(sheetId)) {
      return;
    }
    String event = (String) data.get("event");
    int index = (Integer) data.get("index");
View Full Code Here

    int row = (Integer) data.get("row");
    int col = (Integer) data.get("col");
    String clienttxt = (String) data.get("clienttxt");
    String type = (String) data.get("type");

    Worksheet sheet = ((Spreadsheet) comp).getSelectedSheet();
    if (!Utils.getSheetUuid(sheet).equals(sheetId))
      return;
   
    Cell cell = Utils.getCell(sheet, row, col);
    // You can call getEditText(), setEditText(), getText().
View Full Code Here

    if (data == null || data.size() != 6)
      throw new UiException(MZk.ILLEGAL_REQUEST_WRONG_DATA, new Object[] {Objects.toString(data), this});
     
    String sheetId= (String) data.get("sheetId");
   
    Worksheet sheet = ((Spreadsheet)comp).getSelectedSheet();
    if(!Utils.getSheetUuid(sheet).equals(sheetId))
      return;
   
    //TODO request shall send back maxcol/maxrow (do it in client side)
    final Book book = (Book) sheet.getWorkbook();
    final int maxcol = book.getSpreadsheetVersion().getLastColumnIndex();
    final int maxrow = book.getSpreadsheetVersion().getLastRowIndex();
    int action = (Integer) data.get("action");
    int left = (Integer) data.get("left");
    int top = (Integer) data.get("top");
View Full Code Here

    if (data == null || data.size() != 6)
      throw new UiException(MZk.ILLEGAL_REQUEST_WRONG_DATA,
        new Object[] {Objects.toString(data), this});
   
    String widgetType = (String) data.get("wgt");
    Worksheet sheet = ((Spreadsheet) comp).getSelectedSheet();
    if ("chart".equals(widgetType)) {
      processChart(sheet, data);
    } else if ("image".equals(widgetType)) {
      processPicture(sheet, data);
    }
View Full Code Here

    int left = (Integer) data.get("left");
    int right = (Integer) data.get("right");
    int top = (Integer) data.get("top");
    int bottom = (Integer) data.get("bottom");
   
    Worksheet sheet = spreadsheet.getSelectedSheet();
   
    if (sheetId.equals(((SheetCtrl)sheet).getUuid())) {
      final SpreadsheetCtrl spreadsheetCtrl = ((SpreadsheetCtrl) spreadsheet.getExtraCtrl());
     
      JSONObject mainBlock = spreadsheetCtrl.getRangeAttrs(sheet, SpreadsheetCtrl.Header.BOTH, SpreadsheetCtrl.CellAttribute.ALL, left, top, right, bottom);
View Full Code Here

    final Map data = (Map) request.getData();
    if (data == null || data.size() != 9)
      throw new UiException(MZk.ILLEGAL_REQUEST_WRONG_DATA, new Object[] {Objects.toString(data), this});

    String sheetId = (String) data.get("sheetId");
    Worksheet sheet = ((Spreadsheet)comp).getSelectedSheet();
    if(!Utils.getSheetUuid(sheet).equals(sheetId)) {
      return;
    }
    String type = (String) data.get("type");//x offset against spreadsheet
    int shx = (Integer) data.get("shx");//x offset against spreadsheet
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.