コード例 #1
0
 public void closeAll() {
   Object[] list = this.tabs.toArray();
   for (int i = 0; i < list.length; i++) {
     EncogCommonTab tab = (EncogCommonTab) list[i];
     tab.dispose();
   }
 }
コード例 #2
0
  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;
  }
コード例 #3
0
 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();
         }
       }
     }
   }
 }
コード例 #4
0
  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();
    }
  }
コード例 #5
0
 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;
 }
コード例 #6
0
  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();
  }
コード例 #7
0
  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();
  }
コード例 #8
0
 public void add(final EncogCommonTab tab) {
   this.tabs.add(tab);
   tab.setParent(this.owner);
 }