Examples of IWorkspaceRunnable


Examples of org.eclipse.core.resources.IWorkspaceRunnable

            result.add(new IMarkerResolution() {
                public void run(IMarker marker) {
                    final IFile file = (IFile) marker.getResource();
                    final IWorkspace workspace = file.getWorkspace();
                    try {
                        workspace.run(new IWorkspaceRunnable() {
                            public void run(IProgressMonitor monitor) throws CoreException {
                                String input = "version " + suggestedVersion;
                                ByteArrayInputStream stream = new ByteArrayInputStream(input.getBytes());
                                file.setContents(stream, false, true, monitor);
                            }
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRunnable

        return result.values();
    }

    private static void generatePackageInfos(final Collection< ? extends FileVersionTuple> pkgs) throws CoreException {
        final IWorkspaceRunnable wsOperation = new IWorkspaceRunnable() {
            public void run(IProgressMonitor monitor) throws CoreException {
                SubMonitor progress = SubMonitor.convert(monitor, pkgs.size());
                MultiStatus status = new MultiStatus(Plugin.PLUGIN_ID, 0, "Errors occurred while creating packageinfo files.", null);
                for (FileVersionTuple pkg : pkgs) {
                    IContainer[] locations = ResourcesPlugin.getWorkspace().getRoot().findContainersForLocationURI(pkg.getFile().toURI());
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRunnable

                            // Generate the Bnd model
                            final BndEditModel bndModel = generateBndModel(progress.newChild(1));

                            // Make changes to the project
                            final IWorkspaceRunnable op = new IWorkspaceRunnable() {
                                @Override
                                public void run(IProgressMonitor monitor) throws CoreException {
                                    processGeneratedProject(ProjectPaths.get(pageOne.getProjectLayout()), bndModel, javaProj, monitor);
                                }
                            };
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRunnable

        desc.setNatureIds(newNatures);
        project.setDescription(desc, null);
    }

    void doSetProjectDesc(final IProject project, final IProjectDescription desc) throws CoreException {
        final IWorkspaceRunnable workspaceOp = new IWorkspaceRunnable() {
            public void run(IProgressMonitor monitor) throws CoreException {
                project.setDescription(desc, monitor);
            }
        };
        try {
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRunnable

    /*
     * @see org.eclipse.jface.preference.PreferencePage#performOk()
     */
    public boolean performOk()
    {
        IWorkspaceRunnable runnable =
            new IWorkspaceRunnable()
        {
            public void run(IProgressMonitor monitor) throws CoreException
            {
                getBreakpoint().setEnabled(enabledButton.getSelection());
                storeCondition();
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRunnable

    String targetWorkspacePath = getWorkspaceRoot().getLocation().toFile().getCanonicalPath();
    copyDirectory(new File(sourceWorkspacePath, projectName), new File(targetWorkspacePath, projectName));

    // create project
    final IProject project = getWorkspaceRoot().getProject(projectName);
    IWorkspaceRunnable populate = new IWorkspaceRunnable() {
      public void run(IProgressMonitor monitor) throws CoreException {
        project.create(null);
        try {
          project.open(null);
        }
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRunnable

    @Override
    public boolean performFinish()
    {
        IWorkspace workspace = ResourcesPlugin.getWorkspace();

        IWorkspaceRunnable op = new IWorkspaceRunnable()
        {
            public void run(IProgressMonitor monitor) throws CoreException
            {
                try
                {
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRunnable

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

            IWorkspaceRunnable op = new IWorkspaceRunnable()
            {
                public void run(IProgressMonitor monitor) throws CoreException
                {
                    try
                    {
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRunnable

        if (currentProject == null || !currentProject.exists())
        {
            return;
        }

        IWorkspaceRunnable op = new IWorkspaceRunnable()
        {
            public void run(IProgressMonitor monitor) throws CoreException
            {
                doRemoveProject(monitor);
            }
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRunnable

                    // wrap the import action in a IWorkspaceRunnable to make sure that changes are only
                    // published once at the end. This is especially important since the import action
                    // sets persistent properties on the modified resources to avoid them being published
                    // following this change ( see org.apache.sling.ide.core.ResourceUtil )
                    try {
                        ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {

                            @Override
                            public void run(IProgressMonitor monitor) throws CoreException {
                                try {
                                    new ImportRepositoryContentAction(server, projectRelativePath, project,
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.