flags= flags | TextEdit.UPDATE_REGIONS; LocalTextEditProcessor result= new LocalTextEditProcessor(document, copiedEdit, flags); result.setExcludes(mapEdits( (TextEdit[])excludes.toArray(new TextEdit[excludes.size()]), fCopier));
private TextEditProcessor createTextEditProcessor(IDocument document, int flags, boolean preview) { if (fEdit == null) return new TextEditProcessor(document, new MultiTextEdit(0,0), flags); List<TextEdit> excludes= new ArrayList<>(0); TextEditBasedChangeGroup[] groups= getChangeGroups(); for (int index= 0; index < groups.length; index++) { TextEditBasedChangeGroup edit= groups[index]; if (!edit.isEnabled()) { excludes.addAll(Arrays.asList(edit.getTextEditGroup().getTextEdits())); } } if (preview) { fCopier= new TextEditCopier(fEdit); TextEdit copiedEdit= fCopier.perform(); boolean keep= getKeepPreviewEdits(); if (keep) flags= flags | TextEdit.UPDATE_REGIONS; LocalTextEditProcessor result= new LocalTextEditProcessor(document, copiedEdit, flags); result.setExcludes(mapEdits( excludes.toArray(new TextEdit[excludes.size()]), fCopier)); if (!keep) fCopier= null; return result; } else { LocalTextEditProcessor result= new LocalTextEditProcessor(document, fEdit, flags | TextEdit.UPDATE_REGIONS); result.setExcludes(excludes.toArray(new TextEdit[excludes.size()])); return result; } }
private TextEditProcessor createTextEditProcessor(IDocument document, int flags, boolean preview) { if (fEdit == null) return new TextEditProcessor(document, new MultiTextEdit(0,0), flags); List<TextEdit> excludes= new ArrayList<>(0); TextEditBasedChangeGroup[] groups= getChangeGroups(); for (int index= 0; index < groups.length; index++) { TextEditBasedChangeGroup edit= groups[index]; if (!edit.isEnabled()) { excludes.addAll(Arrays.asList(edit.getTextEditGroup().getTextEdits())); } } if (preview) { fCopier= new TextEditCopier(fEdit); TextEdit copiedEdit= fCopier.perform(); boolean keep= getKeepPreviewEdits(); if (keep) flags= flags | TextEdit.UPDATE_REGIONS; LocalTextEditProcessor result= new LocalTextEditProcessor(document, copiedEdit, flags); result.setExcludes(mapEdits( excludes.toArray(new TextEdit[excludes.size()]), fCopier)); if (!keep) fCopier= null; return result; } else { LocalTextEditProcessor result= new LocalTextEditProcessor(document, fEdit, flags | TextEdit.UPDATE_REGIONS); result.setExcludes(excludes.toArray(new TextEdit[excludes.size()])); return result; } }
private TextEditProcessor createTextEditProcessor(IDocument document, int flags, TextEditBasedChangeGroup[] changes) { if (fEdit == null) return new TextEditProcessor(document, new MultiTextEdit(0,0), flags); List includes= new ArrayList(0); for (int c= 0; c < changes.length; c++) { TextEditBasedChangeGroup change= changes[c]; Assert.isTrue(change.getTextEditChange() == this); if (change.isEnabled()) { includes.addAll(Arrays.asList(change.getTextEditGroup().getTextEdits())); } } fCopier= new TextEditCopier(fEdit); TextEdit copiedEdit= fCopier.perform(); boolean keep= getKeepPreviewEdits(); if (keep) flags= flags | TextEdit.UPDATE_REGIONS; LocalTextEditProcessor result= new LocalTextEditProcessor(document, copiedEdit, flags); result.setIncludes(mapEdits( (TextEdit[])includes.toArray(new TextEdit[includes.size()]), fCopier)); if (!keep) fCopier= null; return result; }
private TextEditProcessor createTextEditProcessor(IDocument document, int flags, TextEditBasedChangeGroup[] changes) { if (fEdit == null) return new TextEditProcessor(document, new MultiTextEdit(0,0), flags); List<TextEdit> includes= new ArrayList<>(0); for (int c= 0; c < changes.length; c++) { TextEditBasedChangeGroup change= changes[c]; Assert.isTrue(change.getTextEditChange() == this); if (change.isEnabled()) { includes.addAll(Arrays.asList(change.getTextEditGroup().getTextEdits())); } } fCopier= new TextEditCopier(fEdit); TextEdit copiedEdit= fCopier.perform(); boolean keep= getKeepPreviewEdits(); if (keep) flags= flags | TextEdit.UPDATE_REGIONS; LocalTextEditProcessor result= new LocalTextEditProcessor(document, copiedEdit, flags); result.setIncludes(mapEdits( includes.toArray(new TextEdit[includes.size()]), fCopier)); if (!keep) fCopier= null; return result; }
private TextEditProcessor createTextEditProcessor(IDocument document, int flags, TextEditBasedChangeGroup[] changes) { if (fEdit == null) return new TextEditProcessor(document, new MultiTextEdit(0,0), flags); List<TextEdit> includes= new ArrayList<>(0); for (int c= 0; c < changes.length; c++) { TextEditBasedChangeGroup change= changes[c]; Assert.isTrue(change.getTextEditChange() == this); if (change.isEnabled()) { includes.addAll(Arrays.asList(change.getTextEditGroup().getTextEdits())); } } fCopier= new TextEditCopier(fEdit); TextEdit copiedEdit= fCopier.perform(); boolean keep= getKeepPreviewEdits(); if (keep) flags= flags | TextEdit.UPDATE_REGIONS; LocalTextEditProcessor result= new LocalTextEditProcessor(document, copiedEdit, flags); result.setIncludes(mapEdits( includes.toArray(new TextEdit[includes.size()]), fCopier)); if (!keep) fCopier= null; return result; }