public void closeAll() {
   Object[] list = this.tabs.toArray();
   for (int i = 0; i < list.length; i++) {
     EncogCommonTab tab = (EncogCommonTab) list[i];
     tab.dispose();
   }
 }
  public EncogCommonTab find(File file) {
    for (final EncogCommonTab tab : this.tabs) {
      ProjectFile pf = (ProjectFile) tab.getEncogObject();
      if (pf == null) continue;

      if (file.equals(pf.getFile())) return tab;
    }
    return null;
  }
 public void closeAll(File f) {
   Object[] list = this.tabs.toArray();
   for (int i = 0; i < list.length; i++) {
     EncogCommonTab tab = (EncogCommonTab) list[i];
     if (tab.getEncogObject() != null) {
       if (tab.getEncogObject().getFile() != null) {
         if (tab.getEncogObject().getFile().equals(f)) {
           tab.dispose();
         }
       }
     }
   }
 }
  public void closeTab(EncogCommonTab tab) throws IOException {
    if (tab.close()) {
      remove(tab);
      getDocumentTabs().remove(tab);

      if (tab.isModal()) {
        this.documentTabs.setEnabled(true);
        EncogWorkBench.getInstance().getMainWindow().getTree().setEnabled(true);
        this.modalTabOpen = false;
      }
      EncogWorkBench.getInstance().getMainWindow().getMenus().updateMenus();
    }
  }
 public boolean checkViews(File f) {
   Object[] list = this.tabs.toArray();
   for (int i = 0; i < list.length; i++) {
     EncogCommonTab tab = (EncogCommonTab) list[i];
     if (tab.getEncogObject() != null) {
       if (tab.getEncogObject().getFile() != null) {
         if (tab.getEncogObject().getFile().equals(f)) {
           return true;
         }
       }
     }
   }
   return false;
 }
  public void openTab(EncogCommonTab tab) {

    int i = this.documentTabs.getTabCount();

    this.documentTabs.add(tab.getName(), tab);

    if (!this.contains(tab)) {
      if (i < this.documentTabs.getTabCount())
        documentTabs.setTabComponentAt(i, new ButtonTabComponent(this, tab));
      add(tab);
    }
    selectTab(tab);
    EncogWorkBench.getInstance().getMainWindow().getMenus().updateMenus();
  }
  public void openModalTab(EncogCommonTab tab, String title) {

    if (alreadyOpen(tab)) return;

    int i = this.documentTabs.getTabCount();

    this.documentTabs.add(title, tab);
    documentTabs.setTabComponentAt(i, new ButtonTabComponent(this, tab));
    add(tab);
    tab.setModal(true);
    this.documentTabs.setSelectedComponent(tab);
    this.documentTabs.setEnabled(false);
    EncogWorkBench.getInstance().getMainWindow().getTree().setEnabled(false);
    this.modalTabOpen = true;
    EncogWorkBench.getInstance().getMainWindow().getMenus().updateMenus();
  }
 public void add(final EncogCommonTab tab) {
   this.tabs.add(tab);
   tab.setParent(this.owner);
 }