public void handle(Throwable e) { ProtegeApplication.getErrorLog().logError(e); Throwable cause = e; while(cause.getCause() != null) { cause = cause.getCause(); } String msg = cause.getClass().getSimpleName() + ": " + cause.getMessage(); JOptionPane.showMessageDialog(workspace, msg, "Reasoner Error", JOptionPane.ERROR_MESSAGE); } }
public void checkForDownloads() { final BackgroundTask task = ProtegeApplication.getBackgroundTaskManager().startTask("searching for downloads"); Runnable runnable = new Runnable() { public void run() { List<PluginInfo> downloads; try { PluginRegistry registry = getPluginRegistry(); downloads = registry.getAvailableDownloads(); } finally { ProtegeApplication.getBackgroundTaskManager().endTask(task); } if (!downloads.isEmpty()){ Map<String, PluginRegistry> map = new LinkedHashMap<String, PluginRegistry>(); map.put("Downloads", getPluginRegistry()); showUpdatesDialog(map); } else{ JOptionPane.showMessageDialog(null, "No downloads available at this time."); } } }; Thread t = new Thread(runnable, "Check for downloads"); t.setPriority(Thread.MIN_PRIORITY); t.start(); }
public void reallyStart(BundleContext context) { try { ProtegeApplication.context = context; displayPlatform(); initApplication(); if (OSUtils.isOSX()) { ProtegeAppleApplication.getInstance(); } ProtegeManager.getInstance().initialise(this); startApplication(); } catch (Throwable t) { logger.error("Exception caught starting Protege", t); } }
private void startApplication() throws Exception { createAndSetupDefaultEditorKit(); if (commandLineURIs != null && !commandLineURIs.isEmpty()) { // Open any command line URIs for (URI uri : commandLineURIs) { editURI(uri); } } checkForUpdates(); }
protected ProtegeApplication initApplication() throws Exception { PluginUtilities.getInstance().initialise(context); loadDefaults(); initializeLookAndFeel(); checkConfiguration(); setupExceptionHandler(); loadPlugins(); processCommandLineURIs(); // plugins may set arguments loadRecentEditorKits(); return this; }
public PluginInfoTableModel() { bundles = new ArrayList<Bundle>(); for (Bundle b : ProtegeApplication.getContext().getBundles()) { if (ProtegeApplication.isPlugin(b)) { bundles.add(b); } } }
errorNotificationLabel = new ErrorNotificationLabel(ProtegeApplication.getErrorLog(), this); backgroundTaskLabel = new BackgroundTaskLabel(ProtegeApplication.getBackgroundTaskManager());
/** * Closes an <code>EditorKit</code>. This disposes of the editor kit's <code>Workspace</code>, and * closes the editor kit's model manager. */ public void disposeOfEditorKit(EditorKit editorKit) { ProtegeManager.getInstance().getEditorKitManager().removeEditorKit(editorKit); try { editorKit.dispose(); } catch (Exception e) { ProtegeApplication.getErrorLog().logError(e); } System.gc(); application.handleClose(); }
q.flush(); JOptionPane.showMessageDialog(getParent(), "Protege Preferences Reset"); ProtegeApplication.handleQuit(); ProtegeApplication.getErrorLog().logError(ex);
protected boolean handleQuitRequest() { return ProtegeApplication.handleQuit(); } }
public PluginInfoTableModel() { bundles = Arrays.stream(ProtegeApplication.getContext().getBundles()) .filter(ProtegeApplication::isPlugin) .sorted(comparing( b -> (String) b.getHeaders().get(Constants.BUNDLE_NAME), nullsLast(CASE_INSENSITIVE_ORDER))) .collect(toList()); }
@Override protected void editFile(String fileName) throws Exception { ProtegeManager.getInstance().getApplication().editURI(new File(fileName).toURI()); }
private void startApplication() throws Exception { showWelcomeFrame(); try { if (commandLineURIs != null && !commandLineURIs.isEmpty()) { // Open any command line URIs for (URI uri : commandLineURIs) { editURI(uri); } if (ProtegeManager.getInstance().getEditorKitManager().getEditorKitCount() != 0) { welcomeFrame.setVisible(false); } } } catch (Exception e) { logger.error("Exception caught loading ontology", e); } if (PluginManager.getInstance().isAutoUpdateEnabled()){ PluginManager.getInstance().performAutoUpdate(); context.addFrameworkListener(new FrameworkListener() { public void frameworkEvent(FrameworkEvent event) { if (event.getType() == FrameworkEvent.STARTED) { context.removeFrameworkListener(this); } } }); } }
/** * Closes an <code>EditorKit</code>. This disposes of the editor kit's <code>Workspace</code>, and * closes the editor kit's model manager. */ public void disposeOfEditorKit(EditorKit editorKit) { ProtegeManager.getInstance().getEditorKitManager().removeEditorKit(editorKit); try { editorKit.dispose(); } catch (Exception e) { logger.warn("An error occurred whilst trying to dispose of the editor kit '{}': {}", editorKit.getId(), e); } System.gc(); application.handleClose(); }
protected ProtegeApplication initApplication() throws Exception { PluginUtilities.getInstance().initialise(context); loadDefaults(); initializeLookAndFeel(); checkConfiguration(); setupExceptionHandler(); processCommandLineURIs(); // plugins may set arguments loadRecentEditorKits(); return this; }
errorNotificationLabel = new ErrorNotificationLabel(ProtegeApplication.getErrorLog(), this); backgroundTaskLabel = new BackgroundTaskLabel(ProtegeApplication.getBackgroundTaskManager());
/** * Closes an <code>EditorKit</code>. This disposes of the clsdescriptioneditor kit's <code>Workspace</code>, and * closes the clsdescriptioneditor kit's model manager. */ public void disposeOfEditorKit(EditorKit editorKit) { ProtegeManager.getInstance().getEditorKitManager().removeEditorKit(editorKit); try { // Dispose of the workspace editorKit.getWorkspace().dispose(); // Dispose of the model editorKit.getModelManager().dispose(); editorKit.dispose(); } catch (Exception e) { ProtegeApplication.getErrorLog().logError(e); } System.gc(); application.handleClose(); }
q.flush(); JOptionPane.showMessageDialog(getParent(), "Protege Preferences Reset"); ProtegeApplication.handleQuit(); ProtegeApplication.getErrorLog().logError(ex);
public void actionPerformed(ActionEvent event) { ProtegeApplication.handleQuit(); } });
private boolean installPlugin(File pluginLocation, PluginInfo info) throws BundleException { if (info.getPluginDescriptor() == null) { // download not an update... logger.info("Loading " + info.getLabel()); Bundle b = ProtegeApplication.getContext().installBundle("file:" + pluginLocation.getPath()); b.start(); return true; } else { logger.info("Plugin " + info.getLabel() + " will be loaded when Protege is restarted"); return false; } } }