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

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

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

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

protected boolean equalsOneOf(IPath path, IPath[] otherPaths) {
  for (int i = 0, length = otherPaths.length; i < length; i++) {
    if (path.equals(otherPaths[i])) {
      return true;
    }
  }
  return false;
}
/**
origin: org.eclipse.platform/org.eclipse.core.resources

@Override
public boolean equals(Object o) {
  if (o == null) {
    return false;
  }
  if (o.getClass() != this.getClass())
    return false;
  LinkDescription other = (LinkDescription) o;
  return localLocation.equals(other.localLocation) && path.equals(other.path) && type == other.type;
}
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: org.eclipse/org.eclipse.jst.j2ee.core

public static void verifyRelative(IPath archiveRelativePath) {
  if (archiveRelativePath.isAbsolute() && !archiveRelativePath.equals(IArchive.EMPTY_MODEL_PATH)) {
    throw new RuntimeException(archiveRelativePath + " must be relative."); //$NON-NLS-1$
  }
}
origin: org.eclipse/org.eclipse.jdt.ui

private boolean toBeDeleted(IClasspathEntry entry){
  if (entry == null) //safety net
    return false; 
  return fPathToDelete.equals(entry.getPath());
}

origin: eclipse/buildship

private boolean isDirectChildOfWorkspaceRootFolder(File location) {
  IWorkspace workspace = ResourcesPlugin.getWorkspace();
  IPath rootLocationPath = workspace.getRoot().getLocation();
  IPath locationPath = Path.fromOSString(location.getPath());
  return rootLocationPath.equals(locationPath) || rootLocationPath.equals(locationPath.removeLastSegments(1));
}
origin: eclipse/eclipse.jdt.ls

@Override
public boolean applies(IProgressMonitor monitor) throws OperationCanceledException, CoreException {
  IPath workspaceLocation = ResourcesPlugin.getWorkspace().getRoot().getLocation();
  IPath rootPath = ResourceUtils.filePathFromURI(rootFolder.toPath().toUri().toString());
  if (workspaceLocation.equals(rootPath)) {
    return false;
  }
  return ProjectUtils.getVisibleProjects(rootPath).isEmpty();
}
origin: org.eclipse/org.eclipse.jdt.ui

private int indexOfClasspath(IClasspathEntry[] entries, IPath path) {
  for (int i= 0; i < entries.length; i++) {
    IClasspathEntry curr= entries[i];
    if (curr.getEntryKind() == IClasspathEntry.CPE_CONTAINER && curr.getPath().equals(path)) {
      return i;
    }
  }
  return -1;
}

origin: infinitest/infinitest

@Override
public ProjectFacade findProject(IPath path) {
  for (IJavaProject project : openProjects()) {
    if (project.getPath().equals(path)) {
      return createProjectFacade(project);
    }
  }
  return null;
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

/**
 * Tests if the package fragment root is located on the project.
 *
 * @param root the package fragment root
 * @return returns <code>true</code> if the package fragment root is the located on the project
 */
protected boolean isProjectPackageFragmentRoot(IPackageFragmentRoot root) {
  IJavaProject javaProject= root.getJavaProject();
  return javaProject != null && javaProject.getPath().equals(root.getPath());
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

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

private boolean isOurEntry(IClasspathEntry cpe) {
  if (cpe.getEntryKind() != IClasspathEntry.CPE_PROJECT)
    return false;
  if (!cpe.getPath().equals(getResourcePath()))
    return false;
  return true;
}
origin: eclipse/eclipse.jdt.ls

public static boolean isOnSourcePath(IPath sourcePath, IJavaProject project) throws JavaModelException {
  for (IClasspathEntry entry : project.getRawClasspath()) {
    if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE && entry.getPath().equals(sourcePath)) {
      return true;
    }
  }
  return false;
}
origin: eclipse/buildship

private IRuntimeClasspathEntry[] resolveRuntimeClasspathEntry(IRuntimeClasspathEntry entry, IJavaProject project, LaunchConfigurationScope configurationScopes) throws CoreException {
  if (entry.getType() != IRuntimeClasspathEntry.CONTAINER || !entry.getPath().equals(GradleClasspathContainer.CONTAINER_PATH)) {
    return new IRuntimeClasspathEntry[0];
  }
  return collectContainerRuntimeClasspathIfPresent(project, configurationScopes);
}
origin: org.eclipse/org.eclipse.jdt.ui

private IPath getFolderPath(IPath packPath, IPath relpath) {
  int remainingSegments= packPath.segmentCount() - relpath.segmentCount();
  if (remainingSegments >= 0) {
    IPath common= packPath.removeFirstSegments(remainingSegments);
    if (common.equals(relpath)) {
      return packPath.uptoSegment(remainingSegments);
    }
  }
  return null;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.ltk.core.refactoring

@Override
public void bufferCreated(IFileBuffer buffer) {
  // begin https://bugs.eclipse.org/bugs/show_bug.cgi?id=67821
  if (buffer.getLocation().equals(fFile.getFullPath()) && buffer instanceof ITextFileBuffer) {
    ITextFileBuffer textBuffer= (ITextFileBuffer)buffer;
    if (fDocumentListener == null)
      fDocumentListener= new DocumentChangedListener();
    textBuffer.getDocument().addDocumentListener(fDocumentListener);
  }
  // end fix https://bugs.eclipse.org/bugs/show_bug.cgi?id=67821
}
@Override
origin: eclipse/eclipse.jdt.ls

private static void updateReferencedClasspathEntry(IJavaProject javaProject, IClasspathEntry newEntry, IProgressMonitor monitor) throws JavaModelException {
  List<IClasspathEntry> newEntries = updateElements(javaProject.getReferencedClasspathEntries(), newEntry, (entry) -> {
    return entry.getEntryKind() == newEntry.getEntryKind() && entry.getPath().equals(newEntry.getPath());
  });
  javaProject.setRawClasspath(javaProject.getRawClasspath(), newEntries.toArray(new IClasspathEntry[0]), javaProject.getOutputLocation(), monitor);
}
origin: eclipse/eclipse.jdt.ls

private static void updateContainerClasspath(IJavaProject javaProject, IPath containerPath, IClasspathEntry newEntry) throws CoreException {
  IClasspathContainer container = JavaCore.getClasspathContainer(containerPath, javaProject);
  List<IClasspathEntry> newEntries = updateElements(container.getClasspathEntries(), newEntry, (entry) -> {
    return entry.getEntryKind() == newEntry.getEntryKind() && entry.getPath().equals(newEntry.getPath());
  });
  IClasspathContainer updatedContainer = new UpdatedClasspathContainer(container, newEntries.toArray(new IClasspathEntry[0]));
  ClasspathContainerInitializer initializer = JavaCore.getClasspathContainerInitializer(containerPath.segment(0));
  if (initializer != null) {
    initializer.requestClasspathContainerUpdate(containerPath, javaProject, updatedContainer);
  }
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

@Override
public IClasspathEntry getSelection() {
  if (fEditResult != null) {
    if (fOldClasspathEntry != null && fOldClasspathEntry.getPath().equals(fEditResult.getPath())) {
      return JavaCore.newContainerEntry(fEditResult.getPath(), fOldClasspathEntry.getAccessRules(), fOldClasspathEntry.getExtraAttributes(), fOldClasspathEntry.isExported());
    } else {
      return JavaCore.newContainerEntry(fEditResult.getPath(), false);
    }
  }
  return null;
}
origin: org.eclipse.jdt/org.eclipse.jdt.launching

@Override
public boolean equals(Object obj) {
  if (obj instanceof LibraryLocation) {
    LibraryLocation lib = (LibraryLocation)obj;
    return getSystemLibraryPath().equals(lib.getSystemLibraryPath())
      && equals(getSystemLibrarySourcePath(), lib.getSystemLibrarySourcePath())
      && equals(getExternalAnnotationsPath(), lib.getExternalAnnotationsPath())
      && equals(getPackageRootPath(), lib.getPackageRootPath())
      && LaunchingPlugin.sameURL(getJavadocLocation(), lib.getJavadocLocation());
  }
  return false;
}
org.eclipse.core.runtimeIPathequals

Javadoc

Returns whether this path equals the given object.

Equality for paths is defined to be: same sequence of segments, same absolute/relative status, and same device. Trailing separators are disregarded. Paths are not generally considered equal to objects other than paths.

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.
  • 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

  • Reactive rest calls using spring rest template
  • getSystemService (Context)
  • onRequestPermissionsResult (Fragment)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Notification (javax.management)
  • BoxLayout (javax.swing)
  • Top plugins for Android Studio
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