@Override public String getElementName() { return this.externalPath.lastSegment(); } /**
protected boolean isSource(IPath path) { if (path == null) return false; return path.lastSegment().endsWith(JavaEEArchiveUtilities.DOT_JAVA) || path.lastSegment().endsWith(DOT_SQLJ); }
private IPath getRejectFilePath(IPath path) { IPath pp= null; if (path.segmentCount() > 1) { pp= path.removeLastSegments(1); pp= pp.append(path.lastSegment() + REJECT_FILE_EXTENSION); } else pp= new Path(path.lastSegment() + REJECT_FILE_EXTENSION); return pp; }
/** * Retrieves the archive name for the specified classpath entry * @param entry The entry. * @return The archive name. */ public static String getArchiveName(final IClasspathEntry entry) { final IPath entryLocation = getEntryLocation(entry); return entryLocation.lastSegment(); }
public static File fromOSGiJarToOSGiInstallArea(String path) { IPath parentFolder = new Path(path).removeLastSegments(1); if ("plugins".equalsIgnoreCase(parentFolder.lastSegment())) //$NON-NLS-1$ return parentFolder.removeLastSegments(1).toFile(); return parentFolder.toFile(); }
public static File fromOSGiJarToOSGiInstallArea(String path) { IPath parentFolder = new Path(path).removeLastSegments(1); if ("plugins".equalsIgnoreCase(parentFolder.lastSegment())) //$NON-NLS-1$ return parentFolder.removeLastSegments(1).toFile(); return parentFolder.toFile(); }
@Override public IPath[] enclosingProjectsAndJars() { IPath[] unfiltered = this.searchScope.enclosingProjectsAndJars(); List<IPath> result = new ArrayList<>(); for (IPath next : unfiltered) { if (isJarFile(next.lastSegment())) { continue; } result.add(next); } return result.toArray(new IPath[result.size()]); }
private IRuntimeClasspathEntry[] resolveOptional(IRuntimeClasspathEntry entry) throws CoreException { if (isOptional(entry.getClasspathEntry())) { return EMPTY_RESULT; } else { throw new CoreException(new Status(IStatus.ERROR, CorePlugin.PLUGIN_ID, String.format("The project: %s which is referenced by the classpath, does not exist", entry.getPath().lastSegment()))); } }
/** * Returns the java project that corresponds to the given path. * Returns null if the path doesn't correspond to a project. */ private static IJavaProject getJavaProject(IPath path, IJavaModel model) { IJavaProject project = model.getJavaProject(path.lastSegment()); if (project.exists()) { return project; } return null; }
public void widgetSelected(SelectionEvent event) { String temp= fAntText.getText(); IPath path= Path.fromOSString(temp); String file= path.lastSegment(); if (file == null) file= "javadoc.xml";//$NON-NLS-1$ path= path.removeLastSegments(1); String selected= handleFolderBrowseButtonPressed(path.toOSString(), JavadocExportMessages.JavadocSpecificsWizardPage_antscriptbrowsedialog_title, JavadocExportMessages.JavadocSpecificsWizardPage_antscriptbrowsedialog_label); path= Path.fromOSString(selected).append(file); fAntText.setText(path.toOSString()); } });
/** * Replaces the node at the specified key with the given node */ protected void replaceNode(IPath key, DataTreeNode node) { DataTreeNode found; if (key.isRoot()) { this.setRootNode(node); } else { found = this.findNodeAt(key.removeLastSegments(1)); found.replaceChild(key.lastSegment(), node); } }
public UnpackJarBuilder(JarPackageData jarPackage) { fSubfolder= jarPackage.getAbsoluteJarLocation().removeFileExtension().lastSegment() + SUBFOLDER_SUFFIX; fSubfolderPath= jarPackage.getAbsoluteJarLocation().removeLastSegments(1).append(fSubfolder); fJarPackage= jarPackage; }
protected boolean shouldSave(IArchiveResource aFile) { if (endsWithClassType(aFile.getPath().lastSegment())) { boolean shouldSave = isClassWithoutSource(aFile); if (shouldSave && !importedClassesFolderCreated) { createImportedClassesFolder(); } return shouldSave; } return super.shouldSave(aFile); }
/** * @see AbstractDataTreeNode#compareWithParent(IPath, DeltaDataTree, IComparator) */ @Override AbstractDataTreeNode compareWithParent(IPath key, DeltaDataTree parent, IComparator comparator) { AbstractDataTreeNode[] comparedChildren = compareWithParent(children, key, parent, comparator); Object oldData = parent.getData(key); return new DataTreeNode(key.lastSegment(), new NodeComparison(oldData, oldData, NodeComparison.K_CHANGED, 0), comparedChildren); }
/** * Replaces the node at the specified key with the given node */ protected void replaceNode(IPath key, DataTreeNode node) { DataTreeNode found; if (key.isRoot()) { this.setRootNode(node); } else { found = this.findNodeAt(key.removeLastSegments(1)); found.replaceChild(key.lastSegment(), node); } }
/** * Replaces the node at the specified key with the given node */ protected void replaceNode(IPath key, DataTreeNode node) { DataTreeNode found; if (key.isRoot()) { this.setRootNode(node); } else { found = this.findNodeAt(key.removeLastSegments(1)); found.replaceChild(key.lastSegment(), node); } }
private String getPathString(IPath path, boolean isExternal) { if (ArchiveFileFilter.isArchivePath(path, true)) { String appended= BasicElementLabels.getPathLabel(path.removeLastSegments(1), isExternal); String lastSegment= BasicElementLabels.getResourceName(path.lastSegment()); return Messages.format(NewWizardMessages.CPListLabelProvider_twopart, new String[] { lastSegment, appended }); } else { return BasicElementLabels.getPathLabel(path, isExternal); } }
public void initialize(IPath containerPath, IJavaProject project) throws CoreException { if (isJSFLibraryContainer(containerPath)) { String libId= containerPath.lastSegment(); JSFLibrary ref= JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry().getJSFLibraryByID(libId); if (ref != null) { JSFLibraryClasspathContainer container= new JSFLibraryClasspathContainer(ref); JavaCore.setClasspathContainer(containerPath, new IJavaProject[] { project }, new IClasspathContainer[] { container }, null); } } }
private String getPathString(IPath path, boolean isExternal) { if (ArchiveFileFilter.isArchivePath(path, true)) { String appended= BasicElementLabels.getPathLabel(path.removeLastSegments(1), isExternal); String lastSegment= BasicElementLabels.getResourceName(path.lastSegment()); return Messages.format(NewWizardMessages.CPListLabelProvider_twopart, new String[] { lastSegment, appended }); } else { return BasicElementLabels.getPathLabel(path, isExternal); } }
@Override public String getText(Object obj) { IClasspathEntry entry = (IClasspathEntry) obj; int kind = entry.getEntryKind(); if (kind == IClasspathEntry.CPE_PROJECT) return entry.getPath().segment(0); IPath path = entry.getPath(); String name = path.lastSegment(); return name + " - " //$NON-NLS-1$ + path.uptoSegment(path.segmentCount() - 1).toOSString(); }