コード例 #1
0
  private void fillStoredData() {

    if (stepname != null) textStepName.setText(stepname);

    int index =
        addConnectionLine.indexOf(
            meta.getDatabaseMeta() != null ? meta.getDatabaseMeta().getName() : "");
    if (index >= 0) addConnectionLine.select(index);

    if (meta.getDimension() != null) {
      comboDimension.add(meta.getDimension());
      comboDimension.select(0);
    }

    buttonBaseElementsOnly.setSelection(meta.getBaseElementsOnly());

    tableViewFields.table.removeAll();
    if (meta.getLevels().size() > 0) {
      for (PaloDimensionLevel level : meta.getLevels()) {
        tableViewFields.add(
            level.getLevelName(),
            String.valueOf(level.getLevelNumber()),
            level.getFieldName(),
            level.getFieldType());
      }
      tableViewFields.setRowNums();
      tableViewFields.optWidth(true);
    }
  }
コード例 #2
0
 private void doGetLevels() {
   if (buttonBaseElementsOnly.getSelection()) {
     tableViewFields.table.removeAll();
     tableViewFields.add(
         BaseMessages.getString(PKG, "PaloDimInputDialog.BaseElementName"),
         "0",
         comboDimension.getText(),
         "String");
   } else if (comboDimension.getText() != null && comboDimension.getText() != "") {
     try {
       if (addConnectionLine.getText() != null) {
         DatabaseMeta dbMeta = transMeta.findDatabase(addConnectionLine.getText());
         if (dbMeta != null) {
           PaloDimInputData data = new PaloDimInputData(dbMeta);
           tableViewFields.table.removeAll();
           data.helper.connect();
           List<PaloDimensionLevel> levels =
               data.helper.getDimensionLevels(comboDimension.getText());
           for (int i = 0; i < levels.size(); i++) {
             PaloDimensionLevel level = levels.get(i);
             tableViewFields.add(
                 level.getLevelName(),
                 String.valueOf(level.getLevelNumber()),
                 level.getFieldName());
           }
           tableViewFields.setRowNums();
           tableViewFields.optWidth(true);
           data.helper.disconnect();
         }
       }
     } catch (Exception ex) {
       new ErrorDialog(
           shell,
           BaseMessages.getString("System.Dialog.GetFieldsFailed.Title"),
           BaseMessages.getString("System.Dialog.GetFieldsFailed.Message"),
           ex);
     }
   } else {
     new ErrorDialog(
         shell,
         BaseMessages.getString("System.Dialog.GetFieldsFailed.Title"),
         BaseMessages.getString("System.Dialog.GetFieldsFailed.Message"),
         new Exception(
             BaseMessages.getString(PKG, "PaloDimInputDialog.SelectDimensionFirstError")));
   }
 }