public EditorWithProviderComposite[] getEditorsComposites() {
    List<EditorWithProviderComposite> res = new ArrayList<EditorWithProviderComposite>();

    for (final EditorWindow myWindow : myWindows) {
      final EditorWithProviderComposite[] editors = myWindow.getEditors();
      ContainerUtil.addAll(res, editors);
    }
    return res.toArray(new EditorWithProviderComposite[res.size()]);
  }
 private void writeWindow(@NotNull Element res, @Nullable EditorWindow window) {
   if (window != null) {
     EditorWithProviderComposite[] composites = window.getEditors();
     for (int i = 0; i < composites.length; i++) {
       VirtualFile file = window.getFileAt(i);
       res.addContent(
           writeComposite(
               file, composites[i], window.isFilePinned(file), window.getSelectedEditor()));
     }
   }
 }
 @NotNull
 public VirtualFile[] getOpenFiles() {
   final ArrayListSet<VirtualFile> files = new ArrayListSet<VirtualFile>();
   for (final EditorWindow myWindow : myWindows) {
     final EditorWithProviderComposite[] editors = myWindow.getEditors();
     for (final EditorWithProviderComposite editor : editors) {
       final VirtualFile file = editor.getFile();
       LOG.assertTrue(file.isValid(), Arrays.toString(editor.getProviders()));
       files.add(file);
     }
   }
   return VfsUtil.toVirtualFileArray(files);
 }
  private void writeWindow(final Element res, final EditorWindow window) {
    if (window != null) {
      final EditorWithProviderComposite[] composites = window.getEditors();
      for (int i = 0; i < composites.length; i++) {
        final VirtualFile file = window.getFileAt(i);
        final boolean isPinned = window.isFilePinned(file);
        final EditorWithProviderComposite composite = composites[i];
        final EditorWithProviderComposite selectedEditor = window.getSelectedEditor();

        writeComposite(res, file, composite, isPinned, selectedEditor);
      }
    }
  }
 @NotNull
 public VirtualFile[] getOpenFiles() {
   final Set<VirtualFile> files = new ArrayListSet<VirtualFile>();
   for (final EditorWindow myWindow : myWindows) {
     final EditorWithProviderComposite[] editors = myWindow.getEditors();
     for (final EditorWithProviderComposite editor : editors) {
       VirtualFile file = editor.getFile();
       // background thread may call this method when invalid file is being removed
       // do not return it here as it will quietly drop out soon
       if (file.isValid()) {
         files.add(file);
       }
     }
   }
   return VfsUtilCore.toVirtualFileArray(files);
 }
 public void openFiles() {
   if (mySplittersElement != null) {
     Ref<EditorWindow> currentWindow = new Ref<EditorWindow>();
     final JPanel comp = readExternalPanel(mySplittersElement, getTopPanel(), currentWindow);
     if (comp != null) {
       removeAll();
       add(comp, BorderLayout.CENTER);
       mySplittersElement = null;
     }
     // clear empty splitters
     for (EditorWindow window : getWindows()) {
       if (window.getEditors().length == 0) {
         for (EditorWindow sibling : window.findSiblings()) {
           sibling.unsplit(false);
         }
       }
     }
     if (!currentWindow.isNull()) {
       setCurrentWindow(currentWindow.get(), true);
     }
   }
 }