Examples of commitWorkingCopy()


Examples of org.eclipse.dltk.core.ISourceModule.commitWorkingCopy()

    doCodeCompletion(moduleFile, 0, "basic_pack/");
   
    // Test commitWorkingCopy
    sourceModule.becomeWorkingCopy(new NullProblemRequestor(), new NullProgressMonitor());
    sourceModule.getBuffer().setContents("module wc_commitWC_Test;");
    sourceModule.commitWorkingCopy(true, new NullProgressMonitor());
    doCodeCompletion(moduleFile, 0, "wc_commitWC_Test/");

    sourceModule.getBuffer().setContents("module wc_commitWC_Test2;");
    sourceModule.commitWorkingCopy(true, new NullProgressMonitor());
    sourceModule.discardWorkingCopy();
View Full Code Here

Examples of org.eclipse.dltk.core.ISourceModule.commitWorkingCopy()

    sourceModule.getBuffer().setContents("module wc_commitWC_Test;");
    sourceModule.commitWorkingCopy(true, new NullProgressMonitor());
    doCodeCompletion(moduleFile, 0, "wc_commitWC_Test/");

    sourceModule.getBuffer().setContents("module wc_commitWC_Test2;");
    sourceModule.commitWorkingCopy(true, new NullProgressMonitor());
    sourceModule.discardWorkingCopy();
    doCodeCompletion(moduleFile, 0, "wc_commitWC_Test2/");
   
    // Test setContents of non-working copy - only valid if sourceModule in buildpath it seems
    if(sourceModule.exists()) {
View Full Code Here

Examples of org.eclipse.jdt.core.ICompilationUnit.commitWorkingCopy()

        buf.save(null, false);

      imports.create(needsSave, new SubProgressMonitor(monitor, 1));
      removeUnusedImports(cu, needsSave);
      if (needsCommit)
        cu.commitWorkingCopy(false, new SubProgressMonitor(monitor, 1));
    } finally {
      if (createdWorkingCopy != null) {
        createdWorkingCopy.discardWorkingCopy();
      }
      monitor.done();
View Full Code Here

Examples of org.eclipse.jdt.core.ICompilationUnit.commitWorkingCopy()

                }
            }
            fCreatedType = createdType;

            if (needsSave) {
                cu.commitWorkingCopy(true, new SubProgressMonitor(monitor, 1));
            } else {
                monitor.worked(1);
            }

        } finally {
View Full Code Here

Examples of org.eclipse.jdt.core.ICompilationUnit.commitWorkingCopy()

                }
            }
            fCreatedType = createdType;

            if (needsSave) {
                cu.commitWorkingCopy(true, new SubProgressMonitor(monitorInternal, 1));
            } else {
                monitorInternal.worked(1);
            }

        } finally {
View Full Code Here

Examples of org.eclipse.jdt.core.ICompilationUnit.commitWorkingCopy()

        if (success) {
          TextEdit edit = imports.rewriteImports(monitor);
          JavaUtil.applyEdit(copy, edit, true, monitor);
        }
        if (copy.isWorkingCopy()) {
          copy.commitWorkingCopy(true, monitor);
          copy.discardWorkingCopy();
        }
        IWorkbenchPartSite site = getEditorSite();
        if (site != null) {
          OrganizeImportsAction action = new OrganizeImportsAction(site);
View Full Code Here

Examples of org.eclipse.jdt.core.ICompilationUnit.commitWorkingCopy()

      try {
        icu.becomeWorkingCopy(null);
        icu.getBuffer().setContents(document.get());
        icu.reconcile(ICompilationUnit.NO_AST, false, null, null);
        icu.commitWorkingCopy(true, null);
        icu.discardWorkingCopy();
      } catch (JavaModelException e) {
        CrashReporter.reportException(e);
        logger.debug("Reconcile operation on ICompilationUnit failed.\r\n"
            + e.getLocalizedMessage());
View Full Code Here

Examples of org.eclipse.jdt.core.ICompilationUnit.commitWorkingCopy()

      try {
        icu.becomeWorkingCopy(null);
        icu.getBuffer().setContents(document.get());
        icu.reconcile(ICompilationUnit.NO_AST, false, null, null);
        icu.commitWorkingCopy(true, null);
        icu.discardWorkingCopy();
      } catch (JavaModelException e) {
        logger.debug("Reconcile operation on ICompilationUnit failed.\r\n"
            + e.getLocalizedMessage());
      }
View Full Code Here

Examples of org.eclipse.jdt.core.ICompilationUnit.commitWorkingCopy()

      try {
        icu.becomeWorkingCopy(null);
        icu.getBuffer().setContents(document.get());
        icu.reconcile(ICompilationUnit.NO_AST, false, null, null);
        icu.commitWorkingCopy(true, null);
        icu.discardWorkingCopy();
      } catch (JavaModelException e) {
        logger.debug("Reconcile operation on ICompilationUnit failed.\r\n"
            + e.getLocalizedMessage());
      }
View Full Code Here

Examples of org.eclipse.jdt.core.ICompilationUnit.commitWorkingCopy()

                    PreferenceConstants.P_FORMAT_ON_INSERT)) {
              FormatAllAction format = new FormatAllAction(editor
                  .getEditorSite());
              format.runOnMultiple(new ICompilationUnit[] { icu2 });
            }
            icu2.commitWorkingCopy(true, monitor);
          } catch (Exception e) {
            logger.debug(e.toString());
            CrashReporter.reportException(e);
          }
        }
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.