public IRI getDocumentIRI(IRI ontologyIRI) { int ret = JOptionPane.showConfirmDialog(null, "<html><body>The system couldn't locate the ontology:<br><font color=\"blue\">" + ontologyIRI.toString() + "</font><br><br>" + "Would you like to attempt to resolve the missing import?</body></html>", "Resolve missing import?", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); if (ret != JOptionPane.YES_OPTION) { return null; } UIHelper helper = new UIHelper(owlEditorKit); File file = helper.chooseOWLFile("Please select an ontology file"); if (file == null) { return ontologyIRI; } updateActiveCatalog(ontologyIRI, file); return IRI.create(file); }
protected void initialise(){ logger.info("Using OWL API version " + VersionInfo.getVersionInfo().getVersion()); this.newPhysicalURIs = new HashSet<URI>(); modelManager = new OWLModelManagerImpl(); modelManager.setExplanationManager(new ExplanationManager(this)); modelManager.setMissingImportHandler(new MissingImportHandlerUI(this)); modelManager.setSaveErrorHandler(new SaveErrorHandler(){ public void handleErrorSavingOntology(OWLOntology ont, URI physicalURIForOntology, OWLOntologyStorageException e) throws Exception { handleSaveError(ont, physicalURIForOntology, e); } }); loadErrorHandler = new OntologyLoadErrorHandlerUI(this); modelManager.setLoadErrorHandler(loadErrorHandler); loadIOListenerPlugins(); registration = ProtegeOWL.getBundleContext().registerService(EditorKit.class.getCanonicalName(), this, new Properties()); }
public OWLEditorKit(@Nonnull OWLEditorKitFactory editorKitFactory) { super(editorKitFactory); logger.info("OWL API Version: {}", VersionInfo.getVersionInfo().getVersion()); modelManager = new OWLModelManagerImpl(); // Make sure that the workspace is not null, // but don't initialise it until our EditorKitHooks have been initialised. workspace = new OWLWorkspace(); workspace.setup(this); Initializers.loadEditorKitHooks(this); searchManagerSelector = new SearchManagerSelector(this); modelManager.addOntologyChangeListener(ontologyChangeListener); modelManager.setExplanationManager(new ExplanationManager(this)); modelManager.setMissingImportHandler(new MissingImportHandlerUI(this)); loadErrorHandler = new OntologyLoadErrorHandlerUI(this); modelManager.setLoadErrorHandler(loadErrorHandler); loadIOListenerPlugins(); registration = ProtegeOWL.getBundleContext().registerService(EditorKit.class.getCanonicalName(), this, new Hashtable<>()); // Finally load the UI workspace.initialise(); }
public OWLEditorKit(@Nonnull OWLEditorKitFactory editorKitFactory) { super(editorKitFactory); logger.info("OWL API Version: {}", VersionInfo.getVersionInfo().getVersion()); modelManager = new OWLModelManagerImpl(); // Make sure that the workspace is not null, // but don't initialise it until our EditorKitHooks have been initialised. workspace = new OWLWorkspace(); workspace.setup(this); Initializers.loadEditorKitHooks(this); searchManagerSelector = new SearchManagerSelector(this); modelManager.addOntologyChangeListener(ontologyChangeListener); modelManager.setExplanationManager(new ExplanationManager(this)); modelManager.setMissingImportHandler(new MissingImportHandlerUI(this)); loadErrorHandler = new OntologyLoadErrorHandlerUI(this); modelManager.setLoadErrorHandler(loadErrorHandler); loadIOListenerPlugins(); registration = ProtegeOWL.getBundleContext().registerService(EditorKit.class.getCanonicalName(), this, new Hashtable<>()); // Finally load the UI workspace.initialise(); }
return ontologyIRI; updateActiveCatalog(ontologyIRI, file); return IRI.create(file); });
protected void initialise() { logger.info("Using OWL API version " + VersionInfo.getVersionInfo().getVersion()); this.newPhysicalURIs = new HashSet<URI>(); modelManager = new OWLModelManagerImpl(); modelManager.setExplanationManager(new ExplanationManager(this)); modelManager.setMissingImportHandler(new MissingImportHandlerUI(this)); modelManager.setSaveErrorHandler(new SaveErrorHandler() { public void handleErrorSavingOntology(OWLOntology ont, URI physicalURIForOntology, OWLOntologyStorageException e) throws Exception { handleSaveError(ont, physicalURIForOntology, e); } }); ontologyChangeListener = new OWLOntologyChangeListener() { public void ontologiesChanged(List<? extends OWLOntologyChange> owlOntologyChanges) throws OWLException { modifiedDocument = true; } }; modelManager.addOntologyChangeListener(ontologyChangeListener); searchManager = new SearchManager(this, new SearchMetadataImportManager()); loadErrorHandler = new OntologyLoadErrorHandlerUI(this); modelManager.setLoadErrorHandler(loadErrorHandler); loadIOListenerPlugins(); registration = ProtegeOWL.getBundleContext().registerService(EditorKit.class.getCanonicalName(), this, new Hashtable<String, Object>()); getWorkspace().refreshComponents(); }
return ontologyIRI; updateActiveCatalog(ontologyIRI, file); return IRI.create(file); });
public IRI getDocumentIRI(IRI ontologyIRI) { int ret = JOptionPane.showConfirmDialog(null, "<html><body>The system couldn't locate the ontology:<br><font color=\"blue\">" + ontologyIRI.toString() + "</font><br><br>" + "Would you like to attempt to resolve the missing import?</body></html>", "Resolve missing import?", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); if (ret != JOptionPane.YES_OPTION) { return null; } UIHelper helper = new UIHelper(owlEditorKit); File file = helper.chooseOWLFile("Please select an ontology file"); if (file == null) { return ontologyIRI; } updateActiveCatalog(ontologyIRI, file); return IRI.create(file); }