Examples of IResource


Examples of org.eclipse.core.resources.IResource

              wgaSyncInfo.getServer().connectToServer();
              session = wgaSyncInfo.getServer().getSession();
            }
           
            int change = SyncInfo.getChange(wgaSyncInfo.getKind());
            IResource resource = wgaSyncInfo.getLocal();
           
           
            String remotePath = wgaSyncInfo.getRemotePath();
            if (remotePath != null) {           
              if (change == SyncInfo.DELETION) {
                monitor.setTaskName("deleting '" + remotePath + "'.");
                wgaSyncInfo.getServer().getServices().deleteFSDesignResource(session, remotePath);
                committedResources.add(resource);
              } else if ((change == SyncInfo.ADDITION || change == SyncInfo.CHANGE)) {
                if (change == SyncInfo.ADDITION) {
                  monitor.setTaskName("adding '" + remotePath + "'.");
                } else {
                  monitor.setTaskName("updating '" + remotePath + "'.");
                }
                if (resource.getType() == IResource.FILE) {
                  DataSource content = new FileDataSource(((IFile)resource).getLocation().toFile());
                  wgaSyncInfo.getServer().getServices().updateFSDesignResource(session, remotePath, content, resource.getLocalTimeStamp());
                  committedResources.add(resource);
                } else if (resource.getType() == IResource.FOLDER) {
                  wgaSyncInfo.getServer().getServices().mkFSDesignDir(session, remotePath);
                  committedResources.add(resource);
                }             
              }
            }
View Full Code Here

Examples of org.eclipse.core.resources.IResource

    }

    IPackageFragment pack = getPackageFragment();
    if (pack != null) {
      ICompilationUnit cu = pack.getCompilationUnit(aspectName + ".java"); //$NON-NLS-1$
      IResource resource = cu.getResource();
      if (resource.exists()) {
        status.setWarning("Aspect already exits. Only the crosscut will be created.");
        // TODO Check if aspect is a subclass of
        // ch.ethz.prose.DefaultAspect.
      }
      fAspect = cu.findPrimaryType();
View Full Code Here

Examples of org.eclipse.core.resources.IResource

     */
    public boolean performFinish() {
        warnAboutTypeCommentDeprecation();
        boolean res = super.performFinish();
        if (res) {
            IResource resource = mainPage.getModifiedResource();
            if (resource != null) {
                selectAndReveal(resource);
                openResource((IFile) resource);
            }
        }
View Full Code Here

Examples of org.eclipse.core.resources.IResource

        return decompiledClass;
    }

    private String getArchivePath(IPackageFragmentRoot root) {
        String archivePath = null;
        IResource resource;

        try {
            if ((resource = root.getUnderlyingResource()) != null) {
                // jar in workspace
                archivePath = resource.getLocation().toOSString();
            } else {
                // external jar
                archivePath = root.getPath().toOSString();
            }
        } catch (JavaModelException e) {
View Full Code Here

Examples of org.eclipse.core.resources.IResource

            return dir;
        }
        // default bytecode location
        IPath path = project.getOutputLocation();

        IResource resource = javaElement.getUnderlyingResource();
        if (resource == null) {
            return dir;
        }
        // resolve multiple output locations here
        if (project.exists() && project.getProject().isOpen()) {
            IClasspathEntry entries[] = project.getRawClasspath();
            for (int i = 0; i < entries.length; i++) {
                IClasspathEntry classpathEntry = entries[i];
                if (classpathEntry.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
                    IPath outputPath = classpathEntry.getOutputLocation();
                    if (outputPath != null
                        && classpathEntry.getPath().isPrefixOf(
                            resource.getFullPath())) {
                        path = outputPath;
                        break;
                    }
                }
            }
        }

        if (path == null) {
            // check the default location if not already included
            IPath def = project.getOutputLocation();
            if (def != null && def.isPrefixOf(resource.getFullPath())){
                path = def;
            }
        }

        if(path == null){
View Full Code Here

Examples of org.eclipse.core.resources.IResource

     * @param classFile
     * @return new generated input stream from external class file, or null, if class file
     * for this element cannot be found
     */
    private static InputStream createStreamFromClass(IClassFile classFile) {
        IResource underlyingResource = null;
        try {
            // to tell the truth, I don't know why that different methods
            // are not working in a particular case. But it seems to be better
            // to use getResource() with non-java elements (not in model)
            // and getUnderlyingResource() with java elements.
            if (classFile.exists()) {
                underlyingResource = classFile.getUnderlyingResource();
            } else {
                // this is a class file that is not in java model
                underlyingResource = classFile.getResource();
            }
        } catch (JavaModelException e) {
            BytecodeOutlinePlugin.log(e, IStatus.ERROR);
            return null;
        }
        IPath rawLocation = underlyingResource.getRawLocation();
        // here we should resolve path variables,
        // probably existing at first place of "rawLocation" path
        IWorkspace workspace = ResourcesPlugin.getWorkspace();
        IPathVariableManager pathManager = workspace.getPathVariableManager();
        rawLocation = pathManager.resolvePath(rawLocation);
View Full Code Here

Examples of org.eclipse.core.resources.IResource

     * @return new generated input stream from external class file that is stored in jar
     * file, or null, if class file for this element cannot be found
     */
    private static InputStream createStreamFromJar(IClassFile classFile) {
        IPath path = null;
        IResource resource = classFile.getResource();
        // resource == null => this is a external archive
        if (resource != null) {
            path = resource.getRawLocation();
        } else {
            path = classFile.getPath();
        }
        if (path == null) {
            return null;
View Full Code Here

Examples of org.eclipse.core.resources.IResource

        }
        IPath path = new Path(rootPath);
        if (path.isAbsolute()) {
            IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace()
                .getRoot();
            IResource resource = workspaceRoot.findMember(path);
            IPackageFragmentRoot root1;
            if (resource == null) {
                // external jar
                root1 = project.getPackageFragmentRoot(rootPath);
            } else {
View Full Code Here

Examples of org.eclipse.core.resources.IResource

        File file = getRawLocationFile(simplePath);
        return file.toURL();
    }

    private static File getRawLocationFile(IPath simplePath) {
        IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(simplePath);
        File file = null;
        if (resource != null) {
            file = ResourcesPlugin.getWorkspace().getRoot().findMember(
                    simplePath).getRawLocation().toFile();
        } else {
View Full Code Here

Examples of org.eclipse.core.resources.IResource

  }
  /* (non-Javadoc)
   * @see org.aspectj.org.eclipse.jdt.core.IJavaElement#getSchedulingRule()
   */
  public ISchedulingRule getSchedulingRule() {
    IResource resource = getResource();
    if (resource == null) {
      class NoResourceSchedulingRule implements ISchedulingRule {
        public IPath path;
        public NoResourceSchedulingRule(IPath path) {
          this.path = path;
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.