@Override
  public Object[] getChildElements(Object element) {
    if (element == myRootElementDescriptor) {
      ArrayList<LibraryTableTreeContentElement> elements =
          new ArrayList<LibraryTableTreeContentElement>(3);
      final LibraryEditor parentEditor = myParentEditor.getLibraryEditor();
      for (OrderRootType type : myComponentDescriptor.getRootTypes()) {
        final String[] urls = parentEditor.getUrls(type);
        if (urls.length > 0) {
          OrderRootTypePresentation presentation =
              myComponentDescriptor.getRootTypePresentation(type);
          if (presentation == null) {
            presentation = DefaultLibraryRootsComponentDescriptor.getDefaultPresentation(type);
          }
          elements.add(
              new OrderRootTypeElement(
                  myRootElementDescriptor,
                  type,
                  presentation.getNodeText(),
                  presentation.getIcon()));
        }
      }
      return elements.toArray();
    }

    if (element instanceof OrderRootTypeElement) {
      OrderRootTypeElement rootTypeElement = (OrderRootTypeElement) element;
      OrderRootType orderRootType = rootTypeElement.getOrderRootType();
      ArrayList<ItemElement> items = new ArrayList<ItemElement>();
      final LibraryEditor libraryEditor = myParentEditor.getLibraryEditor();
      final String[] urls = libraryEditor.getUrls(orderRootType).clone();
      Arrays.sort(urls, LibraryRootsComponent.ourUrlComparator);
      for (String url : urls) {
        items.add(
            new ItemElement(
                rootTypeElement,
                url,
                orderRootType,
                libraryEditor.isJarDirectory(url, orderRootType),
                libraryEditor.isValid(url, orderRootType)));
      }
      return items.toArray();
    }
    return ArrayUtil.EMPTY_OBJECT_ARRAY;
  }
  @Override
  protected JComponent createNorthPanel() {
    String currentName = myLibraryRootsComponent.getLibraryEditor().getName();
    myNameField = new JTextField(currentName);
    myNameField.selectAll();

    FormBuilder formBuilder =
        FormBuilder.createFormBuilder().addLabeledComponent("&Name:", myNameField);
    addNorthComponents(formBuilder);
    return formBuilder.addVerticalGap(10).getPanel();
  }