コード例 #1
0
 public boolean handleNewRequest() throws Exception {
   if (5 > 4) return super.handleNewRequest();
   boolean handleNewSuccess = false;
   CreateHGOntologyWizard w = new CreateHGOntologyWizard(null, this);
   int result = w.showModalDialog();
   if (result == Wizard.FINISH_RETURN_CODE) {
     OWLOntologyID oid = w.getOntologyID();
     if (oid != null) {
       HGOwlModelManagerImpl mm = (HGOwlModelManagerImpl) getOWLModelManager();
       // check if already exists
       // we are catching specific exceptions here instead of checking
       // the cases before the
       // call to mm.createNewOntology.
       try {
         mm.createNewOntology(oid, w.getLocationURI());
         // addToRecent(URI.create(prop.getProperty("hibernate.connection.url")));
         addRecent(w.getLocationURI());
         handleNewSuccess = true;
       } catch (OWLOntologyAlreadyExistsException e) {
         showNewExistsOntologyIDMessage(oid, e.getDocumentIRI());
       } catch (OWLOntologyDocumentAlreadyExistsException e) {
         showNewExistsDocumentLoadedMessage(oid, e.getOntologyDocumentIRI());
       } catch (HGDBOntologyAlreadyExistsByDocumentIRIException e) {
         showNewExistsDocumentRepoMessage(oid, e.getOntologyDocumentIRI());
       }
     }
   }
   return handleNewSuccess;
 }