use of org.eclipse.jdt.internal.ui.fix.ControlStatementsCleanUp in project che by eclipse.
the class QuickAssistProcessor method getRemoveBlockProposals.
private static boolean getRemoveBlockProposals(IInvocationContext context, ASTNode coveringNode, Collection<ICommandAccess> resultingCollections) {
IProposableFix[] fixes = ControlStatementsFix.createRemoveBlockFix(context.getASTRoot(), coveringNode);
if (fixes != null) {
if (resultingCollections == null) {
return true;
}
Map<String, String> options = new Hashtable<String, String>();
options.put(CleanUpConstants.CONTROL_STATEMENTS_USE_BLOCKS, CleanUpOptions.TRUE);
options.put(CleanUpConstants.CONTROL_STATMENTS_USE_BLOCKS_NEVER, CleanUpOptions.TRUE);
ICleanUp cleanUp = new ControlStatementsCleanUp(options);
for (int i = 0; i < fixes.length; i++) {
IProposableFix fix = fixes[i];
Image image = JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
FixCorrectionProposal proposal = new FixCorrectionProposal(fix, cleanUp, IProposalRelevance.REMOVE_BLOCK_FIX, image, context);
resultingCollections.add(proposal);
}
return true;
}
return false;
}
Aggregations