public SwitchTarget getCurrentTarget() {
      TabInfo selected = myTabs.getSelectedInfo();
      final Ref<SwitchTarget> targetRef = new Ref<SwitchTarget>();
      new AwtVisitor(selected.getComponent()) {
        @Override
        public boolean visit(Component component) {
          if (component instanceof JBTabs) {
            JBTabs tabs = (JBTabs) component;
            if (tabs != myTabs) {
              targetRef.set(tabs.getCurrentTarget());
              return true;
            }
          }
          return false;
        }
      };

      return targetRef.get();
    }
 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);
     }
   }
 }