Tabnine Logo
IPath.lastSegment
Code IndexAdd Tabnine to your IDE (free)

How to use
lastSegment
method
in
org.eclipse.core.runtime.IPath

Best Java code snippets using org.eclipse.core.runtime.IPath.lastSegment (Showing top 20 results out of 855)

origin: org.eclipse.jdt/org.eclipse.jdt.core

@Override
public String getElementName() {
  return this.externalPath.lastSegment();
}
/**
origin: org.eclipse/org.eclipse.jst.j2ee

protected boolean isSource(IPath path) {
  if (path == null)
    return false;
  return path.lastSegment().endsWith(JavaEEArchiveUtilities.DOT_JAVA) || path.lastSegment().endsWith(DOT_SQLJ);
}
origin: org.eclipse/org.eclipse.compare

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;
}

origin: org.eclipse/org.eclipse.jst.j2ee

/**
 * 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();
}

origin: org.eclipse.platform/org.eclipse.equinox.frameworkadmin.equinox

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();
}
origin: org.eclipse.equinox.frameworkadmin/equinox

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();
}
origin: org.eclipse.jdt/org.eclipse.jdt.core

@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()]);
}
origin: eclipse/buildship

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())));
  }
}
origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

/**
 * 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;
}

origin: org.eclipse/org.eclipse.jdt.ui

  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());
  }
});
origin: org.eclipse.platform/org.eclipse.core.resources

/**
 * 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);
  }
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

public UnpackJarBuilder(JarPackageData jarPackage) {
  fSubfolder= jarPackage.getAbsoluteJarLocation().removeFileExtension().lastSegment() + SUBFOLDER_SUFFIX;
  fSubfolderPath= jarPackage.getAbsoluteJarLocation().removeLastSegments(1).append(fSubfolder);
  fJarPackage= jarPackage;
}
origin: org.eclipse/org.eclipse.jst.j2ee

protected boolean shouldSave(IArchiveResource aFile) {
  if (endsWithClassType(aFile.getPath().lastSegment())) {
    boolean shouldSave = isClassWithoutSource(aFile);
    if (shouldSave && !importedClassesFolderCreated) {
      createImportedClassesFolder();
    }
    return shouldSave;
  }
  return super.shouldSave(aFile);
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.core.resources

/**
 * @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);
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.core.resources

/**
 * 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);
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.core.resources

/**
 * 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);
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

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);
  }
}
origin: org.eclipse/org.eclipse.jst.jsf.core

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);
    }
  }
}

origin: org.eclipse.jdt/org.eclipse.jdt.ui

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);
  }
}
origin: org.eclipse.pde/org.eclipse.pde.ui

@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();
}
org.eclipse.core.runtimeIPathlastSegment

Javadoc

Returns the last segment of this path, or null if it does not have any segments.

Popular methods of IPath

  • toString
    Returns a string representation of this path, including its device id. The same separator, "/", is u
  • toFile
    Returns a java.io.File corresponding to this path.
  • toOSString
    Returns a string representation of this path which uses the platform-dependent path separator define
  • append
    Returns the canonicalized path obtained from the concatenation of the given path's segments to the e
  • segmentCount
    Returns the number of segments in this path. Note that both root and empty paths have 0 segments.
  • removeLastSegments
    Returns a copy of this path with the given number of segments removed from the end. The device id is
  • removeFirstSegments
    Returns a copy of this path with the given number of segments removed from the beginning. The device
  • segment
    Returns the specified segment of this path, ornull if the path does not have such a segment.
  • equals
    Returns whether this path equals the given object. Equality for paths is defined to be: same sequenc
  • isAbsolute
    Returns whether this path is an absolute path (ignoring any device id). Absolute paths start with a
  • isPrefixOf
    Returns whether this path is a prefix of the given path. To be a prefix, this path's segments must a
  • toPortableString
    Returns a platform-neutral string representation of this path. The format is not specified, except t
  • isPrefixOf,
  • toPortableString,
  • makeRelative,
  • makeAbsolute,
  • getDevice,
  • isEmpty,
  • addTrailingSeparator,
  • getFileExtension,
  • setDevice

Popular in Java

  • Start an intent from android
  • getApplicationContext (Context)
  • putExtra (Intent)
  • getExternalFilesDir (Context)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now