Esempio n. 1
0
  private void preClosePanel() {
    for (Entry<Param, ParamField> entry : fields.entrySet()) {
      Param param = entry.getKey();
      ParamField field = entry.getValue();

      Object value = field.getValue();
      connectionParameters.put(param.key, (Serializable) value);
      field.setValue(value);
    }
    // for( Entry<Param, ParamField> entry : fields.entrySet() ) {
    // ParamField field = entry.getValue();
    // TODO field.removeListener(getJWizard().getController());
    // }
  }
Esempio n. 2
0
  public void createControl(Composite parent) {

    Composite mainComposite = new Composite(parent, SWT.NONE);
    GridLayout gridLayout = new GridLayout(2, false);
    mainComposite.setLayout(gridLayout);

    for (Param param : format.getParametersInfo()) {
      if (level != null) {
        String check =
            param.metadata == null ? "user" : (String) param.metadata.get(Parameter.LEVEL);

        if (check == null) {
          check = "user";
        }
        if (level.equals(check)) {
          // we are good this is the one we want
        } else {
          continue; // skip since it is not the one we want
        }
      }
      String txt = param.title.toString();
      if (param.required) {
        txt += "*";
      }

      Label label = new Label(mainComposite, SWT.NONE);
      label.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
      label.setText(txt);

      ParamField field = ParamField.create(mainComposite, param);
      field.doLayout();

      fields.put(param, field);

      // if (param.description != null) {
      // JLabel info = new JLabel(formatDescription(param.description.toString()));
      // page.add(info, "skip, span, wrap");
      // }
    }

    setControl(mainComposite);
  }
Esempio n. 3
0
 private void preDisplayPanel() {
   // populate panel from params map
   for (Entry<Param, ParamField> entry : fields.entrySet()) {
     Param param = entry.getKey();
     ParamField field = entry.getValue();
     Object value = null;
     try {
       value = param.lookUp(connectionParameters);
     } catch (IOException e) {
     }
     if (value == null && param.required) {
       value = param.sample;
     }
     field.setValue(value);
   }
   // for( Entry<Param, ParamField> entry : fields.entrySet() ) {
   // ParamField field = entry.getValue();
   // TODO field.addListener(getWizard().getController());
   // }
 }