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

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

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

origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jdt.launching

/**
 * Returns the VM name from the given container ID path.
 * 
 * @param path the path
 * @return the VM name from the given container ID path
 */
public static String getVMName(IPath path) {
  return path.segment(2);
}    

origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

public static boolean hasDotDot(IPath path) {
  for (int i = 0, length = path.segmentCount(); i < length; i++) {
    if (DOT_DOT.equals(path.segment(i)))
      return true;
  }
  return false;
}
origin: org.eclipse.tycho/org.eclipse.jdt.core

public static boolean hasDotDot(IPath path) {
  for (int i = 0, length = path.segmentCount(); i < length; i++) {
    if (DOT_DOT.equals(path.segment(i)))
      return true;
  }
  return false;
}
origin: org.eclipse.jdt/org.eclipse.jdt.core

@Override
public boolean belongsTo(String projectNameOrJarPath) {
  // used to remove pending jobs because the project was deleted... not to delete index files
  // can be found either by project name or JAR path name
  return projectNameOrJarPath.equals(this.containerPath.segment(0))
    || projectNameOrJarPath.equals(this.containerPath.toString());
}
@Override
origin: org.eclipse.jdt/org.eclipse.jdt.ui

protected boolean isNonProjectSpecificContainer(IPath containerPath) {
  if (containerPath.segmentCount() > 0) {
    String id= containerPath.segment(0);
    if (id.equals(JavaCore.USER_LIBRARY_CONTAINER_ID) || id.equals(JavaRuntime.JRE_CONTAINER)) {
      return true;
    }
  }
  return false;
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

protected void createUserLibrary(final Shell shell, IPath unboundPath) {
  String name= unboundPath.segment(1);
  String id= UserLibraryPreferencePage.ID;
  HashMap<String, Object> data= new HashMap<>(3);
  data.put(UserLibraryPreferencePage.DATA_LIBRARY_TO_SELECT, name);
  data.put(UserLibraryPreferencePage.DATA_DO_CREATE, Boolean.TRUE);
  PreferencesUtil.createPreferenceDialogOn(shell, id, new String[] { id }, data).open();
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

public boolean isDeprecated() {
  if (fEntryKind != IClasspathEntry.CPE_VARIABLE) {
    return false;
  }
  if (fPath.segmentCount() > 0) {
    return JavaCore.getClasspathVariableDeprecationMessage(fPath.segment(0)) != null;
  }
  return false;
}
origin: eclipse/eclipse.jdt.ls

private IPath fixDevice(IPath path) {
  if (path != null && path.getDevice() != null) {
    return path.setDevice(path.getDevice().toUpperCase());
  }
  if (Platform.OS_WIN32.equals(Platform.getOS()) && path != null && path.toString().startsWith("//")) {
    String server = path.segment(0);
    String pathStr = path.toString().replace(server, server.toUpperCase());
    return new Path(pathStr);
  }
  return path;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.core.filesystem

/**
 * @deprecated use {@link #getFileStore(IPath)} instead
 */
@Deprecated
@Override
public IFileStore getChild(IPath path) {
  IFileStore result = this;
  for (int i = 0, imax = path.segmentCount(); i < imax; i++)
    result = result.getChild(path.segment(i));
  return result;
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

private IPath getResolvedPath(IPath path) {
  if (path != null) {
    String varName= path.segment(0);
    if (varName != null) {
      IPath varPath= JavaCore.getClasspathVariable(varName);
      if (varPath != null) {
        return varPath.append(path.removeFirstSegments(1));
      }
    }
  }
  return null;
}
origin: org.eclipse.platform/org.eclipse.core.filesystem

/**
 * @deprecated use {@link #getFileStore(IPath)} instead
 */
@Deprecated
@Override
public IFileStore getChild(IPath path) {
  IFileStore result = this;
  for (int i = 0, imax = path.segmentCount(); i < imax; i++)
    result = result.getChild(path.segment(i));
  return result;
}
origin: org.eclipse.jdt/org.eclipse.jdt.launching

/**
 * @see Object#hashCode()
 */
@Override
public int hashCode() {
  if (getType() == CONTAINER) {
    return getPath().segment(0).hashCode() + getType();
  }
  return getPath().hashCode() + getType();
}
origin: org.eclipse.platform/org.eclipse.team.core

private IResource internalGetResource(IPath fullPath, boolean container) {
  if (container) {
    if (fullPath.segmentCount() == 1)
      return ResourcesPlugin.getWorkspace().getRoot().getProject(fullPath.segment(0));
    return ResourcesPlugin.getWorkspace().getRoot().getFolder(fullPath);
  }
  return ResourcesPlugin.getWorkspace().getRoot().getFile(fullPath);
}
origin: org.eclipse/org.eclipse.jst.ws.consumption.ui

public String getComponentName(){
 IResource resource = getResourceFromInitialSelection();
 if (resource!=null) {
  IPath absolutePath = resource.getFullPath();
  if (absolutePath.isAbsolute()) {
   return absolutePath.segment(1);
  }
 }
 return null;
}

origin: org.eclipse.platform/org.eclipse.core.resources

/**
 * @see org.eclipse.core.resources.IPathVariableManager#resolvePath(IPath)
 */
@Deprecated
@Override
public IPath resolvePath(IPath path) {
  if (path == null || path.segmentCount() == 0 || path.isAbsolute() || path.getDevice() != null)
    return path;
  IPath value = getValue(path.segment(0));
  return value == null ? path : value.append(path.removeFirstSegments(1));
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.core.resources

/**
 * Returns the local file system location in which the meta data for the
 * resource with the given path is stored.
 */
public IPath locationFor(IPath resourcePath) {
  if (Path.ROOT.equals(resourcePath))
    return metaAreaLocation.append(F_ROOT);
  return projectMetaLocation.append(resourcePath.segment(0));
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.core.resources

@Override
public long setLocalTimeStamp(long value) throws CoreException {
  //override to handle changing timestamp on project description file
  long result = super.setLocalTimeStamp(value);
  if (path.segmentCount() == 2 && path.segment(1).equals(IProjectDescription.DESCRIPTION_FILE_NAME)) {
    //handle concurrent project deletion
    ResourceInfo projectInfo = ((Project) getProject()).getResourceInfo(false, false);
    if (projectInfo != null)
      getLocalManager().updateLocalSync(projectInfo, result);
  }
  return result;
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jdt.launching

/**
 * @see IRuntimeClasspathEntry#getVariableName()
 */
@Override
public String getVariableName() {
  if (getType() == IRuntimeClasspathEntry.VARIABLE || getType() == IRuntimeClasspathEntry.CONTAINER) {
    return getPath().segment(0);
  }
  return null;
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.core.resources

@Override
public IContainer getParent() {
  int segments = path.segmentCount();
  //zero and one segments handled by subclasses
  if (segments < 2)
    Assert.isLegal(false, path.toString());
  if (segments == 2)
    return workspace.getRoot().getProject(path.segment(0));
  return (IFolder) workspace.newResource(path.removeLastSegments(1), IResource.FOLDER);
}
origin: org.eclipse/org.eclipse.jdt.ui

private void updateDescription(IClasspathEntry containerEntry) {
  if (containerEntry == null || containerEntry.getPath().segmentCount() != 2) {
    setDescription(NewWizardMessages.UserLibraryWizardPage_description_new); 
  } else {
    setDescription(Messages.format(NewWizardMessages.UserLibraryWizardPage_description_edit, containerEntry.getPath().segment(1))); 
  }
}

org.eclipse.core.runtimeIPathsegment

Javadoc

Returns the specified segment of this path, or null if the path does not have such a segment.

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
  • lastSegment
    Returns the last segment of this path, ornull if it does not have any segments.
  • removeFirstSegments
    Returns a copy of this path with the given number of segments removed from the beginning. The device
  • 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

  • Updating database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • putExtra (Intent)
  • notifyDataSetChanged (ArrayAdapter)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Path (java.nio.file)
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Best plugins for Eclipse
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