Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IWorkspaceRunnable


    final IPath configPath = resolveConfigPath(project, config.getStringProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH));
    try {
      // do not overwrite if the file exists
      if (!configPath.toFile().exists()) {
        final IWorkspaceRunnable op = new IWorkspaceRunnable(){
          public void run(final IProgressMonitor monitor_inner) throws CoreException{
                jsfUtil.createConfigFile(configPath);
            project.refreshLocal(IResource.DEPTH_INFINITE, monitor_inner);
          }
        };
        op.run(monitor);
      }
    } catch (final CoreException e) {
      JSFCorePlugin.log(e, "Exception occured while creating faces-config.xml");//$NON-NLS-1$
    }
View Full Code Here


         * plug-in loaded. Don't do it immediately since adding the save
         * participant requires a lock on the workspace to compute the
         * accumulated deltas, and if the tree is not already locked it
         * becomes a blocking call.
         */
        workspace.run(new IWorkspaceRunnable() {
          public void run(final IProgressMonitor worspaceMonitor) throws CoreException {
            ISavedState savedState = null;
           
            try {
              //add the save participant for this bundle
View Full Code Here

            return _properties.getProperty(key, defaultValue);
        }

        public void store()
        {
            final IWorkspaceRunnable storeJob = new IWorkspaceRunnable()
            {
                public void run(IProgressMonitor monitor) throws CoreException {
                    IFile propFile;

                    try {
View Full Code Here

import org.eclipse.debug.core.model.LineBreakpoint;

public class XVRBreakpoint extends LineBreakpoint {
  public XVRBreakpoint(){}
  public XVRBreakpoint(final IResource resource, final int lineNumber) throws CoreException {
    IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
      public void run(IProgressMonitor monitor) throws CoreException {
        IMarker marker = resource.createMarker("xvrengine.lineBreakpoint.marker");
        setMarker(marker);
        marker.setAttribute(IBreakpoint.ENABLED, Boolean.TRUE);
        marker.setAttribute(IMarker.LINE_NUMBER, lineNumber);
View Full Code Here

        final IProject project, final SubMonitor subMonitor)
        throws LocalCancellationException {

        log.debug("Inv" + Utils.prefix(peer) + ": Writing archive to disk...");
        try {
            eclipseHelper.getWorkspace().run(new IWorkspaceRunnable() {
                public void run(IProgressMonitor monitor) throws CoreException {
                    try {
                        FileUtils.writeArchive(archiveStream, project,
                            subMonitor);
                    } catch (LocalCancellationException e) {
View Full Code Here

        for (IPath iPath : toKeep) {
            for (int i = 0; i < iPath.segmentCount(); i++) {
                toDelete.remove(iPath.removeLastSegments(i));
            }
        }
        IWorkspaceRunnable deleteProcedure = new IWorkspaceRunnable() {
            public void run(IProgressMonitor progress) throws CoreException {
                // SubMonitor monitor = (SubMonitor) progress;// doesn't work?
                for (IPath path : toDelete) {
                    monitor.subTask("Deleting " + path.lastSegment());
                    IResource resource = path.hasTrailingSeparator() ? localProject
View Full Code Here

     *      handled.
     */
    public static void createFile(final InputStream input, final IFile file,
        SubMonitor monitor) throws CoreException {

        IWorkspaceRunnable createFolderProcedure = new IWorkspaceRunnable() {
            public void run(IProgressMonitor monitor) throws CoreException {
                // Make sure directory exists
                mkdirs(file);

                // Make sure that parent is writable
View Full Code Here

        if (folder.exists()) {
            log.debug(".create() Creating folder " + folder.getName()
                + " not possible - it already exists");
            return;
        }
        IWorkspaceRunnable createFolderProcedure = new IWorkspaceRunnable() {
            public void run(IProgressMonitor monitor) throws CoreException {

                // recursively create folders until parent folder exists
                // or project root is reached
                IFolder parentFolder = getParentFolder(folder);
View Full Code Here

            log.warn("File not found for deletion: " + resource,
                new StackTrace());
            return;
        }

        IWorkspaceRunnable deleteProcedure = new IWorkspaceRunnable() {
            public void run(IProgressMonitor monitor) throws CoreException {
                if (!resource.exists())
                    return;

                if (resource.getResourceAttributes() == null)
View Full Code Here

            log.warn(".move Source file can not be accessed  "
                + source.getFullPath());
            return;
        }

        IWorkspaceRunnable moveProcedure = new IWorkspaceRunnable() {
            public void run(IProgressMonitor monitor) throws CoreException {
                IPath absDestination = destination.makeAbsolute();

                source.move(absDestination, false, monitor);
View Full Code Here

TOP

Related Classes of org.eclipse.core.resources.IWorkspaceRunnable

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.