Examples of GridHandle


Examples of org.eclipse.birt.report.model.api.GridHandle

    table.setProperty("repeatHeader", "true");
    return table;
  }

  private static GridHandle createSampleGrid(String name, int columnNum, int rowNum, boolean border) throws SemanticException {
    GridHandle grid = createGrid(name, columnNum, rowNum);

    RowHandle headerRow = (RowHandle) grid.getRows().get(0);

    for (int i = 0; i < headerRow.getCells().getCount(); i++) {
      CellHandle cell = (CellHandle) headerRow.getCells().get(i);
      if (border) {
        setBorders(cell);
      }
      LabelHandle label = createLabel("Column " + i);
      cell.getContent().add(label);
    }

    RowHandle detailRow = null;
    for (int i = 0; i < rowNum; i++) {
      detailRow = createRow(columnNum);
      for (int j = 0; j < grid.getColumnCount(); j++) {
        CellHandle cell = (CellHandle) detailRow.getCells().get(j);
        if (border) {
          setBorders(cell);
        }
        LabelHandle label = createLabel("Cell " + i + ":" + j);
        cell.getContent().add(label);
      }
      grid.getElement().add(detailRow.getElement(), GridItem.ROW_SLOT);
    }

    return grid;
  }
View Full Code Here

Examples of org.eclipse.birt.report.model.api.GridHandle

    // container.add(table);
  }

  @SuppressWarnings("unused")
  public static void test04() throws SemanticException, IOException {
    GridHandle gridHandle = (GridHandle) reportDesignHandle.findElement("myGrid");
    int rowCount = gridHandle.getRows().getCount(); // = 1
    System.out.println("rowCount = " + rowCount);
    int colCount = gridHandle.getColumns().getCount(); // = 1
    // System.out.println("colCount = " + colCount);
    // ############# create row
    RowHandle row = reportDesignHandle.getElementFactory().newTableRow();
    DesignElement deRow = row.getElement();
    gridHandle.getElement().add(deRow, GridItem.ROW_SLOT);

    int rowCount2 = gridHandle.getRows().getCount(); // = 2
    System.out.println("rowCount2 = " + rowCount2);
    int colCount2 = gridHandle.getColumns().getCount(); // = 1
    // System.out.println("colCount2 = " + colCount2);

    // create label for cell in row 1 / column 0
    LabelHandle lblHandle = elementFactory.newLabel(null);
    lblHandle.setText("Cell x:x");
    CellHandle cell = gridHandle.getCell(1, 0);
    cell.getContent().add(lblHandle);

    // ############# create column
    ColumnHandle column = reportDesignHandle.getElementFactory().newTableColumn();
    DesignElement deColumn = column.getElement();
    gridHandle.getElement().add(deColumn, GridItem.COLUMN_SLOT);

    int rowCount3 = gridHandle.getRows().getCount(); // = 2
    int colCount3 = gridHandle.getColumns().getCount(); // = 2

    // create label for cell in row 0 / column 1
    LabelHandle lblHandle2 = elementFactory.newLabel(null);
    lblHandle.setText("Cell y:y");
    // this.setStyle(lblHandle2, "borderSolidThin");
    CellHandle cell2 = gridHandle.getCell(0, 1);
    cell2.getContent().add(lblHandle2);
    System.out.println("Finished");
  }
View Full Code Here

Examples of org.eclipse.birt.report.model.api.GridHandle

    cell2.getContent().add(lblHandle2);
    System.out.println("Finished");
  }

  public static void test06() throws Exception {
    GridHandle gridHandle = (GridHandle) reportDesignHandle.findElement("myGrid5");
    TableHandle table = createTable(30);
    CellHandle cell2 = gridHandle.getCell(0, 1);
    cell2.getContent().add(table);
    System.out.println("Finished");
  }
View Full Code Here

Examples of org.eclipse.birt.report.model.api.GridHandle

    cell2.getContent().add(table);
    System.out.println("Finished");
  }

  public static void test08() throws Exception {
    GridHandle gridHandle = (GridHandle) reportDesignHandle.findElement("outerGrid");
    gridHandle.getCell(0, 1).drop();
    gridHandle.getCell(1, 1).drop();
    gridHandle.getCell(2, 1).drop();
    System.out.println("Finished");
  }
View Full Code Here

Examples of org.eclipse.birt.report.model.api.GridHandle

        e.printStackTrace();
      }

      // create a new grid element, and set the width to 100 percent of
      // the page design
      GridHandle grid = efactory.newGridItem(null, 1, 1);
      grid.setWidth("100%");

      // Add the grid to the report body
      design.getBody().add(grid);

      // create a new row
      RowHandle row = (RowHandle) grid.getRows().get(0);

      // Create a label and add it to the first cell.
      LabelHandle label = efactory.newLabel("Hello, world!");
      label.setText("Hello, World!");
      CellHandle cell = (CellHandle) row.getCells().get(0);
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.