Package org.eclipse.jdt.core

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


        if (input instanceof ICompilationUnit) {
            workingCopy = (ICompilationUnit) input;
            // be in-sync with model
            // instead of using internal JavaModelUtil.reconcile(workingCopy);
            synchronized(workingCopy)  {
                workingCopy.reconcile(
                    ICompilationUnit.NO_AST,
                    false /* don't force problem detection */,
                    null /* use primary owner */,
                    null /* no progress monitor */);
            }
View Full Code Here


        try {
            WorkingCopyOwner owner = DefaultWorkingCopyOwner.PRIMARY;
            ICompilationUnit workingCopy = compilationUnit.getWorkingCopy(owner, null);
            IBuffer buffer = workingCopy.getBuffer();
            buffer.replace(position, length, newText);
            workingCopy.reconcile(ICompilationUnit.NO_AST, true, owner, null);
            compilationUnit.commitWorkingCopy(true, null);
        } finally {
            compilationUnit.discardWorkingCopy();
        }
    }
View Full Code Here

      CreateDialog dialog = new CreateDialog(new Shell(), new BuilderGenerator());
      dialog.show(workingCopy);

      synchronized (workingCopy) {
        workingCopy.reconcile(ICompilationUnit.NO_AST, false, null, null);
      }

    } catch (JavaModelException e) {
      e.printStackTrace();
    } catch (CoreException e) {
View Full Code Here

      }

      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"
View Full Code Here

      }

      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

      }

      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

    // update of the compilation unit
    cpu.getBuffer().setContents(
        astRoot.getTypeRoot().findPrimaryType().getCompilationUnit()
            .getSource());
    cpu.reconcile(ICompilationUnit.NO_AST, false, null, null);
    cpu.commitWorkingCopy(false, null);
  }

  /**
   * Inserts a TypeDeclaration into the target ICompilationUnit
View Full Code Here

      String newSource = document.get();

      // update of the compilation unit
      icu.getBuffer().setContents(newSource);
      icu.reconcile(ICompilationUnit.NO_AST, false, null, null);
      icu.commitWorkingCopy(false, null);
      icu.discardWorkingCopy();
    } catch (Exception e) {
      CrashReporter.reportException(e);
      logger.debug("Could not insert result: " + e.toString());
View Full Code Here

        // update of the compilation unit
        cpu.getBuffer().setContents(
            astRoot.getTypeRoot().findPrimaryType()
                .getCompilationUnit().getSource());
        cpu.reconcile(ICompilationUnit.NO_AST, false, null, null);
        cpu.commitWorkingCopy(false, null);
        return Status.OK_STATUS;
      }

      // Insert class
View Full Code Here

    ICompilationUnit cu = getCompilationUnit();
    if (cu != null) {
      try {
        synchronized(cu) {
          cu.makeConsistent(getProgressMonitor());
          cu.reconcile(ICompilationUnit.NO_AST, false, getWorkingCopyOwner(), getProgressMonitor());
        }
      }
      catch (JavaModelException e) {
        Logger.logException(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.