congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
IPath.isPrefixOf
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: eclipse/eclipse.jdt.ls

public static boolean isContainedIn(IPath location, Collection<IPath> paths) {
  for (IPath path : paths) {
    if (path.isPrefixOf(location)) {
      return true;
    }
  }
  return false;
}
origin: org.eclipse.jdt/org.eclipse.jdt.core

@Override
public boolean startsWith(IPath path) {
  try {
    return path.isPrefixOf(new Path(this.indexFile.getCanonicalPath()));
  } catch (IOException e) {
    return false;
  }
}
origin: org.eclipse.jdt/org.eclipse.jdt.core

public static int indexOfNestedPath(IPath checkedPath, IPath[] paths, int pathCount) {
  for (int i = 0; i < pathCount; i++){
    if (checkedPath.equals(paths[i])) continue;
    if (checkedPath.isPrefixOf(paths[i])) return i;
  }
  return -1;
}
/**
origin: com.vaadin/vaadin-client-compiler-deps

public static int indexOfNestedPath(IPath checkedPath, IPath[] paths, int pathCount) {
  for (int i = 0; i < pathCount; i++){
    if (checkedPath.equals(paths[i])) continue;
    if (checkedPath.isPrefixOf(paths[i])) return i;
  }
  return -1;
}
/**
origin: Microsoft/vscode-java-test

public static Set<IJavaProject> parseProjects(URI rootFolderURI) {
  final IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
  final IProject[] projects = workspaceRoot.getProjects();
  final IPath parent = filePathFromURI(rootFolderURI);
  return Arrays.stream(projects)
      .filter(p -> parent.isPrefixOf(p.getLocation()))
      .map(p -> getJavaProject(p))
      .filter(p -> p != null)
      .collect(Collectors.toSet());
}
origin: org.eclipse.platform/org.eclipse.core.resources

private void ensureResourceCovered(IResource resource, List<IResource> list) {
  IPath path = resource.getFullPath();
  for (IResource root : list) {
    if (root.getFullPath().isPrefixOf(path)) {
      return;
    }
  }
  list.add(resource);
}
origin: org.eclipse.platform/org.eclipse.team.core

  private boolean isDescendantOfRoot(IResource resource, IResource[] roots) {
    for (int i = 0; i < roots.length; i++) {
      IResource root = roots[i];
      if (root.getFullPath().isPrefixOf(resource.getFullPath())) {
        return true;
      }
    }
    return false;
  }
}
origin: org.openl/org.openl.eclipse.ui

public static boolean isNotInOutputFolder(IFile file, IJavaProject jp) {
  try {
    IPath out = jp.getOutputLocation();
    return !out.isPrefixOf(file.getFullPath());
  } catch (JavaModelException e) {
    return true;
  }
}
origin: eclipse/eclipse.jdt.ls

public static List<IProject> getVisibleProjects(IPath workspaceRoot) {
  List<IProject> projects = new ArrayList<>();
  for (IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) {
    if (project.exists() && isVisibleProject(project) && workspaceRoot.isPrefixOf(project.getLocation())) {
      projects.add(project);
    }
  }
  return projects;
}
origin: eclipse/buildship

  private static boolean sourceDirHasNestedOutputLocation(Iterable<? extends EclipseSourceDirectory> sourceDirs, String outputLocation) {
    IPath outputPath = new Path(outputLocation);
    for (EclipseSourceDirectory sourceDir : sourceDirs) {
      if (sourceDir.getOutput() != null) {
        IPath sourceDirPath = new Path(sourceDir.getOutput());
        if (!outputPath.equals(sourceDirPath) && outputPath.isPrefixOf(sourceDirPath)) {
          return true;
        }
      }
    }
    return false;
  }
}
origin: eclipse/eclipse.jdt.ls

public static IPath findBelongedWorkspaceRoot(IPath filePath) {
  PreferenceManager manager = JavaLanguageServerPlugin.getPreferencesManager();
  Collection<IPath> rootPaths = manager.getPreferences().getRootPaths();
  if (rootPaths != null) {
    for (IPath rootPath : rootPaths) {
      if (rootPath.isPrefixOf(filePath)) {
        return rootPath;
      }
    }
  }
  return null;
}
origin: eclipse/eclipse.jdt.ls

@Override
public boolean contains(ResourceMapping mapping) {
  if (mapping instanceof JavaElementResourceMapping) {
    JavaElementResourceMapping javaMapping = (JavaElementResourceMapping) mapping;
    IJavaElement element = getJavaElement();
    IJavaElement other = javaMapping.getJavaElement();
    if (other != null && element != null) {
      return element.getPath().isPrefixOf(other.getPath());
    }
  }
  return false;
}
origin: org.eclipse.pde/org.eclipse.pde.ui

@Override
public boolean canConfigure(IProject project, Set<IPath> ignoredDirectories, IProgressMonitor monitor) {
  IFile manifestFile = PDEProject.getManifest(project);
  if (manifestFile != null && manifestFile.exists()) {
    for (IPath ignoredDirectory : ignoredDirectories) {
      if (ignoredDirectory.isPrefixOf(manifestFile.getLocation())) {
        return false;
      }
    }
  }
  return hasOSGiManifest(project);
}
origin: org.eclipse.platform/org.eclipse.team.ui

private boolean hasChildrenInScope(ISynchronizationScope scope, Object object, IResource resource) {
  if (!resource.isAccessible())
    return false;
  IResource[] roots = scope.getRoots();
  for (int i = 0; i < roots.length; i++) {
    IResource root = roots[i];
    if (resource.getFullPath().isPrefixOf(root.getFullPath()))
      return true;
  }
  return false;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

@Override
public boolean contains(ResourceMapping mapping) {
  if (mapping instanceof JavaElementResourceMapping) {
    JavaElementResourceMapping javaMapping = (JavaElementResourceMapping) mapping;
    IJavaElement element = getJavaElement();
    IJavaElement other = javaMapping.getJavaElement();
    if (other != null && element != null)
      return element.getPath().isPrefixOf(other.getPath());
  }
  return false;
}
origin: eclipse/buildship

private static IResource tryFindWorkspaceFile(InternalGradleBuild gradleBuild, Path filePath) {
  for (IProject project : getWorkspaceProjectsFor(gradleBuild)) {
    IPath projectLocation = project.getLocation();
    if (projectLocation.isPrefixOf(filePath)) {
      IFile file = project.getFile(filePath.makeRelativeTo(projectLocation));
      if (file.exists()) {
        return file;
      }
    }
  }
  return null;
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.core.resources

private boolean contains(IResource resource, IResource child) {
  if (resource.equals(child))
    return true;
  if (depth == IResource.DEPTH_ZERO)
    return false;
  if (child.getParent().equals(resource))
    return true;
  if (depth == IResource.DEPTH_INFINITE)
    return resource.getFullPath().isPrefixOf(child.getFullPath());
  return false;
}
origin: eclipse/eclipse.jdt.ls

private static IPath getWorkspacePath(IPath path) {
  PreferenceManager manager = JavaLanguageServerPlugin.getPreferencesManager();
  Collection<IPath> rootPaths = manager.getPreferences().getRootPaths();
  if (rootPaths != null) {
    for (IPath rootPath : rootPaths) {
      if (rootPath.isPrefixOf(path)) {
        return path.makeRelativeTo(rootPath.append(".."));
      }
    }
  }
  return path;
}
origin: org.eclipse.platform/org.eclipse.core.resources

private boolean contains(IResource resource, IResource child) {
  if (resource.equals(child))
    return true;
  if (depth == IResource.DEPTH_ZERO)
    return false;
  if (child.getParent().equals(resource))
    return true;
  if (depth == IResource.DEPTH_INFINITE)
    return resource.getFullPath().isPrefixOf(child.getFullPath());
  return false;
}
origin: org.eclipse.jdt/org.eclipse.jdt.core

public static class ClasspathResolutionBreakpointListener {
  public void breakpoint(int bp) {
    // override in listener implementation
  }
}
org.eclipse.core.runtimeIPathisPrefixOf

Javadoc

Returns whether this path is a prefix of the given path. To be a prefix, this path's segments must appear in the argument path in the same order, and their device ids must match.

An empty path is a prefix of all paths with the same device; a root path is a prefix of all absolute paths with the same device.

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
  • 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
  • toPortableString
    Returns a platform-neutral string representation of this path. The format is not specified, except t
  • isAbsolute,
  • toPortableString,
  • makeRelative,
  • makeAbsolute,
  • getDevice,
  • isEmpty,
  • addTrailingSeparator,
  • getFileExtension,
  • setDevice

Popular in Java

  • Finding current android device location
  • getContentResolver (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • requestLocationUpdates (LocationManager)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • JButton (javax.swing)
  • JOptionPane (javax.swing)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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