예제 #1
0
 private void setComboBox(Table table, ComponentRole value, List componentsToMap) {
   final TableItem item = new TableItem(table, SWT.NONE);
   item.setText(new String[] {value.getFullName(), value.getAbstractInfo()});
   item.setData(value);
   TableEditor editor = new TableEditor(table);
   final CCombo comboRole = new CCombo(table, SWT.READ_ONLY);
   GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
   gd.widthHint = 200;
   comboRole.setLayoutData(gd);
   int j = 0;
   for (j = 0; j < componentsToMap.size(); j++) {
     ComponentRole c = (ComponentRole) componentsToMap.get(j);
     comboRole.add(c.getFullName());
     comboRole.setData(String.valueOf(j), c);
     auxiliarTable.put(comboRole, c, new Integer(j));
   }
   if (value.getAbstractInfo().equals(ComponentRole.standardComponent)) {
     comboRole.add(value.getFullName());
     comboRole.setData(String.valueOf(j), value);
     comboRole.select(j);
     auxiliarTable.put(comboRole, value, new Integer(j));
   } else {
     comboRole.add(
         Messages.getString(
             "org.isistan.flabot.edit.ucmeditor.dialogs.FamilyManagerDialog.noneRole")); //$NON-NLS-1$
     comboRole.setData("None", "None"); // $NON-NLS-1$ //$NON-NLS-2$
     comboRole.select(j);
   }
   editor.grabHorizontal = true;
   editor.setEditor(comboRole, item, 2);
   editorsTable.put(item, editor);
   combosTable.put(item, comboRole);
 }
  private TableItem bindPublishEventAttribute(PublishEventMediatorAttribute attribute) {
    TableItem item = new TableItem(publishEventAttributeTable, SWT.NONE);
    if (attribute
        .getAttributeValueType()
        .getLiteral()
        .equals(AttributeValueType.STRING.getLiteral())) {
      item.setText(
          new String[] {
            attribute.getAttributeName(),
            attribute.getAttributeValue(),
            attribute.getAttributeValueType().getLiteral()
          });
    }
    if (attribute
        .getAttributeValueType()
        .getLiteral()
        .equals(AttributeValueType.EXPRESSION.getLiteral())) {
      item.setText(
          new String[] {
            attribute.getAttributeName(),
            attribute.getAttributeExpression().getPropertyValue(),
            attribute.getAttributeValueType().getLiteral()
          });
      item.setData(
          EXPRESSION_DATA,
          EsbFactory.eINSTANCE.copyNamespacedProperty(attribute.getAttributeExpression()));
    }

    item.setData(attribute);
    return item;
  }
  /** Copy information from the meta-data input to the dialog fields. */
  public void getData() {
    super.getData();

    hasOneTemporalField = ((LoadSatMeta) inputMeta).getFromDateColumn() != null;
    enableFields();

    if (inputMeta.getFields() != null) {
      for (int i = 0; i < inputMeta.getFields().length; i++) {
        TableItem item = wKey.table.getItem(i);
        if (inputMeta.getCols()[i] != null) {
          item.setText(1, inputMeta.getCols()[i]);
        }
        if (inputMeta.getFields()[i] != null) {
          item.setText(2, inputMeta.getFields()[i]);
        }
        if (inputMeta.getTypes()[i] != null) {
          item.setText(3, inputMeta.getTypes()[i]);
        }
      }
    }

    if (((LoadSatMeta) inputMeta).getToDateColumn() != null) {
      wcbToDateCol.setText(((LoadSatMeta) inputMeta).getToDateColumn());
    }
    if (((LoadSatMeta) inputMeta).getToDateMaxFlag() != null) {
      wToDateMax.setText(((LoadSatMeta) inputMeta).getToDateMaxFlag());
    }
    wbIsIdempotentSat.setSelection(((LoadSatMeta) inputMeta).isIdempotent());

    wKey.setRowNums();
    wKey.optWidth(true);

    wStepname.selectAll();
    wStepname.setFocus();
  }
  private void listRoles() {
    // clear table.
    userRolesTable.removeAll();

    if (StringUtils.isNotBlank(serverUrlText.getText())
        && StringUtils.isNotBlank(userNameText.getText())
        && StringUtils.isNotBlank(passwordText.getText())) {
      UserManagerUtils.getInstance()
          .init(
              serverUrlText.getText().trim(),
              userNameText.getText().trim(),
              passwordText.getText().trim());
      String filter;
      if (StringUtils.isNotBlank(roleNamePatternText.getText())) {
        filter = roleNamePatternText.getText().trim();
      } else {
        filter = "*";
      }

      String[] roles = UserManagerUtils.getInstance().getRoles(filter, 1000);

      if (roles != null && roles.length > 0) {
        for (String role : roles) {
          if (!role.equals("false")) {
            TableItem item = new TableItem(userRolesTable, SWT.NONE);
            item.setText(new String[] {"", role});
          }
        }
      }
    }
  }
예제 #5
0
 /**
  * Fills the given table with constraints.
  *
  * @param constraints the constraints in string representation
  * @param table the table to be filled
  */
 static void fillTable(String[] constraints, TableViewer table) {
   Table tab = table.getTable();
   for (int c = 0; c < constraints.length; c++) {
     TableItem item = new TableItem(tab, SWT.NULL);
     item.setText(constraints[c]);
   }
 }
    public void widgetSelected(SelectionEvent e) {
      // Get the selected item and get the associated path.
      // open a PathSettingDialog to modify the path.
      TableItem selected = fTable.getSelection()[0];
      AVRPathManager path = (AVRPathManager) selected.getData();

      if (e.getSource() == fEditButton) {
        PathSettingDialog dialog = new PathSettingDialog(fTable.getShell(), path);
        if (dialog.open() == Window.OK) {
          // OK Button selected:
          // get the modified Path, keep it and update this Editor
          path = dialog.getResult();
        }
      } else if (e.getSource() == fRescanButton) {
        // force a search for the current system path.
        // This may take a while so we display a Wait cursor
        final AVRPathManager finalpath = path;
        BusyIndicator.showWhile(
            fTable.getDisplay(),
            new Runnable() {
              public void run() {
                finalpath.getSystemPath(true);
              }
            });
      }
      selected.setData(path);
      updateTableItem(selected);
      refreshValidState();
    }
예제 #7
0
  private void showFiles(File file) {
    TableItem tableItem = null;
    String fileName = null;
    String filePath = null;
    float fileSize = -1;
    String columns[] = new String[3];

    if (file.canRead() && file.canExecute() && file.isDirectory()) {
      File currentFile[] = file.listFiles();
      for (int i = 0; i < currentFile.length; i++) {
        if (currentFile[i].isFile()) {
          tableItem = new TableItem(table, SWT.NONE);
          fileName = currentFile[i].getName();
          filePath = currentFile[i].getPath();
          fileSize = currentFile[i].length();
          columns[0] = fileName;
          if (fileSize >= 512) {
            columns[1] = fileSize / 1024 + "KB";
          } else {
            columns[1] = fileSize + "Bytes";
          }
          columns[2] = filePath;
          tableItem.setText(columns);
          table.setLinesVisible(true);
        }
      }
    }
  }
예제 #8
0
  private void ok() {
    if (Const.isEmpty(wStepname.getText())) {
      return;
    }

    stepname = wStepname.getText(); // return value

    if (transMeta.findDatabase(wConnection.getText()) == null) {
      int answer = showDatabaseWarning(true);
      if (answer == SWT.CANCEL) {
        return;
      }
    }

    // check tablecount
    Set<String> tables = new HashSet<String>();
    int nrParameters = wOutput.nrNonEmpty();
    for (int i = 0; i < nrParameters; i++) {
      TableItem item = wOutput.getNonEmpty(i);
      String tableName = item.getText(3);
      tables.add(tableName);
    }
    if (tables.size() > 1) {
      int answer = showMultipleOutputTablesWarning(true);
      if (answer == SWT.CANCEL) {
        return;
      }
    }

    getInfo(input);

    dispose();
  }
  // Edit the properties of the specified actuator
  public void editActuatorProperties(Display display) {
    ActuatorsPropertiesShell edit =
        new ActuatorsPropertiesShell(table.getItem(table.getSelectionIndex()), display);

    if (edit.isConfirm()) {
      Device auxActuator = actuators.get(table.getSelectionIndex());

      TableItem aux = table.getItem(table.getSelectionIndex());
      aux.setText(1, edit.getActuator());
      aux.setText(2, edit.getProtocol());
      aux.setText(3, edit.getPriority());
      Button bt = (Button) aux.getData("periodic");
      bt.setSelection(edit.getPeriodic());
      aux.setText(5, edit.getPeriod());

      auxActuator.setName(edit.getActuator());
      auxActuator.setProtocol(edit.getProtocol());
      auxActuator.setPriority(Integer.valueOf(edit.getPriority()));
      auxActuator.setPeriodic(edit.getPeriodic());
      auxActuator.setPeriod(Integer.valueOf(edit.getPeriod()));
      auxActuator.inputs.set(0, edit.getSignal());

      actuators.set(table.getSelectionIndex(), auxActuator);

      checkSpecified();
    }
  }
예제 #10
0
 private void updateItem(TableItem item) {
   TeaVMProfile profile = (TeaVMProfile) item.getData();
   item.setText(0, profile.getName());
   item.setText(1, profile.getTargetDirectory());
   item.setText(2, profile.getTargetFileName());
   item.setChecked(profile.isEnabled());
 }
  private void getInfo(StepsMetricsMeta in) {
    stepname = wStepname.getText(); // return value
    int nrsteps = wFields.nrNonEmpty();
    in.allocate(nrsteps);
    for (int i = 0; i < nrsteps; i++) {
      TableItem ti = wFields.getNonEmpty(i);
      StepMeta tm = transMeta.findStep(ti.getText(1));
      // CHECKSTYLE:Indentation:OFF
      if (tm != null) {
        in.getStepName()[i] = tm.getName();
        in.getStepCopyNr()[i] = "" + Const.toInt(ti.getText(2), 0);
        in.getStepRequired()[i] = in.getRequiredStepsCode(ti.getText(3));
      }
    }

    in.setStepNameFieldName(wStepnameField.getText());
    in.setStepIdFieldName(wStepidField.getText());
    in.setStepLinesInputFieldName(wLinesinputField.getText());
    in.setStepLinesOutputFieldName(wLinesoutputField.getText());
    in.setStepLinesReadFieldName(wLinesreadField.getText());
    in.setStepLinesWrittenFieldName(wLineswrittenField.getText());
    in.setStepLinesUpdatedFieldName(wLinesupdatedField.getText());
    in.setStepLinesErrorsFieldName(wLineserrorsField.getText());
    in.setStepSecondsFieldName(wSecondsField.getText());
  }
  /**
   * This helper method puts the step configuration stored in the meta object and puts it into the
   * dialog controls.
   */
  private void populateDialog() {
    wRemoveBlanks.setSelection(meta.isConsecutiveDelimsAsOne());
    if (meta.getSourceFields() != null) {
      for (int i = 0; i < meta.getSourceFields().length; i++) {
        TableItem item = wGroup.table.getItem(i);
        if (meta.getSourceFields()[i] != null) {
          item.setText(1, meta.getSourceFields()[i]);
        }
        if (meta.getSourceDelims()[i] != null) {
          item.setText(2, meta.getSourceDelims()[i]);
        }
        if (meta.getOutputFields()[i] != null) {
          item.setText(3, meta.getOutputFields()[i]);
        }
        if (meta.getOutputDelims()[i] != null) {
          item.setText(4, meta.getOutputDelims()[i]);
        }
      }
    }

    wGroup.setRowNums();
    wGroup.optWidth(true);

    wStepname.selectAll();
    wStepname.setFocus();
  }
예제 #13
0
  protected void getParamsData() {
    wParams.clearAll(false);
    ArrayList<String> paramNames = new ArrayList<String>(configuration.getParams().keySet());
    Collections.sort(paramNames);

    for (int i = 0; i < paramNames.size(); i++) {
      String paramName = paramNames.get(i);
      String paramValue = configuration.getParams().get(paramName);
      String defaultValue;
      try {
        defaultValue = abstractMeta.getParameterDefault(paramName);
      } catch (UnknownParamException e) {
        defaultValue = "";
      }

      String description;
      try {
        description = abstractMeta.getParameterDescription(paramName);
      } catch (UnknownParamException e) {
        description = "";
      }

      TableItem tableItem = new TableItem(wParams.table, SWT.NONE);
      tableItem.setText(1, paramName);
      tableItem.setText(2, Const.NVL(defaultValue, ""));
      tableItem.setText(3, Const.NVL(paramValue, ""));
      tableItem.setText(4, Const.NVL(description, ""));
    }
    wParams.removeEmptyRows();
    wParams.setRowNums();
    wParams.optWidth(true);
  }
예제 #14
0
 private void setComboBoxToEvents(Table table, ConditionEvent value, List events) {
   final TableItem item = new TableItem(table, SWT.NONE);
   item.setText(new String[] {value.getName(), value.getDescription()});
   item.setData(value);
   TableEditor editor = new TableEditor(table);
   final CCombo comboRole = new CCombo(table, SWT.READ_ONLY);
   GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
   gd.widthHint = 200;
   comboRole.setLayoutData(gd);
   int k = 0;
   for (int j = 0; j < events.size(); j++) {
     ConditionEvent c = (ConditionEvent) events.get(j);
     comboRole.add(c.getName());
     comboRole.setData(String.valueOf(j), c);
     auxiliarTableToEvent.put(comboRole, c, new Integer(j));
     if (value.equals(c)) {
       k = j;
     }
   }
   comboRole.select(k);
   editor.grabHorizontal = true;
   editor.setEditor(comboRole, item, 2);
   editorsTableToEvent.put(item, editor);
   combosTableToEvent.put(item, comboRole);
 }
  public void refreshModuleList() {
    if (!pageReady) {
      new UIJob(I18n.get("job")) {
        @Override
        public IStatus runInUIThread(IProgressMonitor monitor) {
          refreshModuleList();
          return Status.OK_STATUS;
        }
      }.schedule();
      return;
    }

    modulesTable.removeAll();

    for (ImportedModule module : parent.getConfiguration().getModules()) {
      TableItem item = new TableItem(modulesTable, NONE);
      item.setText(module.toString());
      System.out.println(module.toString());

      /*
       * TODO: populate table with module names
       */
    }

    if (parent.getConfiguration().getModules().length > 0) {
      setPageComplete(true);
    }
  }
예제 #16
0
  @SuppressWarnings("unchecked")
  public static void onLoaded(ActionContext actionContext) {
    Thing self = (Thing) actionContext.get("self");
    Table table = (Table) self.get("table");

    // 先清空数据
    table.removeAll();

    Thing store = (Thing) actionContext.get("store");
    List<Map<String, Object>> records = (List<Map<String, Object>>) store.get("records");
    if (records != null) {
      for (Map<String, Object> record : records) {
        List<String> texts = new ArrayList<String>();
        for (Thing column : (List<Thing>) self.get("columns")) {
          Object text = record.get((String) column.get("name"));
          if (text == null) {
            text = "";
          } else {
            text = String.valueOf(text);
          }
          texts.add((String) text);
        }

        TableItem tableItem = new TableItem(table, SWT.NONE);
        tableItem.setText(texts.toArray(new String[texts.size()]));
      }
    }
  }
예제 #17
0
 /** TODO Write description of dialogChanged in FunctionGroup. */
 void dialogChanged() {
   if (functionNameText.getText().length() != 0) {
     final TableItem allTableItems[] = fTable.getItems();
     for (final TableItem element : allTableItems) {
       if (element.getText(0).equals(functionNameText.getText())
           && element.getText(1).equals(arityText.getText())) {
         updateStatus("Function already exists!");
         return;
       }
     }
     // check to see if this is a valid function name
     final int functionNameASCII = functionNameText.getText().charAt(0);
     if (!(functionNameASCII >= 'a' && functionNameASCII <= 'z') && functionNameASCII != '\'') {
       updateStatus("Function name has to be a valid erlang atom.");
       return;
     }
     try {
       Integer.parseInt(arityText.getText());
     } catch (final NumberFormatException e) {
       updateStatus("The arity has to be an integer number.");
       return;
     }
     updateStatus(null);
   } else {
     updateStatus(null);
     addFunctionBtn.setEnabled(false);
   }
 }
  private void getInfo(IngresVectorwiseLoaderMeta input) {
    input.setDatabaseMeta(transMeta.findDatabase(serverConnection.getText()));
    input.setTablename(wTable.getText());
    input.setFifoFileName(wFifoFile.getText());
    input.setSqlPath(wSqlPath.getText());
    input.setUseSSV(wUseSSV.getSelection());
    input.setEscapingSpecialCharacters(wEscapeSpecialChars.getSelection());
    input.setUsingVwload(wUseVwload.getSelection());
    input.setUseAuthentication(wUseAuthentication.getSelection());
    input.setTruncatingTable(wTruncateTable.getSelection());
    input.setDelimiter(wDelimiter.getText());
    input.setEncoding(wCharSet.getText());
    input.setBufferSize(wBufferSize.getText());
    input.setUseStandardConversion(wUseStandardConversion.getSelection());
    input.setContinueOnError(wContinueOnError.getSelection());
    input.setErrorFileName(wErrorFile.getText());
    input.setUseDynamicVNode(wUseDynamicVNode.getSelection());
    input.setMaxNrErrors(wMaxErrors.getText());

    int nrRows = wFields.nrNonEmpty();
    input.allocate(nrRows);
    // CHECKSTYLE:Indentation:OFF
    for (int i = 0; i < nrRows; i++) {
      TableItem item = wFields.getNonEmpty(i);
      input.getFieldDatabase()[i] = Const.NVL(item.getText(1), "");
      input.getFieldStream()[i] = Const.NVL(item.getText(2), "");
    }
  }
예제 #19
0
  private void ok() {
    if (Const.isEmpty(wStepname.getText())) return;

    stepname = wStepname.getText(); // return value
    // copy info to TextFileInputMeta class (input)
    input.setSql(wSQL.getText());
    input.setDatabaseMeta(transMeta.findDatabase(wConnection.getText()));
    input.setExecutedEachInputRow(wEachRow.getSelection());
    input.setSingleStatement(wSingleStatement.getSelection());
    input.setVariableReplacementActive(wVariables.getSelection());
    input.setQuoteString(wQuoteString.getSelection());
    input.setParams(wSetParams.getSelection());
    input.setInsertField(wInsertField.getText());
    input.setUpdateField(wUpdateField.getText());
    input.setDeleteField(wDeleteField.getText());
    input.setReadField(wReadField.getText());

    int nrargs = wFields.nrNonEmpty();
    input.allocate(nrargs);
    if (log.isDebug())
      logDebug(BaseMessages.getString(PKG, "ExecSQLDialog.Log.FoundArguments", +nrargs + ""));
    for (int i = 0; i < nrargs; i++) {
      TableItem item = wFields.getNonEmpty(i);
      input.getArguments()[i] = item.getText(1);
    }

    if (input.getDatabaseMeta() == null) {
      MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
      mb.setMessage(BaseMessages.getString(PKG, "ExecSQLDialog.InvalidConnection.DialogMessage"));
      mb.setText(BaseMessages.getString(PKG, "ExecSQLDialog.InvalidConnection.DialogTitle"));
      mb.open();
    }

    dispose();
  }
예제 #20
0
  /** Copy information from the meta-data input to the dialog fields. */
  public void getData() {
    int i;
    logDebug(BaseMessages.getString(PKG, "DBProcDialog.Log.GettingKeyInfo")); // $NON-NLS-1$

    if (input.getArgument() != null)
      for (i = 0; i < input.getArgument().length; i++) {
        TableItem item = wFields.table.getItem(i);
        if (input.getArgument()[i] != null) item.setText(1, input.getArgument()[i]);
        if (input.getArgumentDirection()[i] != null)
          item.setText(2, input.getArgumentDirection()[i]);
        item.setText(3, ValueMeta.getTypeDesc(input.getArgumentType()[i]));
      }

    if (input.getDatabase() != null) wConnection.setText(input.getDatabase().getName());
    else if (transMeta.nrDatabases() == 1) {
      wConnection.setText(transMeta.getDatabase(0).getName());
    }
    if (input.getProcedure() != null) wProcName.setText(input.getProcedure());
    if (input.getResultName() != null) wResult.setText(input.getResultName());
    wResultType.setText(ValueMeta.getTypeDesc(input.getResultType()));

    wAutoCommit.setSelection(input.isAutoCommit());

    wFields.setRowNums();
    wFields.optWidth(true);
    wStepname.selectAll();
  }
  /**
   * Utility method for binding an argument into the UI. Note that this method does not record any
   * commands, it simply adds a new row into the table and associates the passed {@link
   * PayloadFactoryArgument} to it.
   *
   * @return {@link TableItem} which was introduced.
   */
  private TableItem bindArgument(PayloadFactoryArgument argument) {
    TableItem item = new TableItem(tblArguments, SWT.NONE);
    ArgumentWrapper wrapper = new ArgumentWrapper(argument);
    wrapper.setArgumentExpression(
        EsbFactory.eINSTANCE.copyNamespacedProperty(argument.getArgumentExpression()));
    wrapper.setArgumentValue(argument.getArgumentValue());

    if (argument.getArgumentType() == PayloadFactoryArgumentType.EXPRESSION) {
      item.setText(
          new String[] {
            LITERAL_EXPRESSION,
            wrapper.getArgumentExpression().getPropertyValue(),
            argument.getEvaluator().toString()
          });
      wrapper.setEvaluator(argument.getEvaluator());
      wrapper.setExpression(true);
    } else {
      item.setText(new String[] {LITERAL_VALUE, wrapper.getArgumentValue(), ""});
      wrapper.setEvaluator(null);
      wrapper.setExpression(false);
    }

    item.setData(wrapper);
    return item;
  }
  /** Copy information from the meta-data input to the dialog fields. */
  public void getData() {
    wStepname.setText(stepname);

    for (int i = 0; i < input.getFieldCCType().length; i++) {
      TableItem item = wFields.table.getItem(i);
      String type = input.getFieldCCType()[i];
      String len = input.getFieldCCLength()[i];
      String size = input.getFieldCCSize()[i];

      if (type != null) item.setText(1, type);
      if (len != null) item.setText(2, len);
      if (size != null) item.setText(3, size);
    }

    wFields.setRowNums();
    wFields.optWidth(true);

    if (input.getCardNumberFieldName() != null)
      wCCNumberField.setText(input.getCardNumberFieldName());
    if (input.getCardTypeFieldName() != null) wCCTypeField.setText(input.getCardTypeFieldName());
    if (input.getCardLengthFieldName() != null)
      wCCLengthField.setText(input.getCardLengthFieldName());

    wStepname.selectAll();
  }
예제 #23
0
  /** Adds a new constraint. */
  private void addConstraint() {
    IDecisionVariable variable = getVariable();
    ConstraintEditorDialog dlg = new ConstraintEditorDialog(getShell(), variable, null);
    if (ConstraintEditorDialog.OK == dlg.open()) {
      String constraint = dlg.getConstraintText();
      if (constraint.length() > 0) {
        try {
          if (null == variableValue) {
            variableValue =
                (ContainerValue)
                    ValueFactory.createValue(
                        variable.getDeclaration().getType(), ValueFactory.EMPTY);
            variable.setValue(variableValue, AssignmentState.ASSIGNED);
          }
          if (null != variableValue) {
            Value val = createConstraintValue(constraint);
            checkForDuplicates(val, -1);
            variableValue.addElement(val);

            TableItem item = new TableItem(tableViewer.getTable(), SWT.NULL);
            item.setText(constraint);
            setDirty();
          }
        } catch (ValueDoesNotMatchTypeException e) {
          exceptionDialog(e);
        } catch (ConfigurationException e) {
          exceptionDialog(e);
        }
      }
    }
  }
  /** Copy information from the meta-data input to the dialog fields. */
  public void getData() {
    List<StreamInterface> infoStreams = input.getStepIOMeta().getInfoStreams();

    wReference.setText(Const.NVL(infoStreams.get(0).getStepname(), ""));
    wCompare.setText(Const.NVL(infoStreams.get(1).getStepname(), ""));
    if (input.getFlagField() != null) {
      wFlagfield.setText(input.getFlagField());
    }

    for (int i = 0; i < input.getKeyFields().length; i++) {
      TableItem item = wKeys.table.getItem(i);
      if (input.getKeyFields()[i] != null) {
        item.setText(1, input.getKeyFields()[i]);
      }
    }
    for (int i = 0; i < input.getValueFields().length; i++) {
      TableItem item = wValues.table.getItem(i);
      if (input.getValueFields()[i] != null) {
        item.setText(1, input.getValueFields()[i]);
      }
    }

    wStepname.selectAll();
    wStepname.setFocus();
  }
예제 #25
0
  private void refreshAutomaticSearchTable() {

    sourceTable.removeAll();

    for (Search s : selectedLiteratureReview.getSearches()) {

      if (s instanceof AutomatedSearch) {
        AutomatedSearch as = (AutomatedSearch) s;
        this.QueryLabel.setText(as.getQueryString());

        /*TableItem generalItem = new TableItem (sourceTable, SWT.NONE);
        generalItem.setText(0, "ALL");
        generalItem.setText(1, String.valueOf(selectedLiteratureReview.getTotalFound()));
        generalItem.setText(2, String.valueOf(selectedLiteratureReview.getTotalFetched()));*/

        for (QueryInfo qi : as.getQueryInfos()) {
          TableItem item = new TableItem(sourceTable, SWT.NONE);
          item.setText(0, qi.getSource());
          item.setText(1, String.valueOf(qi.getTotalFound()));
          item.setText(2, String.valueOf(qi.getTotalFound()));
        }

        for (int i = 0; i < sourceTable.getColumnCount(); i++) {
          sourceTable.getColumn(i).pack();
        }
      }
    }
  }
  private void ok() {
    if (Const.isEmpty(wStepname.getText())) {
      return;
    }

    List<StreamInterface> infoStreams = input.getStepIOMeta().getInfoStreams();
    infoStreams.get(0).setStepMeta(transMeta.findStep(wReference.getText()));
    infoStreams.get(1).setStepMeta(transMeta.findStep(wCompare.getText()));
    input.setFlagField(wFlagfield.getText());

    int nrKeys = wKeys.nrNonEmpty();
    int nrValues = wValues.nrNonEmpty();

    input.allocate(nrKeys, nrValues);

    // CHECKSTYLE:Indentation:OFF
    for (int i = 0; i < nrKeys; i++) {
      TableItem item = wKeys.getNonEmpty(i);
      input.getKeyFields()[i] = item.getText(1);
    }

    // CHECKSTYLE:Indentation:OFF
    for (int i = 0; i < nrValues; i++) {
      TableItem item = wValues.getNonEmpty(i);
      input.getValueFields()[i] = item.getText(1);
    }

    stepname = wStepname.getText(); // return value

    dispose();
  }
  /** Initialize the fields in this editor. */
  protected void initialize() {
    if (ports == null) return;

    ports.removeAll();
    CarbonServer31Utils.isServerStartBrowserPopup(server.getOriginal());
    ServerPort[] serverPorts =
        ServerController.getInstance().getServerManager().getServerPorts(server.getOriginal());
    for (ServerPort serverPort : serverPorts) {
      ServerPort port = serverPort;
      TableItem item = new TableItem(ports, SWT.NONE);
      String portStr = "-";
      if (port.getPort() >= 0) portStr = port.getPort() + "";
      String[] s = new String[] {port.getName(), portStr};
      item.setText(s);
      int i = CarbonServerConstants.PORT_CAPTIONS.indexOf(port.getName());
      if (i != -1) {
        port =
            new ServerPort(
                CarbonServerConstants.PORT_IDS.get(i),
                port.getName(),
                port.getPort(),
                port.getProtocol());
      }
      item.setData(port);
    }

    if (readOnly) {
      viewer.setCellEditors(new CellEditor[] {null, null});
      viewer.setCellModifier(null);
    } else {
      setupPortEditors();
    }
  }
예제 #28
0
 public void setAllChecked(Table table, boolean state) {
   TableItem[] children = table.getItems();
   for (int i = 0; i < children.length; i++) {
     TableItem item = children[i];
     item.setChecked(state);
   }
 }
  private void getParameters(TransMeta inputTransMeta) {
    try {
      if (inputTransMeta == null) {
        JobEntryTrans jet = new JobEntryTrans();
        getInfo(jet);
        inputTransMeta = jet.getTransMeta(rep, metaStore, jobMeta);
      }
      String[] parameters = inputTransMeta.listParameters();

      String[] existing = wParameters.getItems(1);

      for (int i = 0; i < parameters.length; i++) {
        if (Const.indexOfString(parameters[i], existing) < 0) {
          TableItem item = new TableItem(wParameters.table, SWT.NONE);
          item.setText(1, parameters[i]);
        }
      }
      wParameters.removeEmptyRows();
      wParameters.setRowNums();
      wParameters.optWidth(true);
    } catch (Exception e) {
      new ErrorDialog(
          shell,
          BaseMessages.getString(
              PKG, "JobEntryTransDialog.Exception.UnableToLoadTransformation.Title"),
          BaseMessages.getString(
              PKG, "JobEntryTransDialog.Exception.UnableToLoadTransformation.Message"),
          e);
    }
  }
예제 #30
0
 private Object getItemEvent(Object object) {
   for (int i = 0; i < eventTable.getItemCount(); i++) {
     TableItem item = eventTable.getItems()[i];
     if (item.getData().equals(object)) return item;
   }
   return null;
 }