/** * Returns the resulting change. * * @return the resulting change * @throws CoreException * if the change could not be created */ public Change getResult() throws CoreException { return fRewrite.createChange(true); }
/** * Returns the resulting change. * * @return the resulting change * @throws CoreException * if the change could not be created */ public Change getResult() throws CoreException { return fRewrite.createChange(true); }
/** * Creates a compilation unit change based on the events recorded by this compilation unit * rewrite. * * @param generateGroups <code>true</code> to generate text edit groups, <code>false</code> otherwise * @return a {@link CompilationUnitChange}, or <code>null</code> for an empty change * @throws CoreException when text buffer acquisition or import rewrite text edit creation fails * @throws IllegalArgumentException when the AST rewrite encounters problems * @since 3.6 */ public CompilationUnitChange createChange(boolean generateGroups) throws CoreException { return createChange(generateGroups, null); }
protected void registerChanges(final TextEditBasedChangeManager manager) throws CoreException { for (final Entry<ICompilationUnit, CompilationUnitRewrite> entry : fCompilationUnitRewrites.entrySet()) { CompilationUnitRewrite rewrite= entry.getValue(); if (rewrite != null) { final CompilationUnitChange change= rewrite.createChange(true); if (change != null) manager.manage(entry.getKey(), change); } } }
/** * Creates a compilation unit change based on the events recorded by this compilation unit rewrite. * @param generateGroups <code>true</code> to generate text edit groups, <code>false</code> otherwise * @param monitor the progress monitor or <code>null</code> * @return a {@link CompilationUnitChange}, or <code>null</code> for an empty change * @throws CoreException when text buffer acquisition or import rewrite text edit creation fails * @throws IllegalArgumentException when the AST rewrite encounters problems */ public CompilationUnitChange createChange(boolean generateGroups, IProgressMonitor monitor) throws CoreException { return createChange(fCu.getElementName(), generateGroups, monitor); }
protected static CompilationUnitChange createCompilationUnitChange(CompilationUnitRewrite rewrite) throws CoreException { CompilationUnitChange change= rewrite.createChange(true); if (change != null) { change.setSaveMode(TextFileChange.KEEP_SAVE_STATE); } return change; }
private void createChangeAndDiscardRewrite(ICompilationUnit compilationUnit) throws CoreException { CompilationUnitRewrite rewrite= fRewrites.get(compilationUnit); if (rewrite != null) { fTextChangeManager.manage(compilationUnit, rewrite.createChange(true)); fRewrites.remove(compilationUnit); } }
protected static CompilationUnitChange createCompilationUnitChange(CompilationUnitRewrite rewrite) throws CoreException { CompilationUnitChange change= rewrite.createChange(true); if (change != null) change.setSaveMode(TextFileChange.KEEP_SAVE_STATE); return change; }
protected static CompilationUnitChange createCompilationUnitChange(CompilationUnitRewrite rewrite) throws CoreException { CompilationUnitChange change= rewrite.createChange(true); if (change != null) change.setSaveMode(TextFileChange.KEEP_SAVE_STATE); return change; }
private void createChangeAndDiscardRewrite(ICompilationUnit compilationUnit) throws CoreException { CompilationUnitRewrite rewrite= fRewrites.get(compilationUnit); if (rewrite != null) { fTextChangeManager.manage(compilationUnit, rewrite.createChange(true)); fRewrites.remove(compilationUnit); } }
protected static CompilationUnitChange createCompilationUnitChange(ICompilationUnit cu, CompilationUnitRewrite rewrite) throws CoreException { CompilationUnitChange change= rewrite.createChange(); if (change != null) { if (cu.isWorkingCopy()) change.setSaveMode(TextFileChange.LEAVE_DIRTY); } return change; }
public CompilationUnitChange createTextChange(IProgressMonitor pm) throws CoreException { createConstantDeclaration(); replaceExpressionsWithConstant(); return fCuRewrite.createChange(RefactoringCoreMessages.ExtractConstantRefactoring_change_name, true, pm); }
public CompilationUnitChange createTextChange(IProgressMonitor pm) throws CoreException { createConstantDeclaration(); replaceExpressionsWithConstant(); return fCuRewrite.createChange(RefactoringCoreMessages.ExtractConstantRefactoring_change_name, true, pm); }
public CompilationUnitChange createTextChange(IProgressMonitor pm) throws CoreException { createConstantDeclaration(); replaceExpressionsWithConstant(); return fCuRewrite.createChange(RefactoringCoreMessages.ExtractConstantRefactoring_change_name, true, pm); }
public CompilationUnitChange getChange() throws CoreException { for (int i= 0; i < fReferences.length; i++) inlineReference(fReferences[i]); removeConstantDeclarationIfNecessary(); return fCuRewrite.createChange(true); }
public CompilationUnitChange getChange() throws CoreException { for (int i= 0; i < fReferences.length; i++) inlineReference(fReferences[i]); removeConstantDeclarationIfNecessary(); return fCuRewrite.createChange(); }
public CompilationUnitChange createTextChange(IProgressMonitor pm) throws CoreException { createConstantDeclaration(); replaceExpressionsWithConstant(); return fCuRewrite.createChange(RefactoringCoreMessages.ExtractConstantRefactoring_change_name, true, pm); }
public TextChange createTextChange(IProgressMonitor pm) throws CoreException { try { pm.beginTask(RefactoringCoreMessages.ExtractTempRefactoring_checking_preconditions, 3); fCURewrite= new CompilationUnitRewrite(fCu, fCompilationUnitNode); fCURewrite.getASTRewrite().setTargetSourceRangeComputer(new NoCommentSourceRangeComputer()); doCreateChange(new SubProgressMonitor(pm, 2)); return fCURewrite.createChange(RefactoringCoreMessages.ExtractTempRefactoring_change_name, true, new SubProgressMonitor(pm, 1)); } finally { pm.done(); } }
public CompilationUnitChange createCompilationUnitChange(IProgressMonitor pm) throws CoreException { final CompilationUnitRewrite rewrite= new CompilationUnitRewrite(fCu, fCompilationUnitNode); final ITypeBinding[] typeParameters= getTypeParameters(); addNestedClass(rewrite, typeParameters); modifyConstructorCall(rewrite, typeParameters); return rewrite.createChange(RefactoringCoreMessages.ConvertAnonymousToNestedRefactoring_name, false, pm); }
public CompilationUnitChange createCompilationUnitChange(IProgressMonitor pm) throws CoreException { final CompilationUnitRewrite rewrite= new CompilationUnitRewrite(fCu, fCompilationUnitNode); final ITypeBinding[] typeParameters= getTypeParameters(); addNestedClass(rewrite, typeParameters); modifyConstructorCall(rewrite, typeParameters); return rewrite.createChange(RefactoringCoreMessages.ConvertAnonymousToNestedRefactoring_name, false, pm); }