Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.WorkingCopyOwner


public class ChangeText {

    public void inCompilationUnit(ICompilationUnit compilationUnit, int position, int length, String newText) throws JavaModelException {
        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);
View Full Code Here


      case K_COMPILATION_UNIT :
        CompilationUnitDeclaration compilationUnitDeclaration = null;
        try {
          NodeSearcher searcher = null;
          org.eclipse.jdt.internal.compiler.env.ICompilationUnit sourceUnit = null;
          WorkingCopyOwner wcOwner = this.workingCopyOwner;
          if (this.typeRoot instanceof ICompilationUnit) {
              /*
               * this.compilationUnitSource is an instance of org.eclipse.jdt.internal.core.CompilationUnit that implements
               * both org.eclipse.jdt.core.ICompilationUnit and org.eclipse.jdt.internal.compiler.env.ICompilationUnit
               */
 
View Full Code Here

    }

    public WorkingCopyOwner getWorkingCopyOwner() {

        if (fWorkingCopyOwner == null) {
            fWorkingCopyOwner = new WorkingCopyOwner() {
              /* (non-Javadoc)
               * @see org.eclipse.jdt.core.WorkingCopyOwner#getProblemRequestor(org.eclipse.jdt.core.ICompilationUnit)
               */
              public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy) {
                return CompilationUnitHelper.this.getProblemRequestor();
View Full Code Here

      case K_COMPILATION_UNIT :
        CompilationUnitDeclaration compilationUnitDeclaration = null;
        try {
          NodeSearcher searcher = null;
          org.eclipse.jdt.internal.compiler.env.ICompilationUnit sourceUnit = null;
          WorkingCopyOwner wcOwner = this.workingCopyOwner;
          if (this.typeRoot instanceof ICompilationUnit) {
              /*
               * this.compilationUnitSource is an instance of org.eclipse.jdt.internal.core.CompilationUnit that implements
               * both org.eclipse.jdt.core.ICompilationUnit and org.eclipse.jdt.internal.compiler.env.ICompilationUnit
               */
 
View Full Code Here

        final List<Tuple<IJavaElement, CompletionProposal>> ret = new ArrayList<Tuple<IJavaElement, CompletionProposal>>();

        IClasspathEntry entries[] = getClasspathEntries();
        //Using old version for compatibility with eclipse 3.2
        ICompilationUnit unit = new WorkingCopyOwner() {
        }.newWorkingCopy(name, entries, null, new NullProgressMonitor());
        unit.getBuffer().setContents(contents);
        CompletionProposalCollector collector = createCollector(filterCompletionName, ret, unit);

        unit.codeComplete(completionOffset, collector); //fill the completions while searching it
View Full Code Here

      case K_COMPILATION_UNIT :
        CompilationUnitDeclaration compilationUnitDeclaration = null;
        try {
          NodeSearcher searcher = null;
          org.eclipse.jdt.internal.compiler.env.ICompilationUnit sourceUnit = null;
          WorkingCopyOwner wcOwner = this.workingCopyOwner;
          if (this.typeRoot instanceof ICompilationUnit) {
              /*
               * this.compilationUnitSource is an instance of org.eclipse.jdt.internal.core.CompilationUnit that implements
               * both org.eclipse.jdt.core.ICompilationUnit and org.eclipse.jdt.internal.compiler.env.ICompilationUnit
               */
 
View Full Code Here

  }

  public WorkingCopyOwner getWorkingCopyOwner() {

    if (fWorkingCopyOwner == null) {
      fWorkingCopyOwner = new WorkingCopyOwner() {
        @Override
        public String toString() {
          return "Spring Beans IDE Working copy owner"; //$NON-NLS-1$
        }
      };
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.WorkingCopyOwner

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.