Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IContainer


        NodeTypeRegistry ntManager = (repository==null) ? null : repository.getNodeTypeRegistry();
       
        IResource[] resourceData = (IResource[]) clipboard
                .getContents(ResourceTransfer.getInstance());
        if (resourceData!=null) {
            IContainer container = getDropContainer();
            return container!=null;
        }
       
        String[] fileData = (String[]) clipboard.getContents(FileTransfer.getInstance());
        if (fileData!=null) {
            IContainer container = getDropContainer();
            return container!=null;
        }
       
        String text = (String) clipboard.getContents(TextTransfer.getInstance());
        if (text!=null) {
View Full Code Here


    if (inspector == null) inspector = new ModelInspector(getJavaProject());
    return inspector;
  }

  protected IProject getProject() {
    IContainer container = file.getParent();
    while (container != null) {
      if (container instanceof IProject) {
        return (IProject)container;
      }
      container = container.getParent();
    }
    // Should not happen
    return null;
  }
View Full Code Here

      Object obj = ssel.getFirstElement();
      if (obj instanceof IJavaElement) {
        obj = ((IJavaElement)obj).getResource();
      }
      if (obj instanceof IResource) {
        IContainer container;
        if (obj instanceof IContainer) {
          container = (IContainer) obj;
        } else {
          container = ((IResource) obj).getParent();
        }
        containerText.setText(container.getFullPath().toString());
        while (container != null) {
          if (container instanceof IProject) {
            project = (IProject)container;
          }
          container = container.getParent();
        }
      }
    }
    name.setText(defaultName());
  }
View Full Code Here

      e.printStackTrace();
    }
  }

  public static void prepareFolder(IFolder folder) {
    IContainer parent = folder.getParent();
    try {
      parent.refreshLocal(IResource.DEPTH_INFINITE, null);
    } catch (CoreException e1) {
      e1.printStackTrace();
    }

    if (parent instanceof IFolder) {
View Full Code Here

    return input.getFile().getProjectRelativePath();
  }
 
  public IProject getProject() {
    IFile curfile = ((IFileEditorInput)getEditorInput()).getFile();
    IContainer container = curfile.getParent();
    while (container != null) {
      if (container instanceof IProject) {
        return (IProject)container;
      }
      container = container.getParent();
    }
    // Should not happen
    return null;
  }
View Full Code Here

    Object obj = selection.getFirstElement();
    if (obj instanceof IJavaElement) {
      obj = ((IJavaElement)obj).getResource();
    }
    if (obj instanceof IResource) {
      IContainer container;
      if (obj instanceof IContainer) {
        container = (IContainer) obj;
      } else {
        container = ((IResource) obj).getParent();
      }
      while (container != null) {
        if (container instanceof IProject) {
          return (IProject)container;
        }
        container = container.getParent();
      }
    }
    return null;
  }
View Full Code Here

    final String resourceName = resource.getName();
    final String decodedName = decode(resourceName);
    if (decodedName==null) {
      return false;
    }
    final IContainer container = folder.getParent();
    if (container==null || !container.exists()) {
      return false;
    }
    if (resourceName.endsWith(".dir")) {
      final IResource peerNode = container.findMember(decodedName);
      if (peerNode==null || !peerNode.exists()) {
        return false;
      }
    }
    // then it is likely the pattern that corresponds to the case
View Full Code Here

    final ScriptRunner scriptRunner = context.mock(ScriptRunner.class);
    final ScriptStack scriptStack = context.mock(ScriptStack.class);
    final FileContentsReader fileReader = context.mock(FileContentsReader.class);
   
    final IFile location = context.mock(IFile.class, "location");
    final IContainer container = context.mock(IContainer.class);
   
    final String otherFilename = "other/file.rs";
    final IFile otherFile = context.mock(IFile.class, "otherfile");
    final String otherContents = "some.script();\n";
    final InputStream inputStream = context.mock(InputStream.class);
View Full Code Here

    this.scriptStack = scriptStack;
    this.fileReader = fileReader;
    }
   
    public void file(String filename) throws IOException, CoreException {
        IContainer container = location.getParent();
        IFile file = container.getFile(new Path(filename.trim()));
        if (!file.exists()) {
            throw new IOException("Failed to find file '" + file.getLocation().toString()+"'");
        }

        String contents = fileReader.getContents(file.getContents());
View Full Code Here

  public IProject getProject() {
    IFile curfile = ((IFileEditorInput)textEditor.getEditorInput()).getFile();
   
    // bran: shall it be curfile.getProject()?
   
    IContainer container = curfile.getParent();
    while (container != null) {
      if (container instanceof IProject) {
        return (IProject)container;
      }
      container = container.getParent();
    }
    // Should not happen
    return null;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.resources.IContainer

Copyright © 2018 www.massapicom. 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.