@CheckForNull private LibraryManager getProjectLibraryManager() { final ReferenceHelper rh = refHelper.get(); return rh == null ? null: rh.getProjectLibraryManager() != null ? rh.getProjectLibraryManager(): LibraryManager.getDefault(); }
public static LibraryManager getProjectLibraryManager(Project project) { LibraryManager lm = ReferenceHelper.getProjectLibraryManager(project); if (lm != null) { return lm; } return LibraryManager.getDefault(); }
public static void makeSureProjectHasJspCompilationLibraries(final ReferenceHelper refHelper) { if (refHelper.getProjectLibraryManager() == null) { return;
private static void copyRequiredLibraries(AntProjectHelper h, ReferenceHelper rh) throws IOException { if (!h.isSharableProject()) { return; } if (rh.getProjectLibraryManager().getLibrary("junit") == null) { rh.copyLibrary(LibraryManager.getDefault().getLibrary("junit")); // NOI18N } if (rh.getProjectLibraryManager().getLibrary("junit_4") == null) { rh.copyLibrary(LibraryManager.getDefault().getLibrary("junit_4")); // NOI18N } if (rh.getProjectLibraryManager().getLibrary("CopyLibs") == null) { rh.copyLibrary(LibraryManager.getDefault().getLibrary("CopyLibs")); // NOI18N } }
/** * Create chooser for given AntProjectHelper. Standard file chooser is shown * if project is not sharable. * * @param helper ant project helper; cannot be null * @param copyAllowed is file copying allowed */ public FileChooser(AntProjectHelper helper, boolean copyAllowed) { super(); FileObject projectFolder = helper.getProjectDirectory(); Project p = projectFolder != null ? FileOwnerQuery.getOwner(projectFolder): null; LibraryManager lm = p != null ? ReferenceHelper.getProjectLibraryManager(p) : null; if (lm != null) { URL u = lm.getLocation(); if (u != null) { File libBase = Utilities.toFile(URI.create(u.toExternalForm())).getParentFile(); accessory = new FileChooserAccessory(this, FileUtil.toFile(helper.getProjectDirectory()), libBase, copyAllowed); setAccessory(accessory); } } }
if (rh.getProjectLibraryManager().getLibrary(libName) == null) { rh.copyLibrary(LibraryManager.getDefault().getLibrary(libName));
private static void copyRequiredLibraries(AntProjectHelper h, ReferenceHelper rh, AppClientProjectCreateData createData) throws IOException { if (!h.isSharableProject()) { return; } if (!createData.skipTests() && rh.getProjectLibraryManager().getLibrary("junit") == null) { // NOI18N if (LibraryManager.getDefault().getLibrary("junit") != null) { rh.copyLibrary(LibraryManager.getDefault().getLibrary("junit")); // NOI18N } } if (!createData.skipTests() && rh.getProjectLibraryManager().getLibrary("junit_4") == null) { // NOI18N if (LibraryManager.getDefault().getLibrary("junit_4") != null) { rh.copyLibrary(LibraryManager.getDefault().getLibrary("junit_4")); // NOI18N } } Profile j2eeProfile = createData.getJavaEEProfile(); if (j2eeProfile.equals(Profile.JAVA_EE_6_FULL) || j2eeProfile.equals(Profile.JAVA_EE_6_WEB) || j2eeProfile.equals(Profile.JAVA_EE_7_FULL) || j2eeProfile.equals(Profile.JAVA_EE_7_WEB)) { if (rh.getProjectLibraryManager().getLibrary(AntProjectConstants.ENDORSED_LIBRARY_NAME) == null) { // NOI18N rh.copyLibrary(LibraryManager.getDefault().getLibrary(AntProjectConstants.ENDORSED_LIBRARY_NAME)); // NOI18N } } SharabilityUtility.makeSureProjectHasCopyLibsLibrary(h, rh); }
private static void copyRequiredLibraries(AntProjectHelper h, ReferenceHelper rh, WebProjectCreateData data) throws IOException { if (!h.isSharableProject()) { return; } if (!data.skipTests() && rh.getProjectLibraryManager().getLibrary("junit") == null) { // NOI18N if (LibraryManager.getDefault().getLibrary("junit") != null) { rh.copyLibrary(LibraryManager.getDefault().getLibrary("junit")); // NOI18N } } if (!data.skipTests() && rh.getProjectLibraryManager().getLibrary("junit_4") == null) { // NOI18N if (LibraryManager.getDefault().getLibrary("junit_4") != null) { rh.copyLibrary(LibraryManager.getDefault().getLibrary("junit_4")); // NOI18N } } Profile j2eeProfile = data.getJavaEEProfile(); if (j2eeProfile.equals(Profile.JAVA_EE_6_FULL) || j2eeProfile.equals(Profile.JAVA_EE_6_WEB) || j2eeProfile.equals(Profile.JAVA_EE_7_FULL) || j2eeProfile.equals(Profile.JAVA_EE_7_WEB)) { if (rh.getProjectLibraryManager().getLibrary(AntProjectConstants.ENDORSED_LIBRARY_NAME) == null) { // NOI18N rh.copyLibrary(LibraryManager.getDefault().getLibrary(AntProjectConstants.ENDORSED_LIBRARY_NAME)); // NOI18N } } SharabilityUtility.makeSureProjectHasCopyLibsLibrary(h, rh); }
if (!helper.isSharableProject() || refHelper.getProjectLibraryManager() == null) { return;
private static void copyRequiredLibraries(AntProjectHelper h, ReferenceHelper rh, EjbJarProjectCreateData data) throws IOException { if (!h.isSharableProject()) { return; } if (!data.skipTests() && rh.getProjectLibraryManager().getLibrary("junit") == null) { // NOI18N if (LibraryManager.getDefault().getLibrary("junit") != null) { rh.copyLibrary(LibraryManager.getDefault().getLibrary("junit")); // NOI18N } } if (!data.skipTests() && rh.getProjectLibraryManager().getLibrary("junit_4") == null) { // NOI18N if (LibraryManager.getDefault().getLibrary("junit_4") != null) { rh.copyLibrary(LibraryManager.getDefault().getLibrary("junit_4")); // NOI18N } } Profile j2eeProfile = data.getJavaEEProfile(); if (j2eeProfile.equals(Profile.JAVA_EE_6_FULL) || j2eeProfile.equals(Profile.JAVA_EE_6_WEB) || j2eeProfile.equals(Profile.JAVA_EE_7_FULL) || j2eeProfile.equals(Profile.JAVA_EE_7_WEB)) { if (rh.getProjectLibraryManager().getLibrary(AntProjectConstants.ENDORSED_LIBRARY_NAME) == null) { // NOI18N rh.copyLibrary(LibraryManager.getDefault().getLibrary(AntProjectConstants.ENDORSED_LIBRARY_NAME)); // NOI18N } } SharabilityUtility.makeSureProjectHasCopyLibsLibrary(h, rh); }
public void run() { Library lib = refHelper.getProjectLibraryManager().getLibrary("CopyLibs"); if (lib == null) { try { refHelper.getProjectLibraryManager().removeLibrary(lib); } catch (IOException ex) { Exceptions.printStackTrace(ex);
private static void copyRequiredLibraries(AntProjectHelper h, ReferenceHelper rh) throws IOException { if (!h.isSharableProject()) { return; } if (rh.getProjectLibraryManager().getLibrary("junit") == null // NOI18N && LibraryManager.getDefault().getLibrary("junit") != null) { // NOI18N rh.copyLibrary(LibraryManager.getDefault().getLibrary("junit")); // NOI18N } if (rh.getProjectLibraryManager().getLibrary("junit_4") == null // NOI18N && LibraryManager.getDefault().getLibrary("junit_4") != null) { // NOI18N rh.copyLibrary(LibraryManager.getDefault().getLibrary("junit_4")); // NOI18N } if (rh.getProjectLibraryManager().getLibrary("CopyLibs") == null // NOI18N && LibraryManager.getDefault().getLibrary("CopyLibs") != null) { // NOI18N rh.copyLibrary(LibraryManager.getDefault().getLibrary("CopyLibs")); // NOI18N } if (rh.getProjectLibraryManager().getLibrary("JavaFX2Runtime") == null // NOI18N && LibraryManager.getDefault().getLibrary("JavaFX2Runtime") != null) { // NOI18N File mainPropertiesFile = h.resolveFile(h.getLibrariesLocation()); referenceLibrary(LibraryManager.getDefault().getLibrary("JavaFX2Runtime"), mainPropertiesFile.toURI().toURL(), true); //NOI18N } }