public void performNetworkQuery(DirectoryEntry item) {

    if (owner.getTabManager().checkBeforeOpen(item, NetworkQueryFrame.class)) {
      BasicNetwork net = (BasicNetwork) EncogWorkBench.getInstance().getCurrentFile().find(item);
      final NetworkQueryFrame frame = new NetworkQueryFrame(net);
      frame.setVisible(true);
    }
  }
  public void performObjectsDelete(DirectoryEntry selected) {

    if (owner.getTabManager().find(selected) != null) {
      EncogWorkBench.displayError(
          "Can't Delete Object", "This object can not be deleted while it is open.");
      return;
    }

    EncogWorkBench.getInstance().getCurrentFile().delete(selected);
    EncogWorkBench.getInstance().getMainWindow().redraw();
  }
  public void openItem(final Object item) {

    DirectoryEntry entry = (DirectoryEntry) item;
    if (EncogWorkBench.getInstance().getCurrentFile().find(entry) == null) {
      EncogWorkBench.displayError("Object", "Can't find that object.");
      return;
    }

    if (entry.getType().equals(EncogPersistedCollection.TYPE_TRAINING)) {

      if (owner.getTabManager().checkBeforeOpen(entry, TrainingDataTab.class)) {
        BasicNeuralDataSet set =
            (BasicNeuralDataSet) EncogWorkBench.getInstance().getCurrentFile().find(entry);
        final TrainingDataTab tab = new TrainingDataTab(set);
        this.owner.openTab(tab);
      }
    } else if (entry.getType().equals(EncogPersistedCollection.TYPE_BASIC_NET)) {

      final DirectoryEntry net = (DirectoryEntry) item;
      if (owner.getTabManager().checkBeforeOpen(net, BasicNetwork.class)) {
        BasicNetwork net2 = (BasicNetwork) EncogWorkBench.getInstance().getCurrentFile().find(net);
        final NetworkTab tab = new NetworkTab(net2);
        this.owner.openTab(tab);
      }
    } else if (entry.getType().equals(EncogPersistedCollection.TYPE_TEXT)) {
      DirectoryEntry text = (DirectoryEntry) item;
      if (owner.getTabManager().checkBeforeOpen(text, TextData.class)) {
        TextData text2 = (TextData) EncogWorkBench.getInstance().getCurrentFile().find(text);
        final TextDataTab tab = new TextDataTab(text2);
        this.owner.openTab(tab);
      }
    } else if (entry.getType().equals(EncogPersistedCollection.TYPE_PROPERTY)) {
      DirectoryEntry prop = (DirectoryEntry) item;
      if (owner.getTabManager().checkBeforeOpen(prop, PropertyData.class)) {
        PropertyData prop2 =
            (PropertyData) EncogWorkBench.getInstance().getCurrentFile().find(prop);
        final PropertyDataTab tab = new PropertyDataTab(owner.getDocumentTabs(), prop2);
        owner.openTab(tab);
      }
    } else if (entry.getType().equals(EncogPersistedCollection.TYPE_POPULATION)) {
      DirectoryEntry prop = (DirectoryEntry) item;
      if (owner.getTabManager().checkBeforeOpen(prop, BasicPopulation.class)) {
        BasicPopulation pop2 =
            (BasicPopulation) EncogWorkBench.getInstance().getCurrentFile().find(prop);
        final PopulationTab tab = new PopulationTab(pop2);
        owner.openTab(tab);
      }
    } else if (entry.getType().equals(EncogPersistedCollection.TYPE_SVM)) {
      DirectoryEntry svm = (DirectoryEntry) item;
      if (owner.getTabManager().checkBeforeOpen(svm, SVMNetwork.class)) {
        SVMNetwork svn2 = (SVMNetwork) EncogWorkBench.getInstance().getCurrentFile().find(svm);
        final SVMTab tab = new SVMTab(svn2);
        owner.openTab(tab);
      }

    } else if (entry.getType().equals(EncogPersistedCollection.TYPE_BINARY)) {
      DirectoryEntry link = (DirectoryEntry) item;
      if (owner.getTabManager().checkBeforeOpen(link, BasicPopulation.class)) {
        BufferedNeuralDataSet link2 =
            (BufferedNeuralDataSet) EncogWorkBench.getInstance().getCurrentFile().find(link);
        final BinaryDataTab tab = new BinaryDataTab(link2);
        owner.openTab(tab);
      }

    } else if (entry.getType().equals(EncogPersistedCollection.TYPE_SCRIPT)) {
      DirectoryEntry script = (DirectoryEntry) item;
      if (owner.getTabManager().checkBeforeOpen(script, BasicPopulation.class)) {
        EncogScript script2 =
            (EncogScript) EncogWorkBench.getInstance().getCurrentFile().find(script);
        final EncogScriptTab tab = new EncogScriptTab(script2);
        owner.openTab(tab);
      }

    }
    /*else if (entry.getType().equals(EncogPersistedCollection.TYPE_NORMALIZATION)) {
    	DirectoryEntry norm = (DirectoryEntry) item;
    	if (owner.getTabManager().checkBeforeOpen(norm,
    			DataNormalization.class)) {
    		DataNormalization norm2 = (DataNormalization) EncogWorkBench.getInstance()
    				.getCurrentFile().find(norm);
    		final DataNormalizationTab tab = new DataNormalizationTab(norm2);
    		owner.openTab(tab);
    	}

    }*/
    else {
      EncogWorkBench.displayError("Error", "Unknown object type.\nDo not know how to open.");
    }
  }