コード例 #1
0
  @Override
  public void initComposite() {
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 1;
    this.setLayout(gridLayout);

    this.descriptionText =
        CompositeFactory.createTextArea(null, this, "label.table.description", -1, 400, 1, true);

    this.descriptionText.setText(Format.null2blank(copyData.getDescription()));
  }
コード例 #2
0
  public void setTableData(HSSFWorkbook workbook, HSSFSheet sheet, ERTable table) {
    POIUtils.replace(
        sheet,
        KEYWORD_LOGICAL_TABLE_NAME,
        this.getValue(this.keywordsValueMap, KEYWORD_LOGICAL_TABLE_NAME, table.getLogicalName()));

    POIUtils.replace(
        sheet,
        KEYWORD_PHYSICAL_TABLE_NAME,
        this.getValue(this.keywordsValueMap, KEYWORD_PHYSICAL_TABLE_NAME, table.getPhysicalName()));

    POIUtils.replace(
        sheet,
        KEYWORD_TABLE_DESCRIPTION,
        this.getValue(this.keywordsValueMap, KEYWORD_TABLE_DESCRIPTION, table.getDescription()));

    POIUtils.replace(
        sheet,
        KEYWORD_TABLE_CONSTRAINT,
        this.getValue(this.keywordsValueMap, KEYWORD_TABLE_CONSTRAINT, table.getConstraint()));

    CellLocation cellLocation = POIUtils.findCell(sheet, FIND_KEYWORDS_OF_COLUMN);

    if (cellLocation != null) {
      int rowNum = cellLocation.r;
      HSSFRow templateRow = sheet.getRow(rowNum);

      if (this.columnTemplate == null) {
        this.columnTemplate = this.loadColumnTemplate(workbook, sheet, cellLocation);
      }

      int order = 1;

      for (NormalColumn normalColumn : table.getExpandedColumns()) {
        HSSFRow row = POIUtils.insertRow(sheet, rowNum++);
        this.setColumnData(this.keywordsValueMap, columnTemplate, row, normalColumn, table, order);
        order++;
      }

      this.setCellStyle(
          columnTemplate,
          sheet,
          cellLocation.r,
          rowNum - cellLocation.r,
          templateRow.getFirstCellNum());
    }

    CellLocation fkCellLocation = POIUtils.findCell(sheet, FIND_KEYWORDS_OF_FK_COLUMN);

    if (fkCellLocation != null) {
      int rowNum = fkCellLocation.r;
      HSSFRow templateRow = sheet.getRow(rowNum);

      if (this.fkColumnTemplate == null) {
        this.fkColumnTemplate = this.loadColumnTemplate(workbook, sheet, fkCellLocation);
      }

      int order = 1;

      for (NormalColumn normalColumn : table.getExpandedColumns()) {
        if (normalColumn.isForeignKey()) {
          HSSFRow row = POIUtils.insertRow(sheet, rowNum++);
          this.setColumnData(
              this.keywordsValueMap, this.fkColumnTemplate, row, normalColumn, table, order);
          order++;
        }
      }

      this.setCellStyle(
          this.fkColumnTemplate,
          sheet,
          fkCellLocation.r,
          rowNum - fkCellLocation.r,
          templateRow.getFirstCellNum());
    }

    this.setIndexMatrix(workbook, sheet, table);
    this.setComplexUniqueKeyMatrix(workbook, sheet, table);
  }