예제 #1
0
  private String[] getAvailableProfiles() {
    String generator = config.getGenerator();

    // case generator was initial set in properties page
    if (generator.equals("")) {
      generator = generatorText.getText();
    }

    String[] profiles = util.getProfileNames(agx.getConfiguredProfiles(generator));
    String[] usedProfiles = profilesList.getItems();

    ArrayList<String> availableProfiles = new ArrayList<String>(0);
    for (int i = 0; i < profiles.length; i++) {
      String profile = profiles[i];
      boolean skip = false;
      for (int j = 0; j < usedProfiles.length; j++) {
        if (profile.equals(usedProfiles[j])) {
          skip = true;
        }
      }
      if (!skip) {
        availableProfiles.add(profile);
      }
    }
    return availableProfiles.toArray(new String[] {});
  }
예제 #2
0
  private void addGeneratorSection(Composite parent) {
    String generator = config.getGenerator();

    agxInfoLabel = new Label(parent, SWT.NONE);
    agxInfoLabel.setText(agx.getInfo(generator));

    Composite composite = createColComposite(parent);

    GridData labelGd = new GridData();
    labelGd.widthHint = convertWidthInCharsToPixels(LABEL_FIELD_WIDTH);

    Label generatorLabel = new Label(composite, SWT.NONE);
    generatorLabel.setLayoutData(labelGd);
    generatorLabel.setText(GENERATOR_TITLE);

    GridData textGd = new GridData();
    textGd.widthHint = convertWidthInCharsToPixels(TEXT_FIELD_WIDTH);

    generatorText = new Text(composite, SWT.SINGLE | SWT.BORDER);
    generatorText.setLayoutData(textGd);
    generatorText.setText(generator);

    Button button = new Button(composite, SWT.PUSH);
    button.setText("browse");

    addGeneratorListener(button);
  }