Examples of CTCols


Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCols

        }
        return startHidden;
    }

    private int findColInfoIdx(int columnValue, int fromColInfoIdx) {
        CTCols cols = worksheet.getColsArray(0);

        if (columnValue < 0) {
            throw new IllegalArgumentException(
                    "column parameter out of range: " + columnValue);
        }
        if (fromColInfoIdx < 0) {
            throw new IllegalArgumentException(
                    "fromIdx parameter out of range: " + fromColInfoIdx);
        }

        for (int k = fromColInfoIdx; k < cols.sizeOfColArray(); k++) {
            CTCol ci = cols.getColArray(k);

            if (containsColumn(ci, columnValue)) {
                return k;
            }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCols

     *
     * @param idx
     * @return a boolean represented if the column is collapsed
     */
    private boolean isColumnGroupCollapsed(int idx) {
        CTCols cols = worksheet.getColsArray(0);
        int endOfOutlineGroupIdx = findEndOfColumnOutlineGroup(idx);
        int nextColInfoIx = endOfOutlineGroupIdx + 1;
        if (nextColInfoIx >= cols.sizeOfColArray()) {
            return false;
        }
        CTCol nextColInfo = cols.getColArray(nextColInfoIx);

        CTCol col = cols.getColArray(endOfOutlineGroupIdx);
        if (!isAdjacentBefore(col, nextColInfo)) {
            return false;
        }

        return nextColInfo.getCollapsed();
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCols

        String cellRef = cellReference.formatAsString();
        getPane().setTopLeftCell(cellRef);
    }

    public void ungroupColumn(int fromColumn, int toColumn) {
        CTCols cols = worksheet.getColsArray(0);
        for (int index = fromColumn; index <= toColumn; index++) {
            CTCol col = columnHelper.getColumn(index, false);
            if (col != null) {
                short outlineLevel = col.getOutlineLevel();
                col.setOutlineLevel((short) (outlineLevel - 1));
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCols

    }

    protected void write(OutputStream out) throws IOException {

        if(worksheet.sizeOfColsArray() == 1) {
            CTCols col = worksheet.getColsArray(0);
            if(col.sizeOfColArray() == 0) {
                worksheet.setColsArray(null);
            }
        }

        // Now re-generate our CTHyperlinks, if needed
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCols

     */
    public void groupColumn(int fromColumn, int toColumn) {
        groupColumn1Based(fromColumn+1, toColumn+1);
    }
    private void groupColumn1Based(int fromColumn, int toColumn) {
        CTCols ctCols=worksheet.getColsArray(0);
        CTCol ctCol=CTCol.Factory.newInstance();
        ctCol.setMin(fromColumn);
        ctCol.setMax(toColumn);
        this.columnHelper.addCleanColIntoCols(ctCols, ctCol);
        for(int index=fromColumn;index<=toColumn;index++){
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCols

        return outlineLevel;
    }


    private short getMaxOutlineLevelCols(){
        CTCols ctCols=worksheet.getColsArray(0);
        CTCol[]colArray=ctCols.getColArray();
        short outlineLevel=0;
        for(CTCol col: colArray){
            outlineLevel=col.getOutlineLevel()>outlineLevel? col.getOutlineLevel(): outlineLevel;
        }
        return outlineLevel;
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCols

        expandColumn(columnNumber);
      }
    }

    private void collapseColumn(int columnNumber) {
      CTCols cols = worksheet.getColsArray(0);
      CTCol col = columnHelper.getColumn(columnNumber, false);
      int colInfoIx = columnHelper.getIndexOfColumn(cols, col);
      if (colInfoIx == -1) {
        return;
      }
      // Find the start of the group.
      int groupStartColInfoIx = findStartOfColumnOutlineGroup(colInfoIx);

      CTCol columnInfo = cols.getColArray(groupStartColInfoIx);

      // Hide all the columns until the end of the group
      int lastColMax = setGroupHidden(groupStartColInfoIx, columnInfo
          .getOutlineLevel(), true);
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCols

    }

    private void setColumn(int targetColumnIx, Short xfIndex, Integer style,
        Integer level, Boolean hidden, Boolean collapsed) {
      CTCols cols = worksheet.getColsArray(0);
      CTCol ci = null;
      int k = 0;
      for (k = 0; k < cols.sizeOfColArray(); k++) {
        CTCol tci = cols.getColArray(k);
        if (tci.getMin() >= targetColumnIx
            && tci.getMax() <= targetColumnIx) {
          ci = tci;
          break;
        }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCols

     * @param pIdx
     *                the col info index of the start of the outline group
     * @return the column index of the last column in the outline group
     */
    private int setGroupHidden(int pIdx, int level, boolean hidden) {
      CTCols cols = worksheet.getColsArray(0);
      int idx = pIdx;
      CTCol columnInfo = cols.getColArray(idx);
      while (idx < cols.sizeOfColArray()) {
        columnInfo.setHidden(hidden);
        if (idx + 1 < cols.sizeOfColArray()) {
          CTCol nextColumnInfo = cols.getColArray(idx + 1);

          if (!isAdjacentBefore(columnInfo, nextColumnInfo)) {
            break;
          }

View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCols

      return (col.getMax() == (other_col.getMin() - 1));
    }

    private int findStartOfColumnOutlineGroup(int pIdx) {
      // Find the start of the group.
      CTCols cols = worksheet.getColsArray(0);
      CTCol columnInfo = cols.getColArray(pIdx);
      int level = columnInfo.getOutlineLevel();
      int idx = pIdx;
      while (idx != 0) {
        CTCol prevColumnInfo = cols.getColArray(idx - 1);
        if (!isAdjacentBefore(prevColumnInfo, columnInfo)) {
          break;
        }
        if (prevColumnInfo.getOutlineLevel() < level) {
          break;
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.