Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IWorkspaceRoot.findMember()


     */
    protected IContainer getSpecifiedContainer() {
        final IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
        final IPath path = getContainerFullPath();
        if (root.exists(path)) {
            final IResource resource = root.findMember(path);
            if (resource.getType() == IResource.FILE) {
                return null;
            }
            return (IContainer) resource;
        }
View Full Code Here


        // ErlLogger.debug("Generating a file with skeleton: "+skeleton);

        // create a sample file
        monitor.beginTask("Creating " + fileName, 2);
        final IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
        final IResource resource = root.findMember(new Path(containerName));
        if (!resource.exists() || !(resource instanceof IContainer)) {
            throwCoreException("Container \"" + containerName + "\" does not exist.");
        }
        final IContainer container = (IContainer) resource;
        IPath path = new Path(fileName);
View Full Code Here

        {
          IWorkspace _workspace = ResourcesPlugin.getWorkspace();
          IWorkspaceRoot _root = _workspace.getRoot();
          IPath _baseDir = this.properties.getBaseDir();
          IPath _append = _baseDir.append(path);
          IResource _findMember = _root.findMember(_append);
          final IErlElement element = ErlModelCore.create(_findMember);
          if ((element instanceof IErlFolder)) {
            StringConcatenation _builder = new StringConcatenation();
            _builder.append("ADD FOLDER ");
            _builder.append(((IErlFolder)element), "");
View Full Code Here

        final String orgName = page.getOrganisationName();
        final String moduleName = page.getModuleName();
        final String status = page.getStatus();

        IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
        IResource resource = root.findMember(new Path(containerName));
        if (!resource.exists() || !(resource instanceof IContainer)) {
            MessageDialog.openError(getShell(), "Error", "Container \"" + containerName
                    + "\" does not exist.");
        }
        IContainer container = (IContainer) resource;
View Full Code Here

        final String orgName = page.getOrganisationName();
        final String moduleName = page.getModuleName();
        final String status = page.getStatus();

        IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
        IResource resource = root.findMember(new Path(containerName));
        if (!resource.exists() || !(resource instanceof IContainer)) {
            MessageDialog.openError(getShell(), "Error", "Container \"" + containerName
                    + "\" does not exist.");
        }
        IContainer container = (IContainer) resource;
View Full Code Here

        return asJavaElement(asPath(resource));
   

  public static IResource asResource(String path) {
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    return root.findMember(new Path(path));
  }

  public static IResource fromJavaElement(IJavaElement element) {
    return element.getResource();
  }
View Full Code Here

  public boolean performFinish() {
    String containerName = page.getContainerPath();
    String fileName = page.getFilename();
   
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    IResource resource = root.findMember(new Path(containerName));
    IContainer container = (IContainer) resource;
    final IFile file = container.getFile(new Path(fileName));
    try {
      InputStream stream = openContentStream();
      if (file.exists()) {
View Full Code Here

    private HashMap<String, List<String>> findPackageDeclarations() {
        HashMap<String, List<String>> forPackage = new HashMap<String, List<String>>();       
        for(Point each: mapPerProject.getConfiguration().points()) {
            String fileName = each.getDocument();
            IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
            IResource resource = root.findMember(new Path(fileName));
            IJavaElement create = JavaCore.create(resource);
           
            if (!(create instanceof ICompilationUnit)) continue;
            ICompilationUnit unit = (ICompilationUnit) create;
            try {
View Full Code Here

  void doFinish(String containerName, String fileName, IProgressMonitor monitor)
          throws CoreException {
    // create a sample file
    monitor.beginTask("Creating " + fileName, 2);
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    IResource resource = root.findMember(new Path(containerName));
    if (!resource.exists() || !(resource instanceof IContainer)) {
      throwCoreException("Container \"" + containerName + "\" does not exist.");
    }
    IContainer container = (IContainer) resource;
    final IFile file = container.getFile(new Path(fileName));
View Full Code Here

              projectsInCycle = new IJavaProject[cycleParticipants.size()];
              Iterator it = cycleParticipants.iterator();
              int k = 0;
              while (it.hasNext()) {
                //projectsInCycle[i++] = (IPath) it.next();
                IResource member = workspaceRoot.findMember((IPath) it.next());
                if (member != null && member.getType() == IResource.PROJECT){
                  projectsInCycle[k] = JavaCore.create((IProject)member);
                  if (projectsInCycle[k] != null) {
                    if (k != 0) cycleString += ", "; //$NON-NLS-1$
                    cycleString += projectsInCycle[k++].getElementName();
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.