Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.IPath.segment()


  private boolean compilerSupportsParameterizedTypes() {
    if (fDocument != null) {
      IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
      IPath location = TaglibController.getLocation(fDocument);
      if (location != null && location.segmentCount() > 0) {
        IJavaProject project = JavaCore.create(root.getProject(location.segment(0)));
        String compliance = project.getOption(JavaCore.COMPILER_SOURCE, true);
        try {
          return Float.parseFloat(compliance) >= 1.5;
        }
        catch (NumberFormatException e) {
View Full Code Here


              IPath basePath = new Path(model.getBaseLocation());
              IResource derivedResource = null;
              if (basePath.segmentCount() > 1)
                derivedResource = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath);
              else
                derivedResource = ResourcesPlugin.getWorkspace().getRoot().getProject(basePath.segment(0));
              IPath derivedPath = derivedResource.getLocation();
              if (derivedPath != null) {
                baseLocation = derivedPath.toString();
              }
              else {
View Full Code Here

            if (delta.getKind() == IResourceDelta.CHANGED && (delta.getFlags() == IResourceDelta.ENCODING || delta.getFlags() == IResourceDelta.MARKERS))
              return false;

            IPath path = resource.getFullPath();
            int segmentCount = path.segmentCount();
            if (segmentCount > 1 && path.lastSegment().equals(WEB_XML) && path.segment(segmentCount - 2).equals(WEB_INF)) {
              getInstance().deploymentDescriptorChanged(path);
            }
          }
          else if (resource.getType() == IResource.PROJECT) {
            String name = resource.getName();
View Full Code Here

      // https://bugs.eclipse.org/bugs/show_bug.cgi?id=79686
      IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
      IPath filePath = new Path(baseLocation);
      IProject project = null;
      if (filePath.segmentCount() > 0) {
        project = root.getProject(filePath.segment(0));
      }
//      IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(new Path(baseLocation));
//      for (int i = 0; project == null && i < files.length; i++) {
//        if (files[i].getType() != IResource.PROJECT) {
//          project = files[i].getProject();
View Full Code Here

    // try file buffers
    ITextFileBuffer textFileBuffer = FileBuffers.getTextFileBufferManager().getTextFileBuffer(document);
    if (textFileBuffer != null) {
      IPath basePath = textFileBuffer.getLocation();
      if (basePath != null && !basePath.isEmpty()) {
        IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(basePath.segment(0));
        if (basePath.segmentCount() > 1 && project.isAccessible()) {
          return createJavaElementHyperlink(JavaCore.create(project), elementName, region);
        }
      }
    }
View Full Code Here

          }
        }
        else {
          IPath basePath = new Path(baseLocation);
          if (basePath.segmentCount() > 1) {
            return createJavaElementHyperlink(JavaCore.create(ResourcesPlugin.getWorkspace().getRoot().getProject(basePath.segment(0))), elementName, region);
          }
        }
      }
    }
    finally {
View Full Code Here

          for (int i = 0; i < classpathEntries.length; i++) {
            IClasspathEntry classpathEntry = classpathEntries[i];
            if (classpathEntry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
              IPath libraryPath = classpathEntry.getPath();
              if (libraryPath.getFileExtension() != null && libraryPath.getFileExtension().length() > 0) {
                if (libraryPath.getDevice() == null && workspaceRoot.getProject(libraryPath.segment(0)).exists()) {
                  libraryPath = workspaceRoot.getFile(libraryPath).getLocation();
                }
                String libraryPathString = libraryPath.toString();
                JarFile jarFile = null;
                try {
View Full Code Here

  public static boolean isTapestryLibraryContainer(IClasspathEntry cpEntry) {
    if (cpEntry.getEntryKind() != IClasspathEntry.CPE_CONTAINER)
      return false;
   
    IPath path = cpEntry.getPath();
    return path != null && path.segmentCount() == 2 && Tapestry_LIBRARY_CP_CONTAINER_ID.equals(path.segment(0));
  }
 
  /**
   * @param project
   * @return true if the JSF Faceted project is configured to use system supplied implementation
View Full Code Here

          }
        }
        else {
          IPath basePath = new Path(baseLocation);
          if (basePath.segmentCount() > 1) {
            return createJavaElementHyperlink(JavaCore.create(ResourcesPlugin.getWorkspace().getRoot().getProject(basePath.segment(0))), elementName, region);
          }
        }
      }

    }
View Full Code Here

      // https://bugs.eclipse.org/bugs/show_bug.cgi?id=79686
      IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
      IPath filePath = new Path(baseLocation);
      IProject project = null;
      if (filePath.segmentCount() > 0) {
        project = root.getProject(filePath.segment(0));
      }
//      IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(new Path(baseLocation));
//      for (int i = 0; project == null && i < files.length; i++) {
//        if (files[i].getType() != IResource.PROJECT) {
//          project = files[i].getProject();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.