@Override public String[] getStepDescriptions() { if (isEnabled(CleanUpConstants.SORT_MEMBERS)) { if (isEnabled(CleanUpConstants.SORT_MEMBERS_ALL)) { return new String[] {MultiFixMessages.SortMembersCleanUp_AllMembers_description}; } else { return new String[] {MultiFixMessages.SortMembersCleanUp_Excluding_description}; } } return null; }
@Override public String[] getStepDescriptions() { if (isEnabled(CleanUpConstants.SORT_MEMBERS)) { if (isEnabled(CleanUpConstants.SORT_MEMBERS_ALL)) { return new String[] {MultiFixMessages.SortMembersCleanUp_AllMembers_description}; } else { return new String[] {MultiFixMessages.SortMembersCleanUp_Excluding_description}; } } return null; }
/** * {@inheritDoc} */ public String[] getDescriptions() { if (isEnabled(CleanUpConstants.SORT_MEMBERS)) { if (isEnabled(CleanUpConstants.SORT_MEMBERS_ALL)) { return new String[] {MultiFixMessages.SortMembersCleanUp_AllMembers_description}; } else { return new String[] {MultiFixMessages.SortMembersCleanUp_Excluding_description}; } } return null; }
public boolean requireAST(ICompilationUnit unit) throws CoreException { return isEnabled(CleanUpConstants.SORT_MEMBERS); }
@Override public CleanUpRequirements getRequirements() { return new CleanUpRequirements(isEnabled(CleanUpConstants.SORT_MEMBERS), false, false, null); }
public String getPreview() { StringBuffer buf= new StringBuffer(); buf.append("class SortExample {\n"); //$NON-NLS-1$ if ((isEnabled(CleanUpConstants.SORT_MEMBERS) && isEnabled(CleanUpConstants.SORT_MEMBERS_ALL))) { buf.append(" private String bar;\n"); //$NON-NLS-1$ buf.append(" private String foo;\n"); //$NON-NLS-1$ } else { buf.append(" private String foo;\n"); //$NON-NLS-1$ buf.append(" private String bar;\n"); //$NON-NLS-1$ } if (isEnabled(CleanUpConstants.SORT_MEMBERS)) { buf.append(" private void bar() {}\n"); //$NON-NLS-1$ buf.append(" private void foo() {}\n"); //$NON-NLS-1$ } else { buf.append(" private void foo() {}\n"); //$NON-NLS-1$ buf.append(" private void bar() {}\n"); //$NON-NLS-1$ } buf.append("}\n"); //$NON-NLS-1$ return buf.toString(); }
@Override public CleanUpRequirements getRequirements() { return new CleanUpRequirements(isEnabled(CleanUpConstants.SORT_MEMBERS), false, false, null); }
@Override public String getPreview() { StringBuilder buf= new StringBuilder(); buf.append("class SortExample {\n"); //$NON-NLS-1$ if ((isEnabled(CleanUpConstants.SORT_MEMBERS) && isEnabled(CleanUpConstants.SORT_MEMBERS_ALL))) { buf.append(" private String bar;\n"); //$NON-NLS-1$ buf.append(" private String foo;\n"); //$NON-NLS-1$ } else { buf.append(" private String foo;\n"); //$NON-NLS-1$ buf.append(" private String bar;\n"); //$NON-NLS-1$ } if (isEnabled(CleanUpConstants.SORT_MEMBERS)) { buf.append(" private void bar() {}\n"); //$NON-NLS-1$ buf.append(" private void foo() {}\n"); //$NON-NLS-1$ } else { buf.append(" private void foo() {}\n"); //$NON-NLS-1$ buf.append(" private void bar() {}\n"); //$NON-NLS-1$ } buf.append("}\n"); //$NON-NLS-1$ return buf.toString(); }
@Override public String getPreview() { StringBuffer buf= new StringBuffer(); buf.append("class SortExample {\n"); //$NON-NLS-1$ if ((isEnabled(CleanUpConstants.SORT_MEMBERS) && isEnabled(CleanUpConstants.SORT_MEMBERS_ALL))) { buf.append(" private String bar;\n"); //$NON-NLS-1$ buf.append(" private String foo;\n"); //$NON-NLS-1$ } else { buf.append(" private String foo;\n"); //$NON-NLS-1$ buf.append(" private String bar;\n"); //$NON-NLS-1$ } if (isEnabled(CleanUpConstants.SORT_MEMBERS)) { buf.append(" private void bar() {}\n"); //$NON-NLS-1$ buf.append(" private void foo() {}\n"); //$NON-NLS-1$ } else { buf.append(" private void foo() {}\n"); //$NON-NLS-1$ buf.append(" private void bar() {}\n"); //$NON-NLS-1$ } buf.append("}\n"); //$NON-NLS-1$ return buf.toString(); }
public IFix createFix(CompilationUnit compilationUnit) throws CoreException { if (compilationUnit == null) return null; boolean sortMembers= isEnabled(CleanUpConstants.SORT_MEMBERS); IFix fix= SortMembersFix.createCleanUp(compilationUnit, sortMembers, sortMembers && isEnabled(CleanUpConstants.SORT_MEMBERS_ALL)); if (fix != null) { if (fTouchedFiles == null) { fTouchedFiles= new HashSet(); } fTouchedFiles.add(((ICompilationUnit)compilationUnit.getJavaElement()).getResource()); } return fix; }
@Override public ICleanUpFix createFix(CleanUpContext context) throws CoreException { CompilationUnit compilationUnit= context.getAST(); if (compilationUnit == null) return null; boolean sortMembers= isEnabled(CleanUpConstants.SORT_MEMBERS); ICleanUpFix fix= SortMembersFix.createCleanUp(compilationUnit, sortMembers, sortMembers && isEnabled(CleanUpConstants.SORT_MEMBERS_ALL)); if (fix != null) { if (fTouchedFiles == null) { fTouchedFiles= new HashSet<>(); } fTouchedFiles.add(((ICompilationUnit)compilationUnit.getJavaElement()).getResource()); } return fix; }
@Override public ICleanUpFix createFix(CleanUpContext context) throws CoreException { CompilationUnit compilationUnit= context.getAST(); if (compilationUnit == null) return null; boolean sortMembers= isEnabled(CleanUpConstants.SORT_MEMBERS); ICleanUpFix fix= SortMembersFix.createCleanUp(compilationUnit, sortMembers, sortMembers && isEnabled(CleanUpConstants.SORT_MEMBERS_ALL)); if (fix != null) { if (fTouchedFiles == null) { fTouchedFiles= new HashSet<>(); } fTouchedFiles.add(((ICompilationUnit)compilationUnit.getJavaElement()).getResource()); } return fix; }