private void setSaveMode(CompositeChange composite) { Change[] children = composite.getChildren(); for (int i = 0; i < children.length; i++) { Change child = children[i]; if (child instanceof TextFileChange) { ((TextFileChange)child).setSaveMode(TextFileChange.LEAVE_DIRTY); } else if (child instanceof CompositeChange) { setSaveMode((CompositeChange)child); } } } }
private void performTextEdit(TextEdit textEdit, IFile file, IProgressMonitor pm) throws CoreException { TextFileChange textFileChange = new TextFileChange("Add import for " + fQualifiedTypeToImport, file); //$NON-NLS-1$ textFileChange.setSaveMode(TextFileChange.KEEP_SAVE_STATE); textFileChange.setEdit(textEdit); textFileChange.perform(pm); }
@Override public Change createChange(String name, TextEdit textEdit) { TextFileChange textFileChange = new TextFileChange(name, file); textFileChange.setSaveMode(TextFileChange.FORCE_SAVE); textFileChange.setEdit(textEdit); textFileChange.setTextType(getURI().fileExtension()); return textFileChange; }
protected TextChange createTextChange() throws CoreException { IFix fix= fFix; TextChange createChange= fix.createChange(); if (createChange instanceof TextFileChange) ((TextFileChange)createChange).setSaveMode(TextFileChange.LEAVE_DIRTY); if (fix instanceof LinkedFix) { setLinkedProposalModel(((LinkedFix) fix).getLinkedPositions()); } if (createChange == null) return new CompilationUnitChange("", getCompilationUnit()); //$NON-NLS-1$ return createChange; }
@Override public Change createChange(String name, TextEdit textEdit) { TextFileChange textFileChange = new TextFileChange(name, redirectedFile); textFileChange.setSaveMode(TextFileChange.FORCE_SAVE); textFileChange.setEdit(textEdit); textFileChange.setTextType(getURI().fileExtension()); return textFileChange; } }
private static TextChange addTextEditFromRewrite(TextChangeManager manager, ICompilationUnit cu, ASTRewrite rewrite) throws CoreException { try { ITextFileBuffer buffer= RefactoringFileBuffers.acquire(cu); TextEdit resultingEdits= rewrite.rewriteAST(buffer.getDocument(), cu.getJavaProject().getOptions(true)); TextChange textChange= manager.get(cu); if (textChange instanceof TextFileChange) { TextFileChange tfc= (TextFileChange) textChange; tfc.setSaveMode(TextFileChange.KEEP_SAVE_STATE); } String message= RefactoringCoreMessages.DeleteChangeCreator_1; TextChangeCompatibility.addTextEdit(textChange, message, resultingEdits); return textChange; } finally { RefactoringFileBuffers.release(cu); } }
private static TextChange addTextEditFromRewrite(TextChangeManager manager, ICompilationUnit cu, ASTRewrite rewrite) throws CoreException { try { ITextFileBuffer buffer= RefactoringFileBuffers.acquire(cu); TextEdit resultingEdits= rewrite.rewriteAST(buffer.getDocument(), cu.getJavaProject().getOptions(true)); TextChange textChange= manager.get(cu); if (textChange instanceof TextFileChange) { TextFileChange tfc= (TextFileChange) textChange; tfc.setSaveMode(TextFileChange.KEEP_SAVE_STATE); } String message= RefactoringCoreMessages.DeleteChangeCreator_1; TextChangeCompatibility.addTextEdit(textChange, message, resultingEdits); return textChange; } finally { RefactoringFileBuffers.release(cu); } }
private static TextChange addTextEditFromRewrite(TextChangeManager manager, ICompilationUnit cu, ASTRewrite rewrite) throws CoreException { try { ITextFileBuffer buffer= RefactoringFileBuffers.acquire(cu); TextEdit resultingEdits= rewrite.rewriteAST(buffer.getDocument(), cu.getJavaProject().getOptions(true)); TextChange textChange= manager.get(cu); if (textChange instanceof TextFileChange) { TextFileChange tfc= (TextFileChange) textChange; tfc.setSaveMode(TextFileChange.KEEP_SAVE_STATE); } String message= RefactoringCoreMessages.DeleteChangeCreator_1; TextChangeCompatibility.addTextEdit(textChange, message, resultingEdits); return textChange; } finally { RefactoringFileBuffers.release(cu); } }
((TextFileChange) change).setSaveMode(TextFileChange.FORCE_SAVE);
private static TextChange addTextEditFromRewrite(TextChangeManager manager, ICompilationUnit cu, ASTRewrite rewrite) throws CoreException { try { ITextFileBuffer buffer= RefactoringFileBuffers.acquire(cu); TextEdit resultingEdits= rewrite.rewriteAST(buffer.getDocument(), cu.getJavaProject().getOptions(true)); TextChange textChange= manager.get(cu); if (textChange instanceof TextFileChange) { TextFileChange tfc= (TextFileChange) textChange; if (cu.isWorkingCopy()) tfc.setSaveMode(TextFileChange.LEAVE_DIRTY); } String message= RefactoringCoreMessages.DeleteChangeCreator_1; TextChangeCompatibility.addTextEdit(textChange, message, resultingEdits); return textChange; } finally { RefactoringFileBuffers.release(cu); } }
change.setSaveMode(TextFileChange.FORCE_SAVE); setChangeTextType(change, files[i]); edits.add(change);
TextChange textChange= fChangeManager.get(fType.getCompilationUnit()); if (textChange instanceof TextFileChange) { ((TextFileChange) textChange).setSaveMode(TextFileChange.FORCE_SAVE);
TextChange textChange= fChangeManager.get(fType.getCompilationUnit()); if (textChange instanceof TextFileChange) { ((TextFileChange) textChange).setSaveMode(TextFileChange.FORCE_SAVE);
TextChange textChange= fChangeManager.get(fType.getCompilationUnit()); if (textChange instanceof TextFileChange) { ((TextFileChange) textChange).setSaveMode(TextFileChange.FORCE_SAVE);
TextChange textChange = fChangeManager.get(fType.getCompilationUnit()); if (textChange instanceof TextFileChange) { ((TextFileChange) textChange).setSaveMode(TextFileChange.FORCE_SAVE);