Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.Path.lastSegment()


      CharOperation.replace(pkgName, '/', '.');
      return root.getPackageFragment(new String(pkgName));
    } else {
      Path path = new Path(new String(fileName, 0, pkgEnd));
      IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
      IContainer folder = path.segmentCount() == 1 ? workspaceRoot.getProject(path.lastSegment()) : (IContainer) workspaceRoot.getFolder(path);
      IJavaElement element = JavaCore.create(folder);
      if (element == null) return null;
      switch (element.getElementType()) {
        case IJavaElement.PACKAGE_FRAGMENT:
          return (IPackageFragment) element;
View Full Code Here


      String resName = resNames[i];
      // consider that a .java file is not a non-java resource (see bug 12246 Packages view shows .class and .java files when JAR has source)
      if (!Util.isJavaLikeFileName(resName)) {
        IPath filePath = new Path(resName);
        IPath childPath = filePath.removeFirstSegments(this.names.length);
        JarEntryFile file = new JarEntryFile(filePath.lastSegment());
        jarEntries.put(childPath, file);
        if (childPath.segmentCount() == 1) {
          file.setParent(pkg);
          topJarEntries.add(file);
        } else {
View Full Code Here

                }

                String selected = dialog.open();
                if (selected != null) {
                    IPath path = new Path(selected);
                    if (projectName != null && !projectName.equals(path.lastSegment()))
                        selected = path.append(projectName).toString();
                    txtLocation.setText(selected);
                }
            }
        });
View Full Code Here

              // directory
              if (childUri == null) {
                childUri = "WEB-INF/lib/" + child.getName(); //$NON-NLS-1$
              }
              IPath jarPath = new Path(childUri);
              File jarFile = new File(tempFile, jarPath.lastSegment());
              jarPath = jarPath.removeLastSegments(1);

              IModuleResource[] mr = server.getResources(new IModule[] { child });
              IStatus[] status = helper.publishToPath(mr, new Path(jarFile.getAbsolutePath()), monitor);
              merge(result, status);
View Full Code Here

              // other modules are assembled into a jar
              if (childUri == null) {
                childUri = "WEB-INF/lib/" + child.getName() + ".jar"; //$NON-NLS-1$ //$NON-NLS-2$
              }
              IPath jarPath = new Path(childUri);
              File jarFile = new File(tempFile, jarPath.lastSegment());
              jarPath = jarPath.removeLastSegments(1);

              IModuleResource[] mr = server.getResources(new IModule[] { child });
              IStatus[] status = helper.publishZip(mr, new Path(jarFile.getAbsolutePath()), monitor);
              merge(result, status);
View Full Code Here

    public IVResource[] findChildren(String childName) {
        // TODO Auto-generated method stub
        Path path = new Path(childName);
        IOFileFilter filter;
        if (path.segment(0).equals("*")) {
            filter = new NameFileFilter(path.lastSegment());
        } else {
            String lastSegment = path.lastSegment();
            if (lastSegment.startsWith("*")) {
                filter = new SuffixFileFilter(lastSegment.substring(1));
            } else {
View Full Code Here

        Path path = new Path(childName);
        IOFileFilter filter;
        if (path.segment(0).equals("*")) {
            filter = new NameFileFilter(path.lastSegment());
        } else {
            String lastSegment = path.lastSegment();
            if (lastSegment.startsWith("*")) {
                filter = new SuffixFileFilter(lastSegment.substring(1));
            } else {
                filter = null;
            }
View Full Code Here

  public Collection findFiles(IStorage f1, String pathStr, boolean ignoreCase) {
    IOFileFilter filter;
    IPath path = new Path(pathStr);
    if (path.segment(0).equals("*")) {
      IOCase ioCase = ignoreCase ? IOCase.INSENSITIVE    : IOCase.SENSITIVE;
      filter = new NameFileFilter(path.lastSegment(), ioCase);
    } else {
      String lastSegment = path.lastSegment();
      if (lastSegment.startsWith("*")) {
        filter = new SuffixFileFilter(lastSegment.substring(1));
      } else {
View Full Code Here

    IPath path = new Path(pathStr);
    if (path.segment(0).equals("*")) {
      IOCase ioCase = ignoreCase ? IOCase.INSENSITIVE    : IOCase.SENSITIVE;
      filter = new NameFileFilter(path.lastSegment(), ioCase);
    } else {
      String lastSegment = path.lastSegment();
      if (lastSegment.startsWith("*")) {
        filter = new SuffixFileFilter(lastSegment.substring(1));
      } else {
        filter = null;
      }
View Full Code Here

            return module;
        }
        final String encoding = getEncodingForInput(editorInput);
        final IPath p = new Path(path);
        return ErlangEngine.getInstance().getModel()
                .getModuleFromFile(null, p.lastSegment(), path, encoding, path);

    }

    private static String getPathForInput(final IEditorInput editorInput) {
        if (editorInput instanceof IStorageEditorInput) {
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.