public CategorizedTextEditGroup createCategorizedGroupDescription(String name, GroupCategorySet set) { CategorizedTextEditGroup result= new CategorizedTextEditGroup(name, set); fTextEditGroups.add(result); return result; }
public CategorizedTextEditGroup createCategorizedGroupDescription(String name, GroupCategorySet set) { CategorizedTextEditGroup result= new CategorizedTextEditGroup(name, set); fTextEditGroups.add(result); return result; }
public CategorizedTextEditGroup createCategorizedGroupDescription(String name, GroupCategorySet set) { CategorizedTextEditGroup result= new CategorizedTextEditGroup(name, set); fTextEditGroups.add(result); return result; }
public static void addTextEdit(TextChange change, String name, TextEdit edit, GroupCategorySet groupCategories) throws MalformedTreeException { Assert.isNotNull(change); Assert.isNotNull(name); Assert.isNotNull(edit); TextEdit root= change.getEdit(); if (root == null) { root= new MultiTextEdit(); change.setEdit(root); } insert(root, edit); change.addTextEditChangeGroup(new TextEditChangeGroup( change, new CategorizedTextEditGroup(name, edit, groupCategories))); }
public static void addTextEdit(TextChange change, String name, TextEdit edit, GroupCategorySet groupCategories) throws MalformedTreeException { Assert.isNotNull(change); Assert.isNotNull(name); Assert.isNotNull(edit); TextEdit root= change.getEdit(); if (root == null) { root= new MultiTextEdit(); change.setEdit(root); } insert(root, edit); change.addTextEditChangeGroup(new TextEditChangeGroup( change, new CategorizedTextEditGroup(name, edit, groupCategories))); }
public static void addTextEdit(TextChange change, String name, TextEdit edit, GroupCategorySet groupCategories) throws MalformedTreeException { Assert.isNotNull(change); Assert.isNotNull(name); Assert.isNotNull(edit); TextEdit root= change.getEdit(); if (root == null) { root= new MultiTextEdit(); change.setEdit(root); } insert(root, edit); change.addTextEditChangeGroup(new TextEditChangeGroup( change, new CategorizedTextEditGroup(name, edit, groupCategories))); }
protected TextEditGroup createTextEditGroup(String label) { if (label.length() > 0){ return new CategorizedTextEditGroup(label, new GroupCategorySet(new GroupCategory(label, label, label))); } else { return new TextEditGroup(label); } }
if (edit != null) { String label= FixMessages.StringFix_RemoveNonNls_description; result.add(new CategorizedTextEditGroup(label, edit, new GroupCategorySet(new GroupCategory(label, label, label)))); for (int j= 0; j < edits.length; j++) { String label= FixMessages.StringFix_AddNonNls_description; result.add(new CategorizedTextEditGroup(label, edits[j], new GroupCategorySet(new GroupCategory(label, label, label))));
if (edit != null) { String label= FixMessages.StringFix_RemoveNonNls_description; result.add(new CategorizedTextEditGroup(label, edit, new GroupCategorySet(new GroupCategory(label, label, label)))); for (int j= 0; j < edits.length; j++) { String label= FixMessages.StringFix_AddNonNls_description; result.add(new CategorizedTextEditGroup(label, edits[j], new GroupCategorySet(new GroupCategory(label, label, label))));
if (edit != null) { String label= FixMessages.StringFix_RemoveNonNls_description; result.add(new CategorizedTextEditGroup(label, edit, new GroupCategorySet(new GroupCategory(label, label, label)))); for (int j= 0; j < edits.length; j++) { String label= FixMessages.StringFix_AddNonNls_description; result.add(new CategorizedTextEditGroup(label, edits[j], new GroupCategorySet(new GroupCategory(label, label, label))));
@Override public CompilationUnitChange createChange(IProgressMonitor progressMonitor) throws CoreException { String label= fChangeDescription; CompilationUnitChange result= new CompilationUnitChange(label, fUnit); result.setEdit(fEdit); result.addTextEditGroup(new CategorizedTextEditGroup(label, new GroupCategorySet(new GroupCategory(label, label, label)))); return result; }
@Override public CompilationUnitChange createChange(IProgressMonitor progressMonitor) throws CoreException { String label= fChangeDescription; CompilationUnitChange result= new CompilationUnitChange(label, fUnit); result.setEdit(fEdit); result.addTextEditGroup(new CategorizedTextEditGroup(label, new GroupCategorySet(new GroupCategory(label, label, label)))); return result; }
public static IFix createCleanUp(ICompilationUnit unit, boolean singleLine, boolean multiLine, boolean javaDoc, HashMap preferences) throws CoreException { if (!singleLine && !multiLine && !javaDoc) return null; String content= unit.getBuffer().getContents(); Document document= new Document(content); final List edits= format(document, singleLine, multiLine, javaDoc, preferences); if (edits.size() == 0) return null; MultiTextEdit resultEdit= new MultiTextEdit(); resultEdit.addChildren((TextEdit[])edits.toArray(new TextEdit[edits.size()])); TextChange change= new CompilationUnitChange(MultiFixMessages.CommentFormatFix_description, unit); change.setEdit(resultEdit); String label= MultiFixMessages.CommentFormatFix_description; CategorizedTextEditGroup group= new CategorizedTextEditGroup(label, new GroupCategorySet(new GroupCategory(label, label, label))); group.addTextEdit(resultEdit); change.addTextEditGroup(group); return new CommentFormatFix(change, unit); }
public static ICleanUpFix createCleanUp(CompilationUnit compilationUnit, boolean sortMembers, boolean sortFields) throws CoreException { if (!sortMembers && !sortFields) return null; ICompilationUnit cu= (ICompilationUnit)compilationUnit.getJavaElement(); String label= FixMessages.SortMembersFix_Change_description; CategorizedTextEditGroup group= new CategorizedTextEditGroup(label, new GroupCategorySet(new GroupCategory(label, label, label))); TextEdit edit= CompilationUnitSorter.sort(compilationUnit, new DefaultJavaElementComparator(!sortFields), 0, group, null); if (edit == null) return null; return new SortMembersFix(edit, cu, FixMessages.SortMembersFix_Fix_description); }
public static ICleanUpFix createCleanUp(CompilationUnit compilationUnit, boolean sortMembers, boolean sortFields) throws CoreException { if (!sortMembers && !sortFields) return null; ICompilationUnit cu= (ICompilationUnit)compilationUnit.getJavaElement(); String label= FixMessages.SortMembersFix_Change_description; CategorizedTextEditGroup group= new CategorizedTextEditGroup(label, new GroupCategorySet(new GroupCategory(label, label, label))); TextEdit edit= CompilationUnitSorter.sort(compilationUnit, new DefaultJavaElementComparator(!sortFields), 0, group, null); if (edit == null) return null; return new SortMembersFix(edit, cu, FixMessages.SortMembersFix_Fix_description); }
public TextChange createChange() throws CoreException { CompilationUnitChange result= new CompilationUnitChange(getDescription(), getCompilationUnit()); result.setEdit(edit); String label= getDescription(); result.addTextEditGroup(new CategorizedTextEditGroup(label, new GroupCategorySet(new GroupCategory(label, label, label)))); return result; }
public static IFix createCleanUp(CompilationUnit compilationUnit, boolean sortMembers, boolean sortFields) throws CoreException { if (!sortMembers && !sortFields) return null; ICompilationUnit cu= (ICompilationUnit)compilationUnit.getJavaElement(); String label= FixMessages.SortMembersFix_Change_description; CategorizedTextEditGroup group= new CategorizedTextEditGroup(label, new GroupCategorySet(new GroupCategory(label, label, label))); TextEdit edit= CompilationUnitSorter.sort(compilationUnit, new DefaultJavaElementComparator(!sortFields), 0, group, null); if (edit == null) return null; TextChange change= new CompilationUnitChange(label, cu); change.setEdit(edit); change.addTextEditGroup(group); return new SortMembersFix(change, cu); }
private static void copyChangeGroups(CompilationUnitChange target, CompilationUnitChange source) { TextEditBasedChangeGroup[] changeGroups= source.getChangeGroups(); for (int i= 0; i < changeGroups.length; i++) { TextEditGroup textEditGroup= changeGroups[i].getTextEditGroup(); TextEditGroup newGroup; if (textEditGroup instanceof CategorizedTextEditGroup) { String label= textEditGroup.getName(); newGroup= new CategorizedTextEditGroup(label, new GroupCategorySet(new GroupCategory(label, label, label))); } else { newGroup= new TextEditGroup(textEditGroup.getName()); } TextEdit[] textEdits= textEditGroup.getTextEdits(); for (int j= 0; j < textEdits.length; j++) { newGroup.addTextEdit(textEdits[j]); } target.addTextEditGroup(newGroup); } }
private static void copyChangeGroups(CompilationUnitChange target, CompilationUnitChange source) { TextEditBasedChangeGroup[] changeGroups= source.getChangeGroups(); for (int i= 0; i < changeGroups.length; i++) { TextEditGroup textEditGroup= changeGroups[i].getTextEditGroup(); TextEditGroup newGroup; if (textEditGroup instanceof CategorizedTextEditGroup) { String label= textEditGroup.getName(); newGroup= new CategorizedTextEditGroup(label, new GroupCategorySet(new GroupCategory(label, label, label))); } else { newGroup= new TextEditGroup(textEditGroup.getName()); } TextEdit[] textEdits= textEditGroup.getTextEdits(); for (int j= 0; j < textEdits.length; j++) { newGroup.addTextEdit(textEdits[j]); } target.addTextEditGroup(newGroup); } }
private static void copyChangeGroups(CompilationUnitChange target, TextChange source) { TextEditBasedChangeGroup[] changeGroups= source.getChangeGroups(); for (int i= 0; i < changeGroups.length; i++) { TextEditGroup textEditGroup= changeGroups[i].getTextEditGroup(); TextEditGroup newGroup; if (textEditGroup instanceof CategorizedTextEditGroup) { String label= textEditGroup.getName(); newGroup= new CategorizedTextEditGroup(label, new GroupCategorySet(new GroupCategory(label, label, label))); } else { newGroup= new TextEditGroup(textEditGroup.getName()); } TextEdit[] textEdits= textEditGroup.getTextEdits(); for (int j= 0; j < textEdits.length; j++) { newGroup.addTextEdit(textEdits[j]); } target.addTextEditGroup(newGroup); } }