Esempio n. 1
0
  /**
   * For the specified vm type node, parse all subordinate VM definitions and add them to the
   * specified container.
   */
  private static void populateVMTypes(Element vmTypeElement, VMDefinitionsContainer container) {

    // Retrieve the 'id' attribute and the corresponding VM type object
    String id = vmTypeElement.getAttribute("id"); // $NON-NLS-1$
    IVMInstallType vmType = RubyRuntime.getVMInstallType(id);
    if (vmType != null) {

      // For each VM child node, populate the container with a subordinate node
      NodeList vmNodeList = vmTypeElement.getChildNodes();
      for (int i = 0; i < vmNodeList.getLength(); ++i) {
        Node vmNode = vmNodeList.item(i);
        short type = vmNode.getNodeType();
        if (type == Node.ELEMENT_NODE) {
          Element vmElement = (Element) vmNode;
          if (vmElement.getNodeName().equalsIgnoreCase("vm")) { // $NON-NLS-1$
            populateVMForType(vmType, vmElement, container);
          }
        }
      }
    } else {
      LaunchingPlugin.log(LaunchingMessages.RubyRuntime_VM_type_element_with_unknown_id_1);
    }
  }