private void initUI() {

    this.setLayout(new BorderLayout());

    JPanel infoPanel = new JPanel();
    infoPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    infoPanel.setBackground(Color.WHITE);
    infoPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));

    infoPanel.add(
        new JLabel(
            new ImageIcon(
                Thread.currentThread().getContextClassLoader().getResource("siw-logo3_2.gif"))));

    JLabel infoLabel =
        new JLabel("<html>Please select a project and context<br> Version must be a number</html>");
    infoPanel.add(infoLabel);

    this.add(infoPanel, BorderLayout.NORTH);

    JPanel entryPanel = new JPanel();
    entryPanel.setLayout(null);

    projectNameField.setText("");
    JLabel projectNameLabel = new JLabel("Project Name");
    projectNameLabel.setBounds(new Rectangle(30, 80, 135, 20));
    projectNameField.setBounds(new Rectangle(180, 80, 175, 20));

    JLabel projectVersionLabel = new JLabel("Project Version");
    projectVersionLabel.setBounds(new Rectangle(30, 125, 135, 20));
    projectVersionField.setBounds(new Rectangle(180, 125, 175, 20));

    JLabel contextLabel = new JLabel("Context");
    contextLabel.setBounds(new Rectangle(30, 165, 135, 20));
    contextComboBox.setBounds(new Rectangle(180, 165, 175, 20));

    JLabel packageLabel = new JLabel("Select Package");
    packageLabel.setBounds(new Rectangle(30, 210, 135, 20));
    packageComboBox.setBounds(new Rectangle(180, 210, 250, 20));

    entryPanel.add(projectNameLabel, null);
    entryPanel.add(projectNameField, null);
    entryPanel.add(projectVersionLabel, null);
    entryPanel.add(projectVersionField, null);
    entryPanel.add(contextLabel, null);
    entryPanel.add(contextComboBox, null);
    entryPanel.add(packageLabel, null);
    entryPanel.add(packageComboBox, null);

    this.add(entryPanel, BorderLayout.CENTER);

    projectVersionField.addKeyListener(this);
    projectNameField.addKeyListener(this);
  }
 public Context getContext() {
   String selected = (String) contextComboBox.getSelectedItem();
   for (Context _con : contexts) {
     if (_con.getName().equals(selected)) return _con;
   }
   return null;
 }
  void init() {
    contexts = cadsrModule.getAllContexts();

    int contentCount = contextComboBox.getItemCount();
    int i = 0;
    while (i <= contentCount && contentCount != 0) {
      contextComboBox.removeItemAt(i);
      contentCount = contextComboBox.getItemCount();
    }

    for (Context _con : contexts) {
      contextComboBox.addItem(_con.getName());
    }

    contextComboBox.setSelectedItem(PropertyAccessor.getProperty("gme.generate.default.context"));
  }
  public FilterPackage getPackage() {
    String selected = (String) packageComboBox.getSelectedItem();
    for (FilterPackage _pkg : packages) {
      if (_pkg.getName().equals(selected)) return _pkg;
    }

    return null;
  }
  public void initPackages() {
    packages = ElementsLists.getInstance().getElements(new FilterPackage(""));

    // packageComboBox.removeAll();
    int pkgCount = packageComboBox.getItemCount();
    int i = 0;
    while (i <= pkgCount && pkgCount != 0) {
      packageComboBox.removeItemAt(i);
      pkgCount = packageComboBox.getItemCount();
    }

    for (FilterPackage pkg : packages) packageComboBox.addItem(pkg.getName());

    if (packageComboBox.getItemCount() > 0)
      for (int j = 0; j < packageComboBox.getItemCount(); j++)
        if (packageComboBox
            .getItemAt(j)
            .toString()
            .trim()
            .equalsIgnoreCase("Logical View.Logical Model")) {
          packageComboBox.setSelectedIndex(j);
          break;
        }
  }