@Override public ModuleInfo getModuleById(final String id) { // TODO: Cache identifiers in a hash? for (final ModuleInfo info : getModules()) { final String infoID = info.getIdentifier(); if (id.equals(infoID)) return info; } return null; }
@Override public ModuleInfo getModuleById(final String id) { // TODO: Cache identifiers in a hash? for (final ModuleInfo info : getModules()) { final String infoID = info.getIdentifier(); if (id.equals(infoID)) return info; } return null; }
public ModuleSearchResult(final ModuleInfo info, final String baseDir) { this.info = info; props = new LinkedHashMap<>(); final MenuPath menuPath = info.getMenuPath(); if (menuPath != null && !menuPath.isEmpty()) { props.put("Menu path", getMenuPath(true)); final MenuEntry menuLeaf = menuPath.getLeaf(); if (menuLeaf != null) { final Accelerator accelerator = menuLeaf.getAccelerator(); if (accelerator != null) { props.put("Shortcut", accelerator.toString()); } } } props.put("Identifier", info.getIdentifier()); props.put("Location", ModuleSearcher.location(info, baseDir)); }
private void source(final ModuleInfo info) { // HACK: For now, we special case each kind of module. // In the future, we should make it more extensible. // HelpService? ModuleService#help? Some other type of plugin? if (info instanceof ScriptInfo) { // SciJava script. sourceForScript((ScriptInfo) info); return; } final String id = info.getIdentifier(); if (id != null && id.startsWith("legacy:")) { // ImageJ 1.x command. sourceForLegacyCommand(info); return; } try { // Some other kind of module; use the delegate class. sourceForClass(info, info.loadDelegateClass()); } catch (final ClassNotFoundException exc) { log.debug(exc); errorMessage(info); } }