private Map<String, String> getRequiredOptions() { Map<String, String> result= new Hashtable<>(); if (isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS) || isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS)) result.put(JavaCore.COMPILER_PB_NON_NLS_STRING_LITERAL, JavaCore.WARNING); return result; }
private Map<String, String> getRequiredOptions() { Map<String, String> result= new Hashtable<>(); if (isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS) || isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS)) result.put(JavaCore.COMPILER_PB_NON_NLS_STRING_LITERAL, JavaCore.WARNING); return result; }
/** * {@inheritDoc} * @throws CoreException */ public boolean canFix(CompilationUnit compilationUnit, IProblemLocation problem) throws CoreException { return StringFix.createFix(compilationUnit, problem, isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS), isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS)) != null; }
@Override protected ICleanUpFix createFix(CompilationUnit compilationUnit, IProblemLocation[] problems) throws CoreException { if (compilationUnit == null) return null; return StringFix.createCleanUp(compilationUnit, problems, isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS), isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS)); }
/** * {@inheritDoc} */ public IFix createFix(CompilationUnit compilationUnit, IProblemLocation[] problems) throws CoreException { if (compilationUnit == null) return null; return StringFix.createCleanUp(compilationUnit, problems, isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS), isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS)); }
@Override protected ICleanUpFix createFix(CompilationUnit compilationUnit, IProblemLocation[] problems) throws CoreException { if (compilationUnit == null) return null; return StringFix.createCleanUp(compilationUnit, problems, isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS), isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS)); }
@Override public String[] getStepDescriptions() { List<String> result= new ArrayList<>(); if (isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS)) result.add(MultiFixMessages.StringMultiFix_AddMissingNonNls_description); if (isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS)) result.add(MultiFixMessages.StringMultiFix_RemoveUnnecessaryNonNls_description); return result.toArray(new String[result.size()]); }
@Override public String[] getStepDescriptions() { List<String> result= new ArrayList<>(); if (isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS)) result.add(MultiFixMessages.StringMultiFix_AddMissingNonNls_description); if (isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS)) result.add(MultiFixMessages.StringMultiFix_RemoveUnnecessaryNonNls_description); return result.toArray(new String[result.size()]); }
/** * {@inheritDoc} */ public String[] getDescriptions() { List result= new ArrayList(); if (isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS)) result.add(MultiFixMessages.StringMultiFix_AddMissingNonNls_description); if (isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS)) result.add(MultiFixMessages.StringMultiFix_RemoveUnnecessaryNonNls_description); return (String[])result.toArray(new String[result.size()]); }
@Override public String getPreview() { StringBuilder buf= new StringBuilder(); if (isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS)) { buf.append("public String s;"); //$NON-NLS-1$ } else { buf.append("public String s; //$NON-NLS-1$"); //$NON-NLS-1$ } return buf.toString(); }
/** * {@inheritDoc} */ public String getPreview() { StringBuffer buf= new StringBuffer(); if (isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS)) { buf.append("public String s;"); //$NON-NLS-1$ } else { buf.append("public String s; //$NON-NLS-1$"); //$NON-NLS-1$ } return buf.toString(); }
@Override public String getPreview() { StringBuffer buf= new StringBuffer(); if (isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS)) { buf.append("public String s;"); //$NON-NLS-1$ } else { buf.append("public String s; //$NON-NLS-1$"); //$NON-NLS-1$ } return buf.toString(); }
@Override public boolean canFix(ICompilationUnit compilationUnit, IProblemLocation problem) { if (problem.getProblemId() == IProblem.UnnecessaryNLSTag) return isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS); if (problem.getProblemId() == IProblem.NonExternalizedStringLiteral) return isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS); return false; }
@Override public boolean canFix(ICompilationUnit compilationUnit, IProblemLocation problem) { if (problem.getProblemId() == IProblem.UnnecessaryNLSTag) return isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS); if (problem.getProblemId() == IProblem.NonExternalizedStringLiteral) return isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS); return false; }