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 } }
private static String createFileReference(ReferenceHelper refHelper, FileObject projectFO, FileObject referencedFO) { String relPath = FileUtil.getRelativePath(projectFO, referencedFO); if (relPath != null) { return relPath; } else { return refHelper.createForeignFileReference(FileUtil.toFile(referencedFO), null); } }
refhelper.destroyReference(key); refhelper.createForeignFileReferenceAsIs(newVal, key); } else { refhelper.destroyReference(key); refhelper.createExtraForeignFileReferenceAsIs(newVal, key);
@CheckForNull private LibraryManager getProjectLibraryManager() { final ReferenceHelper rh = refHelper.get(); return rh == null ? null: rh.getProjectLibraryManager() != null ? rh.getProjectLibraryManager(): LibraryManager.getDefault(); }
ReferenceHelper refHelper = new ReferenceHelper(helper, cfg, helper.getStandardPropertyEvaluator()); ClassPathSupport cs = new ClassPathSupport(helper.getStandardPropertyEvaluator(), refHelper, helper, updateHelper, new ClassPathSupportCallbackImpl(helper));
@Override public void notifyCopied(Project original, File originalPath, String nueName) throws IOException { if (original == null) { // do nothing for the original project. return; } project.setName(nueName); project.getReferenceHelper().fixReferences(originalPath); }
@Override public Library importLibrary(Library library) throws IOException { return refHelper.copyLibrary(library); } };
if ( item.getType() == ClassPathSupport.Item.TYPE_ARTIFACT || item.getType() == ClassPathSupport.Item.TYPE_JAR ) { refHelper.destroyReference(item.getReference()); if (item.getType() == ClassPathSupport.Item.TYPE_JAR) { item.removeSourceAndJavadoc(updateHelper);
helper.createCacheDirectoryProvider(), helper.createAuxiliaryProperties(), refHelper.createSubprojectProvider(), new ProjectWebModuleProvider (), new ProjectWebServicesSupportProvider(),
public static LibraryManager getProjectLibraryManager(Project project) { LibraryManager lm = ReferenceHelper.getProjectLibraryManager(project); if (lm != null) { return lm; } return LibraryManager.getDefault(); }
J2SEProject(AntProjectHelper helper) throws IOException { this.helper = helper; eval = createEvaluator(); aux = helper.createAuxiliaryConfiguration(); for (int v = 4; v < 10; v++) { if (aux.getConfigurationFragment("data", "http://www.netbeans.org/ns/scala-project/" + v, true) != null) { // NOI18N throw Exceptions.attachLocalizedMessage(new IOException("too new"), // NOI18N NbBundle.getMessage(J2SEProject.class, "ScalaProject.too_new", FileUtil.getFileDisplayName(helper.getProjectDirectory()))); } } refHelper = new ReferenceHelper(helper, aux, eval); buildExtender = AntBuildExtenderFactory.createAntExtender(new J2SEExtenderImplementation(), refHelper); /// TODO replace this GeneratedFilesHelper with the default one when fixing #101710 genFilesHelper = new GeneratedFilesHelper(helper, buildExtender); UpdateImplementation updateProject = new UpdateProjectImpl(this, helper, aux); this.updateHelper = new UpdateHelper(updateProject, helper); this.cpProvider = new ClassPathProviderImpl(this.helper, evaluator(), getSourceRoots(), getTestSourceRoots()); //Does not use APH to get/put properties/cfgdata this.cpMod = new ClassPathModifier(this, this.updateHelper, eval, refHelper, null, createClassPathModifierCallback(), null); final J2SEActionProvider actionProvider = new J2SEActionProvider(this, this.updateHelper); lookup = createLookup(aux, actionProvider); actionProvider.startFSListener(); }
public void notifyCopied(Project original, File originalPath, String nueName) { if (original == null) { //do nothing for the original project. return ; } fixPrivateProperties(original.getLookup().lookup(J2SEProjectOperations.class)); fixDistJarProperty (nueName); project.getReferenceHelper().fixReferences(originalPath); project.setName(nueName); }
@Override public Library importLibrary(final @NonNull Library library) throws IOException { return ReferenceHelper.copyLibrary(library, librariesLocation); } };
if ( item.getType() == ClassPathSupport.Item.TYPE_ARTIFACT || item.getType() == ClassPathSupport.Item.TYPE_JAR ) { refHelper.destroyReference(item.getReference()); if (item.getType() == ClassPathSupport.Item.TYPE_JAR) { item.removeSourceAndJavadoc(updateHelper);
private Lookup createLookup(AuxiliaryConfiguration aux, ClassPathProviderImpl cpProvider) { SubprojectProvider spp = refHelper.createSubprojectProvider(); FileEncodingQueryImplementation encodingQuery = QuerySupport.createFileEncodingQuery(evaluator(), AppClientProjectProperties.SOURCE_ENCODING); Lookup base = Lookups.fixed(new Object[] {
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 static void makeSureProjectHasJspCompilationLibraries(final ReferenceHelper refHelper) { if (refHelper.getProjectLibraryManager() == null) { return;
AuxiliaryConfiguration configuration = helper.createAuxiliaryConfiguration(); eval = createEvaluator(); referenceHelper = new ReferenceHelper(helper, configuration, eval); projectBrowserProvider = new ClientSideProjectBrowserProvider(this); lookup = createLookup(configuration);
public void notifyCopied(Project original, File originalPath, String nueName) { if (original == null) { //do nothing for the original project. return ; } project.getReferenceHelper().fixReferences(originalPath); EjbJarProjectOperations origOperations = original.getLookup().lookup(EjbJarProjectOperations.class); fixLibraryLocation(origOperations); fixOtherReferences(originalPath); project.setName(nueName); }
public void actionPerformed(ActionEvent e) { assert library.getManager() == LibraryManager.getDefault() : "Only converting from non-sharable to sharable is supported."; //NOi18N try { refHelper.copyLibrary(library); } catch (IOException ex) { Exceptions.printStackTrace(ex); } }