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); } }
public FilterAction(FilterDropDownAction owner, GroupCategory category) { super(category.getName(), IAction.AS_RADIO_BUTTON); setToolTipText(category.getDescription()); fOwner= owner; fGroupCategory= category; }
groupFilterMessage= Messages.format(RefactoringUIMessages.PreviewWizardPage_changes_filter_category, groupCategory.getName());
protected TextEditGroup createTextEditGroup(String label, CompilationUnitRewrite rewrite) { if (label.length() > 0) { return rewrite.createCategorizedGroupDescription(label, new GroupCategorySet(new GroupCategory(label, label, label))); } else { return rewrite.createGroupDescription(label); } }
protected TextEditGroup createTextEditGroup(String label, CompilationUnitRewrite rewrite) { if (label.length() > 0) { return rewrite.createCategorizedGroupDescription(label, new GroupCategorySet(new GroupCategory(label, label, label))); } else { return rewrite.createGroupDescription(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 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; }
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))));
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); }
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))));
protected static final GroupCategorySet SET_SUPER_TYPE= new GroupCategorySet(new GroupCategory("org.eclipse.jdt.internal.corext.superType", //$NON-NLS-1$ RefactoringCoreMessages.SuperTypeRefactoringProcessor_category_name, RefactoringCoreMessages.SuperTypeRefactoringProcessor_category_description));
protected static final GroupCategorySet SET_SUPER_TYPE= new GroupCategorySet(new GroupCategory("org.eclipse.jdt.internal.corext.superType", //$NON-NLS-1$ RefactoringCoreMessages.SuperTypeRefactoringProcessor_category_name, RefactoringCoreMessages.SuperTypeRefactoringProcessor_category_description));
protected static final GroupCategorySet SET_SUPER_TYPE= new GroupCategorySet(new GroupCategory("org.eclipse.jdt.internal.corext.superType", //$NON-NLS-1$ RefactoringCoreMessages.SuperTypeRefactoringProcessor_category_name, RefactoringCoreMessages.SuperTypeRefactoringProcessor_category_description));
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); }
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); } }