Search in sources :

Example 1 with StringCleanUp

use of org.eclipse.jdt.internal.ui.fix.StringCleanUp in project che by eclipse.

the class LocalCorrectionsSubProcessor method getUnnecessaryNLSTagProposals.

public static void getUnnecessaryNLSTagProposals(IInvocationContext context, IProblemLocation problem, Collection<ICommandAccess> proposals) throws CoreException {
    IProposableFix fix = StringFix.createFix(context.getASTRoot(), problem, true, false);
    if (fix != null) {
        //JavaPlugin.getDefault().getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
        Image image = JavaPluginImages.get(JavaPluginImages.IMG_TOOL_DELETE);
        Map<String, String> options = new Hashtable<String, String>();
        options.put(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS, CleanUpOptions.TRUE);
        FixCorrectionProposal proposal = new FixCorrectionProposal(fix, new StringCleanUp(options), IProposalRelevance.UNNECESSARY_NLS_TAG, image, context);
        proposal.setCommandId(REMOVE_UNNECESSARY_NLS_TAG_ID);
        proposals.add(proposal);
    }
}
Also used : FixCorrectionProposal(org.eclipse.jdt.internal.ui.text.correction.proposals.FixCorrectionProposal) Hashtable(java.util.Hashtable) StringCleanUp(org.eclipse.jdt.internal.ui.fix.StringCleanUp) IProposableFix(org.eclipse.jdt.internal.corext.fix.IProposableFix) Image(org.eclipse.swt.graphics.Image)

Aggregations

Hashtable (java.util.Hashtable)1 IProposableFix (org.eclipse.jdt.internal.corext.fix.IProposableFix)1 StringCleanUp (org.eclipse.jdt.internal.ui.fix.StringCleanUp)1 FixCorrectionProposal (org.eclipse.jdt.internal.ui.text.correction.proposals.FixCorrectionProposal)1 Image (org.eclipse.swt.graphics.Image)1