/**
   * Initializes the combo containing all feature projects.<br>
   * Selects the feature project corresponding to the selected resource.
   */
  private void initComboProject() {
    final Object obj = selection.getFirstElement();
    // TODO: Check for projects in other languages than java
    if (obj instanceof JavaElement) {
      IProject project = ((JavaElement) obj).getJavaProject().getProject();
      featureProject = CorePlugin.getFeatureProject(project);
      if (featureProject != null) {
        comboProject.setText(featureProject.getProjectName());
        checkcontainer(featureProject, project);
      }
    } else if (obj instanceof IResource) {
      IResource resource = (IResource) obj;
      featureProject = CorePlugin.getFeatureProject(resource);
      if (featureProject != null) {
        comboProject.setText(featureProject.getProjectName());
        checkcontainer(featureProject, resource);
      }
    } else if (featureProject == null) {
      IWorkbenchWindow editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
      IEditorPart part = null;
      if (editor != null) {
        IWorkbenchPage page = editor.getActivePage();
        if (page != null) {
          part = page.getActiveEditor();
          if (part != null) {
            FileEditorInput inputFile = (FileEditorInput) part.getEditorInput();
            featureProject = CorePlugin.getFeatureProject(inputFile.getFile());

            if (featureProject != null) {
              IResource res =
                  ResourcesPlugin.getWorkspace()
                      .getRoot()
                      .findMember(featureProject.getProjectName());
              checkcontainer(featureProject, res);
            }
          }
        }
      }

      if (featureProject != null) {
        comboProject.setText(featureProject.getProjectName());
      }
    }
    comboProjectText = comboProject.getText();
  }
 private boolean isFeatureProject(String text) {
   boolean isFP = false;
   for (IFeatureProject feature : featureProjects) {
     if (text.equalsIgnoreCase(feature.getProjectName())) {
       isFP = true;
     }
   }
   return isFP;
 }
 @Override
 public void addPages() {
   setWindowTitle(BUILD_PRODUCTS);
   page =
       new BuildProductsPage(
           featureProject.getProjectName(),
           featureProject,
           getGenerate(),
           toggleState,
           getAlgorithm(),
           getT(),
           getT_Interaction(),
           getOrder(),
           getTest(),
           getMax());
   addPage(page);
 }
  /** Initializes all combo boxes. */
  private void initialize() {

    if (clss != null) {
      comboClass.setText(clss);
      if (clss.length() > 0) {
        classDirty = true;
      }
    }

    for (IFeatureProject feature : featureProjects) comboProject.add(feature.getProjectName());

    if (selection == null || selection.isEmpty()) return;

    initComboProject();

    if (featureProject != null) {
      initComboFeature();
      initComboLanguage();
      initComboPackages(sourceFolder, "");
      initTextModulename();
      initComboClassName();
      initRefinesButton();
    }
  }