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


   */
  public static void deleteMarkers(IResource resource, String markerType, final String attributeName, final Object attributeValue) throws CoreException
  {         
    final IMarker[] v400Markers = resource.findMarkers(IMarker.PROBLEM, false, IResource.DEPTH_INFINITE);
    final IMarker[] markers = resource.findMarkers(markerType, true, IResource.DEPTH_INFINITE);
    IWorkspaceRunnable op = new IWorkspaceRunnable()
     {
       public void run(IProgressMonitor progressMonitor) throws CoreException
       {   
         // this fixes defect 193406
         // here we remove markers that may have been added by the v400 code
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

        "tapestry5-annotations-5.1.0.5.jar",
        "woodstox-core-asl-4.0.3.jar", };
    try {
      // if this path exists
      if (configPath.toFile().exists()) {// configPath.toFile().exists()
        final IWorkspaceRunnable op = new IWorkspaceRunnable() {
          public void run(final IProgressMonitor monitor_inner)
              throws CoreException {
            String absolutePath = ComponentCore
                .createComponent(project).getRootFolder()
                .getUnderlyingFolder().getRawLocation()
                .toString();
            String webContent = absolutePath.substring(absolutePath
                .lastIndexOf("/"));
            for (int i = 0; i < jarList.length; i++) {
              String jar = jarList[i];
              IFile eachJar = project.getFile(webContent
                  + libPath + jar);
              if (!eachJar.exists()) {
                eachJar.create(this.getClass().getClassLoader()
                    .getResourceAsStream("jars/" + jar),
                    false, null);
              }
            }
            project.refreshLocal(IResource.DEPTH_INFINITE,
                monitor_inner);
          }
        };
        op.run(monitor);
      }
    } catch (final CoreException e) {
      TapestryCorePlugin.log(e,
          "Exception occured while copying Tapestry jar libraries");
    }
View Full Code Here

        "tapestry-json-5.2.6.jar",
        "tapestry5-annotations-5.2.6.jar" };
    try {
      // if this path exists
      if (configPath.toFile().exists()) {// configPath.toFile().exists()
        final IWorkspaceRunnable op = new IWorkspaceRunnable() {
          public void run(final IProgressMonitor monitor_inner)
              throws CoreException {
            String absolutePath = ComponentCore
                .createComponent(project).getRootFolder()
                .getUnderlyingFolder().getRawLocation()
                .toString();
            String webContent = absolutePath.substring(absolutePath
                .lastIndexOf("/"));
            for (int i = 0; i < jarList.length; i++) {
              String jar = jarList[i];
              IFile eachJar = project.getFile(webContent
                  + libPath + jar);
              if (!eachJar.exists()) {
                eachJar.create(this.getClass().getClassLoader()
                    .getResourceAsStream("jars/" + jar),
                    false, null);
              }
            }
            project.refreshLocal(IResource.DEPTH_INFINITE,
                monitor_inner);
          }
        };
        op.run(monitor);
      }
    } catch (final CoreException e) {
      TapestryCorePlugin.log(e,
          "Exception occured while copying Tapestry jar libraries");
    }
View Full Code Here

            Thread.sleep(500);
          } catch (InterruptedException e)
          {
          }
        }
        ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable()
        {

          public void run(IProgressMonitor monitor)
              throws CoreException
          {
View Full Code Here

      resources.add(file);
      addMarkers(newMarkers, file, modelUnit, astUnit);
    }
    // delete markers from resources and add new markers
    {
      IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
        public void run(IProgressMonitor monitor) throws CoreException {
          // delete markers
          for (IFile resource : resources) {
            resource.deleteMarkers(m_markerID, false, IResource.DEPTH_INFINITE);
          }
View Full Code Here

    }
    // prepare AST unit and type
    CompilationUnit implRoot = Utils.parseUnit(implUnit);
    TypeDeclaration implType = (TypeDeclaration) implRoot.types().get(0);
    // use standard JDT operation
    final IWorkspaceRunnable workspaceRunnable =
        OverrideMethodsAction.createRunnable(implRoot, implType.resolveBinding(), null, -1, false);
    // execute in UI because operation works with widgets during apply
    ExecutionUtils.runLogUI(new RunnableEx() {
      public void run() throws Exception {
        workspaceRunnable.run(null);
      }
    });
    implUnit.save(null, true);
    implUnit.getBuffer().save(null, true);
  }
View Full Code Here

    protected void createMarker(final IResource res,
                                final String message,
                                final int lineNumber) {
        try {
            IWorkspaceRunnable r = new IWorkspaceRunnable() {
                public void run(IProgressMonitor monitor) throws CoreException {
                    IMarker marker = res
                            .createMarker( IDroolsModelMarker.DROOLS_MODEL_PROBLEM_MARKER );
                    marker.setAttribute( IMarker.MESSAGE,
                                         message );
View Full Code Here

    protected void createMarker(final IResource res,
                                final String message,
                                final int lineNumber) {
        try {
            IWorkspaceRunnable r = new IWorkspaceRunnable() {
                public void run(IProgressMonitor monitor) throws CoreException {
                    IMarker marker = res
                            .createMarker( IDroolsModelMarker.DROOLS_MODEL_PROBLEM_MARKER );
                    marker.setAttribute( IMarker.MESSAGE,
                                         message );
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.