Ejemplo n.º 1
0
  protected void extractComponentsFromFeatureModel(FeatureTreeNode featureNode) {

    if (featureNode.isLeaf()) {
      if (getParentNode(featureNode) != null) {
        String componentKey = getParentNode(featureNode).getID();
        String componentName = getParentNode(featureNode).getName();
        ProductComponent component = concreteComponents.get(componentKey);
        if (component == null) {
          component = new ProductComponent(componentKey, componentName);
          concreteComponents.put(componentKey, component);
        }
        component.addComponentType(featureNode.getID());
      }
    }

    for (int i = 0; i < featureNode.getChildCount(); i++) {
      extractComponentsFromFeatureModel((FeatureTreeNode) featureNode.getChildAt(i));
    }
  }