Examples of IWorkspaceRoot


Examples of org.eclipse.core.resources.IWorkspaceRoot

            IFolder libFolder = project.getProject().getFolder("lib");
            libFolder.create(false, true, progress.newChild(1));

            // Copy JARs into project lib folder.
            IWorkspaceRoot wsroot = ResourcesPlugin.getWorkspace().getRoot();
            for (IPath path : paths) {
                File file = FileUtils.toFile(wsroot, path);
                if (file != null && file.isFile()) {
                    IFile copy = libFolder.getFile(file.getName());
                    try {
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

     * @return list of Perl project names in the current workspace
     */
    private String[] getPerlProjects()
    {
        List projectList = new ArrayList();
        IWorkspaceRoot workspaceRoot = PerlDebugPlugin.getWorkspace().getRoot();
        IProject[] projects = workspaceRoot.getProjects();
        for (int i = 0; i < projects.length; i++)
        {
            IProject project = projects[i];
            try
            {
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

   *
   * @return Stiring[] List of Perl projects
   */
  private String[] getPerlProjects() {
    List projectList = new ArrayList();
    IWorkspaceRoot workspaceRoot = PerlDebugPlugin.getWorkspace().getRoot();
    IProject[] projects = workspaceRoot.getProjects();
    for (int i = 0; i < projects.length; i++) {
      IProject project = projects[i];
      try {
        if (project.isAccessible() && project.hasNature(PERL_NATURE_ID)) {
          //System.out.println("Perl Project: " + project.getName());
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

   * Different type of resource is returned based on the length of the path
   * and whether or not it ends with a path separator.
   */
  public static IResource getResource(IPath path) {
    try {
      IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
      if (path.segmentCount() == 0) {
        return root;
      }
      IProject project = root.getProject(path.segment(0));
      if (path.segmentCount() == 1) {
        return project;
      }
      if (path.hasTrailingSeparator()) {
        return root.getFolder(path);
      }
      else {
        return root.getFile(path);
      }
    }
    catch (Exception e) {
      e.printStackTrace();
      return null;
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

        if (params != null && params.length > 3)
        {
            targetProject = params[0];
        }

        IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
        IProject project = workspaceRoot.getProject(targetProject);

        try
        {
            ISigilProjectModel sigil = SigilCore.create(project);
            new ResolveProjectDependenciesAction(sigil, false).run();
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

            {
                try
                {
                    Bundle b = Platform.getBundle(sourceBundle);

                    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
                    IProject project = workspaceRoot.getProject(targetProject);
                    IPath path = new Path(targetFolder).append(sourcePath.substring(sourcePath.lastIndexOf('/')));
                    IFile file = project.getFile(path);

                    if (!file.exists())
                    {
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

    private IProject project;

    @Override
    protected void before() throws Throwable {

        IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
        project = root.getProject("test-project-" + COUNTER.incrementAndGet());
        project.create(new NullProgressMonitor());
        project.open(new NullProgressMonitor());
    }
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

        }
    }

    private IProject findProject(IPath path) throws CoreException
    {
        IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
        for (IProject p : root.getProjects())
        {
            IPath projectPath = p.getFullPath();
            if (projectPath.equals(path))
            {
                return p;
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

    IJavaProject javaProject = JavaCore.create(project);
    return javaProject;
  }

  private static IProject createProject() throws CoreException {
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    IProject project = workspaceRoot.getProject("test-java-project");
    if (project.exists()) {
      project.delete(true, true, null);
    }
    project.create(null);
    project.open(null);
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

public class JavaProjectHelper {

  private final Logger logger = new Logger();

  public IJavaProject[] getJavaProjects() {
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    IJavaModel javaModel = JavaCore.create(workspaceRoot);
    IJavaProject[] javaProjects = null;
    try {
      javaProjects = javaModel.getJavaProjects();
    } catch (JavaModelException e) {
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.