/** * Creates a new PluginProvidedJSFLibrary from the JSFLibrary extension point. * * @return PluginProvidedJSFLibrary instance. */ public JSFLibrary create() { newLib = JSFLibraryRegistryFactory.eINSTANCE.createPluginProvidedJSFLibrary(); newLib.setPluginID(getPluginID()); newLib.setName(config_element.getAttribute(NAME)); String label = config_element.getAttribute(LABEL); if (label != null && label.length() > 0) { newLib.setLabel(label); } newLib.setImplementation( config_element.getAttribute(IS_IMPL).equals("true") ? true : false); // $NON-NLS-1$ newLib.setJSFVersion(JSFVersion.getJSFVersion(config_element.getAttribute(VERSION))); try { addArchives(); return newLib; } catch (Exception e) { JSFCorePlugin.log( e, NLS.bind( Messages.PluginProvidedJSFLibraryCreationHelper_ErrorCreating, newLib.getName())); } return null; }
/** * Add a jar file to the library * * @param pluginRootRelativePath */ public void addArchiveFile(String pluginRootRelativePath) { ArchiveFile jar = createArchiveFile(pluginRootRelativePath); if (!newLib.containsArchiveFile(jar.getSourceLocation())) newLib.getArchiveFiles().add(jar); }