Examples of IProject


Examples of org.eclipse.core.resources.IProject

      StructuredSelection treeSel = (StructuredSelection) _selection;
      Object selectedElement = treeSel.getFirstElement();

      if (selectedElement instanceof IResource) {
        IResource resource = (IResource) selectedElement;
        IProject selectedRuntimeProject = resource.getProject();
        try {
          _selectedRuntime = (WGARuntime) selectedRuntimeProject.getNature(WGADesignerPlugin.NATURE_WGA_RUNTIME);
        } catch (CoreException e) {
          WGADesignerPlugin.getDefault().logError("This project does not exist. This project is not open. The project nature extension could not be found.", e);
        }
      }     
    }
View Full Code Here

Examples of org.eclipse.core.resources.IProject

    if (getRuntime() != null && getRuntime().hasPlugin(pluginName)) {
      applyStatus("A plugin with name '" + pluginName + "' already exists in runtime '" + getRuntime().getName() + "'.", IStatus.ERROR);
      setPageComplete(false);
      return;
    }
    IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(pluginName);
    if (project != null && project.exists()) {
      applyStatus("A project with name '" + pluginName + "' already exists in the workspace.", IStatus.ERROR);
      setPageComplete(false);
      return;
    }
   
View Full Code Here

Examples of org.eclipse.core.resources.IProject

  public static WGADesign fromSelection(ISelection selection) {
    if (selection instanceof IStructuredSelection) {
      IStructuredSelection structSelection = (IStructuredSelection) selection;
      Object selectedElement = structSelection.getFirstElement();
      if (selectedElement instanceof IProject) {
        IProject project = (IProject) selectedElement;
        try {
          return (WGADesign) project.getNature(WGADesignerPlugin.NATURE_WGA_DESIGN);
        } catch (Exception e) {
        }
      }
    }
    return null;
View Full Code Here

Examples of org.eclipse.core.resources.IProject

  public static WGARuntime fromSelection(ISelection selection) {
    if (selection instanceof IStructuredSelection) {
      IStructuredSelection structSelection = (IStructuredSelection) selection;
      Object selectedElement = structSelection.getFirstElement();
      IProject project = null;
      if (selectedElement instanceof IProject) {
        project = (IProject) selectedElement;
      } else if (selectedElement instanceof IResource) {
        project = ((IResource) selectedElement).getProject();
      }

      try {
        if (project != null && project.hasNature(WGADesignerPlugin.NATURE_WGA_RUNTIME)) {
          return (WGARuntime) project.getNature(WGADesignerPlugin.NATURE_WGA_RUNTIME);
        }
      } catch (Exception e) {
      }

    }
View Full Code Here

Examples of org.eclipse.core.resources.IProject

  }

  @SuppressWarnings("unchecked")
  @Override
  protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException {   
    IProject project = getProject();
    if (project != null && project.isAccessible()) {
      IMarker[] markers = project.findMarkers(ResourceIDs.MARKER_TML_REFERENCES, false, IResource.DEPTH_INFINITE);
      for (IMarker marker : markers) {
        if (marker.getResource() != null && marker.getResource() instanceof IFile) {
          TMLFileValidator.validateTMLFile((IFile)marker.getResource());
        }
      }
View Full Code Here

Examples of org.eclipse.core.resources.IProject

      throw new IllegalArgumentException("Wizard with id '" + id + "' not found.");
    }
  } 
 
   public static void addBuilder(IProject project, String id) throws CoreException {
       final IProject fProject = project;
       final String fId = id;
       IWorkspaceRunnable operation = new IWorkspaceRunnable() {
          public void run(IProgressMonitor monitor) throws CoreException {                       
            if (fProject.isAccessible()) {
              ResourceAttributes attribs = fProject.getResourceAttributes();
              if (attribs != null && attribs.isReadOnly()) {
                attribs.setReadOnly(false);
                fProject.setResourceAttributes(attribs);
              }
             
              IProjectDescription desc = fProject.getDescription();
              ICommand[] commands = desc.getBuildSpec();           
              for (int i = 0; i < commands.length; ++i) {
                 if (commands[i].getBuilderName().equals(fId))
                    return;
              }
              //add builder to project
              ICommand command = desc.newCommand();
              command.setBuilderName(fId);
              ICommand[] nc = new ICommand[commands.length + 1];
              // Add it after all other builders.
              System.arraycopy(commands, 0, nc, 0, commands.length);
              nc[commands.length] = command;
              desc.setBuildSpec(nc);
              fProject.setDescription(desc, null);
             
            }
          }
       };
       ResourcesPlugin.getWorkspace().run(operation, null);
View Full Code Here

Examples of org.eclipse.core.resources.IProject

       };
       ResourcesPlugin.getWorkspace().run(operation, null);
     }
  
   public static void removeBuilder(IProject project, String id) throws CoreException {
       final IProject fProject = project;
       final String fId = id;
       IWorkspaceRunnable operation = new IWorkspaceRunnable() {
          public void run(IProgressMonitor monitor) throws CoreException {                       
            if (fProject.isAccessible()) {
              ResourceAttributes attribs = fProject.getResourceAttributes();
              if (attribs != null && attribs.isReadOnly()) {
                attribs.setReadOnly(false);
                fProject.setResourceAttributes(attribs);
              }
              IProjectDescription desc = fProject.getDescription();
              ICommand[] commands = desc.getBuildSpec();
              List<ICommand> newCommands = new ArrayList<ICommand>();
              for (int i = 0; i < commands.length; ++i) {                 
                 if (!commands[i].getBuilderName().equals(fId)) {
                   newCommands.add(commands[i]);
                 }
              }
              desc.setBuildSpec(newCommands.toArray(new ICommand[0]));
              fProject.setDescription(desc, null);             
            }
          }
       };
       ResourcesPlugin.getWorkspace().run(operation, null);
     }
View Full Code Here

Examples of org.eclipse.core.resources.IProject

 
 
  @SuppressWarnings("unchecked")
  @Override
  protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException {   
    IProject project = getProject();
    if (project != null && project.isAccessible()) {
      IMarker[] tmlmarkers = project.findMarkers(ResourceIDs.MARKER_TML_REFERENCES, false, IResource.DEPTH_INFINITE);
      for (IMarker marker : tmlmarkers) {
        if (marker.getResource() != null && marker.getResource() instanceof IFile) {
          TMLFileValidator.validateTMLFile((IFile)marker.getResource());
        }
      } 
      project.accept(new IResourceVisitor() {
       
        public boolean visit(IResource resource) throws CoreException {         
          if(resource instanceof IContainer){   
            WGADesignResourceValidator.validate((IContainer)resource);
            return true;
View Full Code Here

Examples of org.eclipse.core.resources.IProject

    }

  }

  public Set<String> getMediumKeys(IFile file) {
    IProject project = file.getProject();
    Set<String> resources = new HashSet<String>();
    IContainer design = new WGADesignStructureHelper(file).getDesignRoot();
    String expression = "SELECT distinct Medium FROM references WHERE Project = ? AND Path Like ?";
   
    PreparedStatement st = null;
    ResultSet rs = null;
    try {
      st = _conn.prepareStatement(expression);
      st.setString(1, project.getName());
      st.setString(2, "designs/" + design.getName() + "/tml/%");

      rs = st.executeQuery();

      while (rs.next()) {
        if (!rs.getString("Medium").equals("") && !rs.getString("Medium").startsWith(".")) {
          resources.add(rs.getString("Medium"));
        }

      }
    } catch (SQLException e) {
      Plugin.getDefault().logError("Unable to lookup medium keys for project '" + project.getName() + "' and designRoot '" + design.getLocation().toString() + "'.", e);
    } finally {
      cleanupSQLResources(st, rs);
    }
    return resources;
  }
View Full Code Here

Examples of org.eclipse.core.resources.IProject

    return resources;
  }

  public Set<String> getScriptPaths(IContainer designRoot, String scriptType) {
    Set<String> resources = new HashSet<String>();
    IProject project = designRoot.getProject();
    PreparedStatement st = null;
    ResultSet rs = null;
    try {     
      String expression = "SELECT Path, File FROM references WHERE Project = ? AND FileType = ? AND Path Like ?";
      st = _conn.prepareStatement(expression);
      st.setString(1, project.getName());
      st.setString(2, scriptType);
     
     
      designRoot.getProjectRelativePath().append("scripts").append(scriptType);
     
      st.setString(3, designRoot.getProjectRelativePath().append("scripts").append(scriptType).toString() + "%");
 
      rs = st.executeQuery();
 
      while (rs.next()) {
        String resource = rs.getString("Path");
        if (!resource.endsWith("/")) {
          resource += "/";
        }
        resource += rs.getString("File");
        resources.add(resource);
      }
    } catch (SQLException e) {
      Plugin.getDefault().logError("Unable to lookup script paths for project '" + project.getName() + "' and designRoot '" + designRoot.getLocation().toString() + "'.", e);
    } finally {
      cleanupSQLResources(st, rs);
    }
    return resources;
  }
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.