public IJavaProject getJavaProject() { return ((CPListElement)fCPListElements.get(0)).getJavaProject(); }
public AddSourceFolderWizard(CPListElement[] existingEntries, CPListElement newEntry, IPath outputLocation, boolean linkedMode, boolean canCommitConflict, boolean allowConflict, boolean allowRemoveProjectFolder, boolean allowAddExclusionPatterns) { this(existingEntries, newEntry, outputLocation, linkedMode, canCommitConflict, allowConflict, allowRemoveProjectFolder, allowAddExclusionPatterns, newEntry.getJavaProject().getProject()); }
public AddSourceFolderWizard(CPListElement[] existingEntries, CPListElement newEntry, IPath outputLocation, boolean linkedMode, boolean canCommitConflict, boolean allowConflict, boolean allowRemoveProjectFolder, boolean allowAddExclusionPatterns) { this(existingEntries, newEntry, outputLocation, linkedMode, canCommitConflict, allowConflict, allowRemoveProjectFolder, allowAddExclusionPatterns, newEntry.getJavaProject().getProject()); }
@Override public IJavaProject getJavaProject() { return getParent().getJavaProject(); } @Override
public AddSourceFolderWizard(CPListElement[] existingEntries, CPListElement newEntry, IPath outputLocation, boolean linkedMode, boolean canCommitConflict, boolean allowConflict, boolean allowRemoveProjectFolder, boolean allowAddExclusionPatterns) { this(existingEntries, newEntry, outputLocation, linkedMode, canCommitConflict, allowConflict, allowRemoveProjectFolder, allowAddExclusionPatterns, newEntry.getJavaProject().getProject()); }
@Override public IJavaProject getJavaProject() { return getParent().getJavaProject(); } @Override
private static AddSourceFolderWizard newLinkedSourceFolderWizard(CPListElement element, List<CPListElement> existingElements, String outputLocation, boolean newFolder) { CPListElement[] existing= existingElements.toArray(new CPListElement[existingElements.size()]); AddSourceFolderWizard wizard= new AddSourceFolderWizard(existing, element, new Path(outputLocation).makeAbsolute(), true, newFolder, newFolder, newFolder?CPListElement.isProjectSourceFolder(existing, element.getJavaProject()):false, newFolder); wizard.setDoFlushChange(false); return wizard; }
private boolean isUnnamedModule() { IModuleDescription module= null; try { module= fCurrCPElement.getJavaProject().getModuleDescription(); } catch (JavaModelException e) { JavaPlugin.log(e); } return module == null; }
private static AddSourceFolderWizard newSourceFolderWizard(CPListElement element, List/*<CPListElement>*/ existingElements, String outputLocation, boolean newFolder) { CPListElement[] existing= (CPListElement[])existingElements.toArray(new CPListElement[existingElements.size()]); AddSourceFolderWizard wizard= new AddSourceFolderWizard(existing, element, new Path(outputLocation).makeAbsolute(), false, newFolder, newFolder, newFolder?CPListElement.isProjectSourceFolder(existing, element.getJavaProject()):false, newFolder); wizard.setDoFlushChange(false); return wizard; }
private static AddSourceFolderWizard newSourceFolderWizard(CPListElement element, List<CPListElement> existingElements, String outputLocation, boolean newFolder) { CPListElement[] existing= existingElements.toArray(new CPListElement[existingElements.size()]); AddSourceFolderWizard wizard= new AddSourceFolderWizard(existing, element, new Path(outputLocation).makeAbsolute(), false, newFolder, newFolder, newFolder?CPListElement.isProjectSourceFolder(existing, element.getJavaProject()):false, newFolder); wizard.setDoFlushChange(false); return wizard; }
private IPackageFragmentRoot[] findRoots(CPListElement element) { IClasspathEntry entry= element.getClasspathEntry(); IPackageFragmentRoot[] roots= element.getJavaProject().findPackageFragmentRoots(entry); if (roots.length == 0) { // 2nd attempt in case "module=true" is not explicit on the real cp entry: entry= copyCPEntryWithoutModuleAttribute(entry); if (entry != null) roots= element.getJavaProject().findPackageFragmentRoots(entry); } return roots; }
private static AddSourceFolderWizard newLinkedSourceFolderWizard(CPListElement element, List/*<CPListElement>*/ existingElements, String outputLocation, boolean newFolder) { CPListElement[] existing= (CPListElement[])existingElements.toArray(new CPListElement[existingElements.size()]); AddSourceFolderWizard wizard= new AddSourceFolderWizard(existing, element, new Path(outputLocation).makeAbsolute(), true, newFolder, newFolder, newFolder?CPListElement.isProjectSourceFolder(existing, element.getJavaProject()):false, newFolder); wizard.setDoFlushChange(false); return wizard; }
private static AddSourceFolderWizard newSourceFolderWizard(CPListElement element, List<CPListElement> existingElements, String outputLocation, boolean newFolder) { CPListElement[] existing= existingElements.toArray(new CPListElement[existingElements.size()]); AddSourceFolderWizard wizard= new AddSourceFolderWizard(existing, element, new Path(outputLocation).makeAbsolute(), false, newFolder, newFolder, newFolder?CPListElement.isProjectSourceFolder(existing, element.getJavaProject()):false, newFolder); wizard.setDoFlushChange(false); return wizard; }
private static AddSourceFolderWizard newLinkedSourceFolderWizard(CPListElement element, List<CPListElement> existingElements, String outputLocation, boolean newFolder) { CPListElement[] existing= existingElements.toArray(new CPListElement[existingElements.size()]); AddSourceFolderWizard wizard= new AddSourceFolderWizard(existing, element, new Path(outputLocation).makeAbsolute(), true, newFolder, newFolder, newFolder?CPListElement.isProjectSourceFolder(existing, element.getJavaProject()):false, newFolder); wizard.setDoFlushChange(false); return wizard; }
private String getCurrentModuleName() { IModuleDescription module= null; try { module= fCurrCPElement.getJavaProject().getModuleDescription(); } catch (JavaModelException e) { JavaPlugin.log(e); } return module != null ? module.getElementName() : JavaModelUtil.ALL_UNNAMED; }
@Override protected void finishPage(IProgressMonitor monitor) throws InterruptedException, CoreException { if (fDoFlushChange) { IJavaProject javaProject= getEntryToEdit().getJavaProject(); BuildPathsBlock.flush(getExistingEntries(), getOutputLocation(), javaProject, null, monitor); IProject project= javaProject.getProject(); IPath path= getEntryToEdit().getPath(); IResource folder= project.getWorkspace().getRoot().findMember(path); fPackageFragmentRoot= javaProject.getPackageFragmentRoot(folder); } }
@Override protected void finishPage(IProgressMonitor monitor) throws InterruptedException, CoreException { if (fDoFlushChange) { IJavaProject javaProject= getEntryToEdit().getJavaProject(); BuildPathsBlock.flush(getExistingEntries(), getOutputLocation(), javaProject, null, monitor); IProject project= javaProject.getProject(); IPath path= getEntryToEdit().getPath(); IResource folder= project.getWorkspace().getRoot().findMember(path); fPackageFragmentRoot= javaProject.getPackageFragmentRoot(folder); } }
/** * {@inheritDoc} */ protected void finishPage(IProgressMonitor monitor) throws InterruptedException, CoreException { if (fDoFlushChange) { IJavaProject javaProject= getEntryToEdit().getJavaProject(); BuildPathsBlock.flush(getExistingEntries(), getOutputLocation(), javaProject, monitor); IProject project= javaProject.getProject(); IPath path= getEntryToEdit().getPath(); IResource folder= project.getWorkspace().getRoot().findMember(path); fPackageFragmentRoot= javaProject.getPackageFragmentRoot(folder); } }
private void updateStatus() { fCurrElement.setAttribute(CPListElement.INCLUSION, getInclusionPattern()); fCurrElement.setAttribute(CPListElement.EXCLUSION, getExclusionPattern()); IJavaModelStatus status= JavaConventions.validateClasspath(fCurrElement.getJavaProject(), CPListElement.convertToClasspathEntries(fExistingEntries), fOutputLocation); if (!status.isOK()) { StatusInfo statusInfo= new StatusInfo(); statusInfo.setError(status.getMessage()); updateStatus(statusInfo); } else { StatusInfo statusInfo= new StatusInfo(); statusInfo.setOK(); updateStatus(statusInfo); } }
private void updateStatus() { fCurrElement.setAttribute(CPListElement.INCLUSION, getInclusionPattern()); fCurrElement.setAttribute(CPListElement.EXCLUSION, getExclusionPattern()); IJavaModelStatus status= JavaConventions.validateClasspath(fCurrElement.getJavaProject(), CPListElement.convertToClasspathEntries(fExistingEntries), fOutputLocation); if (!status.isOK()) { StatusInfo statusInfo= new StatusInfo(); statusInfo.setError(status.getMessage()); updateStatus(statusInfo); } else { StatusInfo statusInfo= new StatusInfo(); statusInfo.setOK(); updateStatus(statusInfo); } }