Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IWorkspaceRunnable


 
  private void applyDetector(final IResource resource, final ITaskTagDetector detector){
    Display.getDefault().asyncExec(new Runnable() {
      public void run(){
        try {
          ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
            public void run(IProgressMonitor monitor) throws CoreException {
              try {
                resource.deleteMarkers(IMarker.TASK, false, 0);
                detector.detect((IFile)resource, tags);
              } catch(Exception ex){
View Full Code Here


    config.getAssistProcessor().update(input.getFile());
  }
 
  protected void doValidate(){
    try {
      ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
        public void run(IProgressMonitor monitor) throws CoreException {
          try {
            IFileEditorInput input = (IFileEditorInput)getEditorInput();
            new JavaScriptValidator(input.getFile()).doValidate();
          } catch(Exception ex){
View Full Code Here

  }
 
  public void dispose() {
    if(getEditorInput() instanceof IFileEditorInput){
      try {
        ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
          public void run(IProgressMonitor monitor) throws CoreException {
            try {
              IFileEditorInput input = (IFileEditorInput)getEditorInput();
              HTMLProjectParams params = new HTMLProjectParams(input.getFile().getProject());
              if(params.getRemoveMarkers()){
View Full Code Here

      final IWorkspace workspace = ResourcesPlugin.getWorkspace();
      final Jg jg = new Jg();
      final TypeDescription[] types = mergedTypeSystemDescription.getTypes();
      final String outputDirectory = getPrimarySourceFolder().getLocation().toOSString();
      final String inputFile = file.getLocation().toOSString(); // path to descriptor file
      IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
        public void run(IProgressMonitor progressMonitor) {
          try {
            jg.mainForCde(new MergerImpl(), new JCasGenProgressMonitor(progressMonitor),
                    jCasGenThrower, inputFile, outputDirectory, types, (CASImpl) getCurrentView());
          } catch (IOException e) {
View Full Code Here

  public Object run(Object object) {
    try {
      final String[] arguments = (String[]) object;
      final IWorkspace workspace = ResourcesPlugin.getWorkspace();
      final Jg jg = new Jg();
      IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
        public void run(IProgressMonitor progressMonitor) throws CoreException {
          jg.main0(arguments, new MergerImpl(), null, // no progressMonitor,
                  new EP_LogThrowErrorImpl());
        }
      };
View Full Code Here

      final IWorkspace workspace = ResourcesPlugin.getWorkspace();
      final Jg jg = new Jg();
      final TypeDescription[] types = mergedTypeSystemDescription.getTypes();
      final String outputDirectory = getPrimarySourceFolder().getLocation().toOSString();
      final String inputFile = file.getLocation().toOSString(); // path to descriptor file
      IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
        public void run(IProgressMonitor progressMonitor) {
          try {
            jg.mainForCde(new MergerImpl(), new JCasGenProgressMonitor(progressMonitor),
                    jCasGenThrower, inputFile, outputDirectory, types, (CASImpl) getCurrentView(),
                    getProject().getLocationURI().getPath(),
View Full Code Here

    this.workspace = method.getFile().getWorkspace();
  }

  @Override
  protected void deleteMarkers(final IMarker[] markers) throws CoreException {
    workspace.run(new IWorkspaceRunnable() {
      public void run(IProgressMonitor monitor) throws CoreException {
        for (int i= 0; i < markers.length; ++i) {
          markers[i].delete();
        }
      }
View Full Code Here

                } catch (CoreException e) {
                  e.printStackTrace();
                }
                //use refresh scope manager to refresh
                  RefreshScopeManager manager = RefreshScopeManager.getInstance();
                  IWorkspaceRunnable runnable = manager.getRefreshRunnable(proj);
                  try {
                  ResourcesPlugin.getWorkspace().run(runnable, null, IWorkspace.AVOID_UPDATE, new NullProgressMonitor());
                } catch (CoreException e) {
                  e.printStackTrace();
                }
View Full Code Here

    Job currentJob = Job.getJobManager().currentJob();
    ISchedulingRule rule = null;
    if (currentJob != null) {
      rule = currentJob.getRule();
    }
    IWorkspaceRunnable validationRunnable = new IWorkspaceRunnable() {
      public void run(IProgressMonitor monitor) throws CoreException {
        try {
          doValidate(helper, reporter);
        }
        catch (ValidationException e) {
View Full Code Here

      for (int i = 0; i < codas.length; i++) {
        addDependsOn(workspaceRoot.getFile(codas[i]));
      }
    }
   
    IWorkspaceRunnable validationRunnable = new IWorkspaceRunnable() {
      public void run(IProgressMonitor monitor) throws CoreException {
        if (fragmentCheck((IFile) resource)) {
          validateFile((IFile) resource, reporter);
        }
        IResource[] resources = (IResource[]) fDependsOn.toArray(new IResource[fDependsOn.size()]);
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.