Examples of IProject


Examples of org.eclipse.core.resources.IProject

      if (delta != null) {
        try {
          delta.accept(new IResourceDeltaVisitor() {
            public boolean visit(IResourceDelta delta) throws CoreException {
              if (delta.getResource() instanceof IProject) {
                IProject project = (IProject) delta.getResource();
                if (delta.getKind() == IResourceDelta.ADDED || delta.getKind() == IResourceDelta.CHANGED) {
                  _projectsAddedOrChanged.add(project);
                }
              }
              return true;
View Full Code Here

Examples of org.eclipse.core.resources.IProject

  }

  public static Map<String, WGARuntime> getAllRuntimes() {

    Map<String, WGARuntime> allWGARuntimes = new HashMap<String, WGARuntime>();
    IProject tmp[] = null;
    tmp = ResourcesPlugin.getWorkspace().getRoot().getProjects();
    for (int i = 0; i < tmp.length; i++) {
      try {
        if (tmp[i].isAccessible() && tmp[i].hasNature(NATURE_WGA_RUNTIME)) {
          allWGARuntimes.put(tmp[i].getName(), (WGARuntime) tmp[i].getNature(NATURE_WGA_RUNTIME));
View Full Code Here

Examples of org.eclipse.core.resources.IProject

    }
 
 
  public static WGARuntime getRuntime(String name){
   
    IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
    try {
      if(project.isAccessible() && project.hasNature(NATURE_WGA_RUNTIME)){
        return (WGARuntime) project.getNature(NATURE_WGA_RUNTIME);
      }else {
        return null;
      }
    } catch (CoreException e) {
      return null;
View Full Code Here

Examples of org.eclipse.core.resources.IProject

   * @return
   */
  public static Map<String, WGADesign> getAllDesigns() {

    Map<String, WGADesign> allWGADesigns = new HashMap<String, WGADesign>();
    IProject tmp[] = null;
    tmp = ResourcesPlugin.getWorkspace().getRoot().getProjects();
    for (int i = 0; i < tmp.length; i++) {
      try {
        if (tmp[i].hasNature(NATURE_WGA_DESIGN)) {
          allWGADesigns.put(tmp[i].getName(), (WGADesign) tmp[i].getNature(NATURE_WGA_DESIGN));
View Full Code Here

Examples of org.eclipse.core.resources.IProject

    List<IJavaProject> javaProjectList = new ArrayList<IJavaProject>();
    StringBuffer traceBuffer = new StringBuffer();   
    traceBuffer.append("Projects in source path :\n");
    IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
    for (int i=0; i < projects.length; i++) {
      IProject project = projects[i];
      if ((project.isOpen()) && project.hasNature(JavaCore.NATURE_ID)) {
        javaProjectList.add((IJavaProject)project.getNature(JavaCore.NATURE_ID));
      }
    }

    List<ISourceContainer> sourceContainers = new ArrayList<ISourceContainer>();

    if (!javaProjectList.isEmpty()) {
      IJavaProject[] javaProjects = javaProjectList.toArray(new IJavaProject[0]);
        //    sourceLocator = new JavaSourceLocator(javaProjects, true);

     
      // Eclipse stops looking for source if it finds a jar containing the source code
      // despite this jar as no attached source (the user will have to use 'Attach source' button).
      // So we have to enforce that sources in project are searched before jar files,
      // To do so we add source containers in this orders :
      // - First project source containers.
      // - second packageFragmentRoot container (jar files in projects build path will be added to source path)
      // - third DefaultSourceContainer (jar files added to classpath will be added to source path)

 
      // First add all projects source containers
      for (int i = 0; i < javaProjects.length; i++) {
        IJavaProject project = javaProjects[i];
        traceBuffer.append("  -> Add JavaProjectSourceContainer for " + project.getProject().getName() + "\n");
        sourceContainers.add(new JavaProjectSourceContainer(project));
      }

      // Adding packageFragmentRoot source containers, so classes in jar files associated to a project will be seen
      Set<IPath> external = new HashSet<IPath>();

      for (int i = 0; i < javaProjects.length; i++) {
        IJavaProject project = javaProjects[i];
        traceBuffer.append("  -> Compute SourceContainers for " + project.getProject().getName() + " :\n");

        IPackageFragmentRoot[] roots = project.getPackageFragmentRoots();
        for (int ri = 0; ri < roots.length; ri++) {
          IPackageFragmentRoot root = roots[ri];         
          if (root.isExternal()) {
            IPath location = root.getPath();
            if (external.contains(location)) {
View Full Code Here

Examples of org.eclipse.core.resources.IProject

  public void resourceChanged(IResourceChangeEvent event) {
    if (event.getType() == IResourceChangeEvent.PRE_BUILD) {
      IResourceDelta[] projectDeltas = event.getDelta().getAffectedChildren();
      for (IResourceDelta projectDelta : projectDeltas) {
        IProject project = (IProject) projectDelta.getResource();
        if (isWGAPublisherProject(project)) {
          try {
            WorkbenchUtils.addBuilder(project, WGADesignerPlugin.BUILDER_WGA_DEPLOYMENTS);
          } catch (Exception e) {
            WGADesignerPlugin.getDefault().getLog().log(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to add wga deployment builder to project '" + project.getName() + "'.", e));
          }       
        }
      }
    } else if (event.getType() == IResourceChangeEvent.PRE_DELETE) {
      IProject project = (IProject) event.getResource();
      if (isWGAPublisherProject(project)) {
        final WGADeployment deployment = getDeployment(project.getName());
        if (deployment != null) {
          Job job = new Job("Removing WGA Deployment '" + deployment.getName() + "'.") {

            @Override
            protected IStatus run(IProgressMonitor monitor) {
View Full Code Here

Examples of org.eclipse.core.resources.IProject

   * checks if this deployment represents a lokal (cvs checkedout( WGAPublisher project
   * @param deployment
   * @return
   */
  public boolean isProjectDeployment(WGADeployment deployment) {
    IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(deployment.getName());
    if (project != null && isWGAPublisherProject(project)) {
      return true;
    } else {
      return false;
    }
View Full Code Here

Examples of org.eclipse.core.resources.IProject

   
      _selectedProject = selection;
      _designResources = WGADesignStructureHelper.retrieveDesignResources(new ResourceFilter() {

        public boolean accept(IResource resource) {
          IProject project = resource.getProject();
          if (project != null) {
            if (!project.isAccessible()) {
              return false;
            } else if (project.equals(_selectedProject)) {
              return false;
            }else if(!(resource instanceof IContainer)){
              return false;
            }else if(!WGADesignStructureHelper.isDesignFolder((IContainer)resource)){
              return false;
View Full Code Here

Examples of org.eclipse.core.resources.IProject

        String name = fProjText.getText().trim();
        if (name.length() > 0) {
            IWorkspace workspace = ResourcesPlugin.getWorkspace();
            IStatus status = workspace.validateName(name, IResource.PROJECT);
            if (status.isOK()) {
                IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
                if (!project.exists()) {
                    setErrorMessage(MessageFormat.format("Project {0} does not exist", new String[] { name}));
                    return false;
                }
                if (!project.isOpen()) {
                    setErrorMessage(MessageFormat.format("Project {0} is closed", new String[] { name}));
                    return false;
                }
            } else {
                setErrorMessage(MessageFormat.format("Illegal project name: {0}", new String[] { status.getMessage()}));
View Full Code Here

Examples of org.eclipse.core.resources.IProject

        }
        return cl;
    }

    private static void getClassURLs(IJavaProject javaProject, List urls) {
        IProject project = javaProject.getProject();
        IWorkspaceRoot workspaceRoot = project.getWorkspace().getRoot();

        IClasspathEntry[] paths = null;
        IPath defaultOutputLocation = null;
        try {
            paths = javaProject.getResolvedClasspath(true);
            defaultOutputLocation = javaProject.getOutputLocation();
        } catch (JavaModelException e) {
            // don't show message to user neither log it
            // BytecodeOutlinePlugin.log(e, IStatus.ERROR);
        }
        if (paths != null) {
            IPath projectPath = javaProject.getProject().getLocation();
            for (int i = 0; i < paths.length; ++i) {
                IClasspathEntry cpEntry = paths[i];
                IPath p = null;
                if (cpEntry.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
                    // filter out source container - there are unused for class
                    // search - add bytecode output location instead
                    p = cpEntry.getOutputLocation();
                    if (p == null) {
                        // default output used:
                        p = defaultOutputLocation;
                    }
                } else if (cpEntry.getEntryKind() == IClasspathEntry.CPE_PROJECT) {
                    String projName = cpEntry.getPath().toPortableString()
                        .substring(1);
                    IProject proj = workspaceRoot.getProject(projName);
                    IJavaProject projj = JavaCore.create(proj);
                    getClassURLs(projj, urls);
                    continue;
                } else {
                    p = cpEntry.getPath();
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.