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()); }
public PluginInfoTableModel() { bundles = new ArrayList<Bundle>(); for (Bundle b : ProtegeApplication.getContext().getBundles()) { if (ProtegeApplication.isPlugin(b)) { bundles.add(b); } } }
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; } } }
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; } } }
private boolean installPlugin(File pluginLocation, PluginInfo info) { if (info.getPluginDescriptor() == null) { // download not an update... logger.info("Installing the {} plugin", info.getLabel()); BundleContext context = ProtegeApplication.getContext(); try { Bundle b = context.installBundle("file:" + pluginLocation.getPath()); b.start(); return true; } catch (BundleException e) { logger.info("The {} plugin requires a restart of Protégé (Reason: {})", info.getLabel(), e.getMessage()); return false; } } else { logger.info("The {} plugin requires a restart of Protégé", info.getLabel()); return false; } } }