Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IWorkspace$ProjectOrder


        if (!PROTOCOL.equals(protocol))
            throw new MalformedURLException("Unsupported protocol");

        IPath path = new Path(url.getPath());

        IWorkspace workspace = workspaceTracker.getService();
        if (workspace == null)
            throw new IOException("Workspace is not available");

        IPath workspaceLocation = workspace.getRoot().getLocation();
        if (workspaceLocation == null)
            throw new IOException("Cannot determine workspace location.");

        IPath location = workspaceLocation.append(path);
View Full Code Here


    if (!(part instanceof IEditorPart)) return new IFile[] {};
    IEditorInput input = ((IEditorPart) part).getEditorInput();
    if (!(input instanceof IPathEditorInput)) return new IFile[] {};
    IPathEditorInput pathInput = (IPathEditorInput) input;
//    System.out.println(pathInput.getPath());
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    return workspace.getRoot().findFilesForLocation(pathInput.getPath());
  }
View Full Code Here

    private final class Validator implements Observer {

        @Override
        public void update(Observable o, Object arg) {

            final IWorkspace workspace = JavaPlugin.getWorkspace();

            final String name = null;// fNameGroup.getName();

            // check whether the project name field is empty
            if ((name == null) || (name.length() == 0)) {
                setErrorMessage(null);
                setMessage("Enter a project name.");
                setPageComplete(false);
                return;
            }

            // check whether the project name is valid
            @SuppressWarnings("unused")
            final IStatus nameStatus = workspace.validateName(name, IResource.PROJECT);
            if (!nameStatus.isOK()) {
                setErrorMessage(nameStatus.getMessage());
                setPageComplete(false);
                return;
            }

            // check whether project already exists
            final IProject handle = workspace.getRoot().getProject(name);
            if (handle.exists()) {
                setErrorMessage("A project with this name already exists.");
                setPageComplete(false);
                return;
            }
View Full Code Here

        try {
            getContainer().run(false, true, new IRunnableWithProgress() {
                @Override
                public void run(IProgressMonitor monitor) throws InvocationTargetException,
                InterruptedException {
                    final IWorkspace workspace = ResourcesPlugin.getWorkspace();
                    boolean autobuild = workspace.isAutoBuilding();
                    try {
                        if (autobuild) {
                            // Disable auto build during project setup.
                            final IWorkspaceDescription wsDescription = workspace.getDescription();
                            autobuild = wsDescription.isAutoBuilding();
                            wsDescription.setAutoBuilding(false);
                            workspace.setDescription(wsDescription);
                        }
                        final List<AndroidProject> projects = page2.getSelectedProjects();
                        monitor.beginTask("Creating projects", projects.size());
                        for (final AndroidProject androidProject : projects) {
                            monitor.subTask(androidProject.getName());
                            androidProject.create(monitor);
                            monitor.worked(1);
                        }
                        monitor.done();
                        if (autobuild) {
                            // re-enable auto build
                            final IWorkspaceDescription wsDescription = workspace.getDescription();
                            wsDescription.setAutoBuilding(true);
                            workspace.setDescription(wsDescription);
                        }
                    } catch (final CoreException e) {
                        throw new InvocationTargetException(e);
                    }
                }
View Full Code Here

            SigilProjectWizardFirstPage.class, "/icons/logo64x64.gif"));
    }

    public boolean isInWorkspace()
    {
        IWorkspace workspace = ResourcesPlugin.getWorkspace();

        IPath defaultDefaultLocation = workspace.getRoot().getLocation();

        return defaultDefaultLocation.isPrefixOf(getLocationPath());
    }
View Full Code Here

     * @see org.eclipse.jface.wizard.Wizard#performFinish()
     */
    @Override
    public boolean performFinish()
    {
        IWorkspace workspace = ResourcesPlugin.getWorkspace();

        IWorkspaceRunnable op = new IWorkspaceRunnable()
        {
            public void run(IProgressMonitor monitor) throws CoreException
            {
                try
                {
                    finishPage(monitor);
                }
                catch (InterruptedException e)
                {
                    throw new OperationCanceledException(e.getMessage());
                }
            }
        };

        try
        {
            workspace.run(op, Job.getJobManager().createProgressGroup());
        }
        catch (CoreException e)
        {
            SigilCore.error("Failed to complete project wizard", e);
            return false;
View Full Code Here

    private boolean changeToNewProject()
    {
        boolean updated = false;
        if (!created)
        {
            IWorkspace workspace = ResourcesPlugin.getWorkspace();

            IWorkspaceRunnable op = new IWorkspaceRunnable()
            {
                public void run(IProgressMonitor monitor) throws CoreException
                {
                    try
                    {
                        updateProject(monitor);
                    }
                    catch (InterruptedException e)
                    {
                        throw new OperationCanceledException(e.getMessage());
                    }
                }
            };

            try
            {
                workspace.run(op, workspace.getRoot(), IWorkspace.AVOID_UPDATE,
                    Job.getJobManager().createProgressGroup());
                setErrorMessage(null);
                setPageComplete(true);
                created = true;
                updated = true;
View Full Code Here

            {
                doRemoveProject(monitor);
            }
        };

        IWorkspace workspace = ResourcesPlugin.getWorkspace();

        try
        {
            workspace.run(op, Job.getJobManager().createProgressGroup());
        }
        catch (CoreException e)
        {
            SigilCore.error("Failed to run workspace job", e);
        }
View Full Code Here

                            @Override
                            protected IStatus run(IProgressMonitor monitor)
                            {
                                if (update == updateCounter.get())
                                {
                                    IWorkspace workspace = ResourcesPlugin.getWorkspace();
                                    ResolveProjectsJob job = new ResolveProjectsJob(
                                        workspace);
                                    job.setSystem(true);
                                    job.schedule();
                                }
View Full Code Here

        // get a project descriptor
        IPath newPath = null;
        if (!mainPage.useDefaults())
            newPath = mainPage.getLocationPath();

        IWorkspace workspace = ResourcesPlugin.getWorkspace();
        final IProjectDescription description = workspace
                .newProjectDescription(newProjectHandle.getName());
        description.setLocation(newPath);
        addNatures(description);

        // create the new project operation
View Full Code Here

TOP

Related Classes of org.eclipse.core.resources.IWorkspace$ProjectOrder

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.