/** * Returns the plugin definition associated with the specified class. * * @param clazz The class whose plugin definition is sought. * @return The associated plugin definition, or null if not found. */ public static PluginDefinition getDefinition(Class<? extends ElementBase> clazz) { return PluginRegistry.getInstance().get(clazz); }
public PluginDefinition unregister(Class<? extends ElementBase> clazz) { return unregister(get(clazz)); }
/** * Search for SMART manifests within the specified path root. Each discovered manifest will * result in the creation of a CareWeb plugin definition for the associated SMART app. * * @param appContext The application context. * @param root Root path for search. */ private void findSmartManifests(ApplicationContext appContext, String root) { try { Resource[] resources = appContext.getResources(root + SMART_MANIFEST_PATTERN); for (Resource resource : resources) { PluginDefinition def = toDefinition(resource); if (def != null) { registry.register(def); } } } catch (IOException e) { log.error("Error searching for SMART manifests.", e); } }
for (PluginDefinition plugin : PluginRegistry.getInstance()) { if (!StringUtils.isEmpty(plugin.getUrl()) && shell.getLoadedPlugin(plugin.getId()) == null) { plugins.add(plugin);
/** * Lookup a plugin definition by its id. Raises a runtime exception if the plugin is not found. * * @param id Plugin id. * @return The plugin definition. */ private PluginDefinition pluginById(String id) { PluginDefinition def = pluginRegistry.get(id); if (def == null) { throw new PluginException(EXC_UNKNOWN_PLUGIN, null, null, id); } return def; }
/** * Search for SMART manifests within the specified path root. Each discovered manifest will * result in the creation of a CareWeb plugin definition for the associated SMART app. * * @param appContext The application context. * @param root Root path for search. */ private void findSmartManifests(ApplicationContext appContext, String root) { try { Resource[] resources = appContext.getResources(root + SMART_MANIFEST_PATTERN); for (Resource resource : resources) { PluginDefinition def = toDefinition(resource); if (def != null) { registry.register(def); } } } catch (IOException e) { log.error("Error searching for SMART manifests.", e); } }
loadFavorites(); for (PluginDefinition def : PluginRegistry.getInstance()) { if (def.isInternal()) { continue;
/** * Returns the plugin definition associated with the specified xml tag (same as plugin id). * * @param tag XML tag (plugin id). * @return The associated plugin definition, or null if not found. */ public static PluginDefinition getDefinition(String tag) { return PluginRegistry.getInstance().get(tag); }
private LayoutElement() { super("layout", null, PluginRegistry.getInstance().get("_desktop")); }
/** * Sets the plugin definition based on the specified class. Typically this would be the same * class as the element itself, but in certain cases (as in the ElementProxy class) it is not. * * @param clazz The UI element class. */ public void setDefinition(Class<? extends ElementBase> clazz) { setDefinition(PluginRegistry.getInstance().get(clazz)); }
private PluginDefinition getDefinition(String type, Element node) { type = type != null ? type : getRequiredAttribute(node, "_type"); PluginDefinition pluginDefinition = PluginRegistry.getInstance().get(type); if (pluginDefinition == null) { throw new IllegalArgumentException("Unrecognized " + node.getTagName() + " type: " + type); } return pluginDefinition; }