private static String getTitel(CPListElement newEntry, boolean linkedMode) { if (newEntry.getPath() == null) { if (linkedMode) { return NewWizardMessages.NewSourceFolderCreationWizard_link_title; } else { return NewWizardMessages.NewSourceFolderCreationWizard_title; } } else { return NewWizardMessages.NewSourceFolderCreationWizard_edit_title; } }
private static String getTitel(CPListElement newEntry, boolean linkedMode) { if (newEntry.getPath() == null) { if (linkedMode) { return NewWizardMessages.NewSourceFolderCreationWizard_link_title; } else { return NewWizardMessages.NewSourceFolderCreationWizard_title; } } else { return NewWizardMessages.NewSourceFolderCreationWizard_edit_title; } }
private static String getTitel(CPListElement newEntry, boolean linkedMode) { if (newEntry.getPath() == null) { if (linkedMode) { return NewWizardMessages.NewSourceFolderCreationWizard_link_title; } else { return NewWizardMessages.NewSourceFolderCreationWizard_title; } } else { return NewWizardMessages.NewSourceFolderCreationWizard_edit_title; } }
@Override public int hashCode() { return fKey.hashCode() * 89 + fParent.getPath().hashCode(); }
public boolean isInContainer(String containerName) { if (fParentContainer instanceof CPListElement) { CPListElement elem= (CPListElement) fParentContainer; return new Path(containerName).isPrefixOf(elem.getPath()); } return false; }
public boolean isInContainer(String containerName) { if (fParentContainer instanceof CPListElement) { CPListElement elem= (CPListElement) fParentContainer; return new Path(containerName).isPrefixOf(elem.getPath()); } return false; }
private void addExclusionPatterns(CPListElement newEntry, List<CPListElement> existing, Set<CPListElement> modifiedEntries) { IPath entryPath= newEntry.getPath(); for (int i= 0; i < existing.size(); i++) { CPListElement curr= existing.get(i); IPath currPath= curr.getPath(); if (curr != newEntry && curr.getEntryKind() == IClasspathEntry.CPE_SOURCE && currPath.isPrefixOf(entryPath)) { boolean added= curr.addToExclusions(entryPath); if (added) { modifiedEntries.add(curr); } } } }
private CPListElement[] openJarFileDialog(CPListElement existing, Object parent) { if (existing == null) { return doOpenExternalJarFileDialog(existing, parent); } IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot(); IPath path = existing.getPath(); if (root.exists(path)) { return doOpenInternalJarFileDialog(existing, parent); } return doOpenExternalJarFileDialog(existing, parent); }
private CPListElement[] openJarFileDialog(CPListElement existing, Object parent) { if (existing == null) { return doOpenExternalJarFileDialog(existing, parent); } IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot(); IPath path = existing.getPath(); if (root.exists(path)) { return doOpenInternalJarFileDialog(existing, parent); } return doOpenExternalJarFileDialog(existing, parent); }
private static CPListElement findElement(IJavaElement element, CPListElement[] elements) { IPath path= element.getPath(); for (int i= 0; i < elements.length; i++) { CPListElement cur= elements[i]; if (cur.getEntryKind() == IClasspathEntry.CPE_SOURCE && cur.getPath().equals(path)) { return cur; } } return null; }
private static CPListElement findElement(IJavaElement element, CPListElement[] elements) { IPath path= element.getPath(); for (int i= 0; i < elements.length; i++) { CPListElement cur= elements[i]; if (cur.getEntryKind() == IClasspathEntry.CPE_SOURCE && cur.getPath().equals(path)) { return cur; } } return null; }
private void attributeUpdated(CPListElement selElement, String[] changedAttributes) { Object parentContainer= selElement.getParentContainer(); if (parentContainer instanceof CPListElement) { // inside a container: apply changes right away IClasspathEntry updatedEntry= selElement.getClasspathEntry(); updateContainerEntry(updatedEntry, changedAttributes, fCurrJProject, ((CPListElement) parentContainer).getPath()); } }
private void attributeUpdated(CPListElement selElement, String[] changedAttributes) { Object parentContainer= selElement.getParentContainer(); if (parentContainer instanceof CPListElement) { // inside a container: apply changes right away IClasspathEntry updatedEntry= selElement.getClasspathEntry(); updateContainerEntry(updatedEntry, changedAttributes, fCurrJProject, ((CPListElement) parentContainer).getPath()); } }
private static CPListElement findElement(IJavaElement element, CPListElement[] elements) { IPath path= element.getPath(); for (int i= 0; i < elements.length; i++) { CPListElement cur= elements[i]; if (cur.getEntryKind() == IClasspathEntry.CPE_SOURCE && cur.getPath().equals(path)) { return cur; } } return null; }
private static boolean addToExclusions(IPath entryPath, CPListElement curr) { IPath[] exclusionFilters= (IPath[]) curr.getAttribute(CPListElement.EXCLUSION); if (!JavaModelUtil.isExcludedPath(entryPath, exclusionFilters)) { IPath pathToExclude= entryPath.removeFirstSegments(curr.getPath().segmentCount()).addTrailingSeparator(); IPath[] newExclusionFilters= new IPath[exclusionFilters.length + 1]; System.arraycopy(exclusionFilters, 0, newExclusionFilters, 0, exclusionFilters.length); newExclusionFilters[exclusionFilters.length]= pathToExclude; curr.setAttribute(CPListElement.EXCLUSION, newExclusionFilters); return true; } return false; }
private static boolean addToExclusions(IPath entryPath, CPListElement curr) { IPath[] exclusionFilters= (IPath[]) curr.getAttribute(CPListElement.EXCLUSION); if (!JavaModelUtil.isExcludedPath(entryPath, exclusionFilters)) { IPath pathToExclude= entryPath.removeFirstSegments(curr.getPath().segmentCount()).addTrailingSeparator(); IPath[] newExclusionFilters= new IPath[exclusionFilters.length + 1]; System.arraycopy(exclusionFilters, 0, newExclusionFilters, 0, exclusionFilters.length); newExclusionFilters[exclusionFilters.length]= pathToExclude; curr.setAttribute(CPListElement.EXCLUSION, newExclusionFilters); return true; } return false; }
private static boolean addToExclusions(IPath entryPath, CPListElement curr) { IPath[] exclusionFilters= (IPath[]) curr.getAttribute(CPListElement.EXCLUSION); if (!JavaModelUtil.isExcludedPath(entryPath, exclusionFilters)) { IPath pathToExclude= entryPath.removeFirstSegments(curr.getPath().segmentCount()).addTrailingSeparator(); IPath[] newExclusionFilters= new IPath[exclusionFilters.length + 1]; System.arraycopy(exclusionFilters, 0, newExclusionFilters, 0, exclusionFilters.length); newExclusionFilters[exclusionFilters.length]= pathToExclude; curr.setAttribute(CPListElement.EXCLUSION, newExclusionFilters); return true; } return false; }
@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); } }