Search in sources :

Example 1 with UnimplementedCodeCleanUp

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

the class LocalCorrectionsSubProcessor method addUnimplementedMethodsProposals.

public static void addUnimplementedMethodsProposals(IInvocationContext context, IProblemLocation problem, Collection<ICommandAccess> proposals) {
    IProposableFix addMethodFix = UnimplementedCodeFix.createAddUnimplementedMethodsFix(context.getASTRoot(), problem);
    if (addMethodFix != null) {
        Image image = JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
        Map<String, String> settings = new Hashtable<String, String>();
        settings.put(CleanUpConstants.ADD_MISSING_METHODES, CleanUpOptions.TRUE);
        ICleanUp cleanUp = new UnimplementedCodeCleanUp(settings);
        proposals.add(new FixCorrectionProposal(addMethodFix, cleanUp, IProposalRelevance.ADD_UNIMPLEMENTED_METHODS, image, context));
    }
    IProposableFix makeAbstractFix = UnimplementedCodeFix.createMakeTypeAbstractFix(context.getASTRoot(), problem);
    if (makeAbstractFix != null) {
        Image image = JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
        Map<String, String> settings = new Hashtable<String, String>();
        settings.put(UnimplementedCodeCleanUp.MAKE_TYPE_ABSTRACT, CleanUpOptions.TRUE);
        ICleanUp cleanUp = new UnimplementedCodeCleanUp(settings);
        proposals.add(new FixCorrectionProposal(makeAbstractFix, cleanUp, IProposalRelevance.MAKE_TYPE_ABSTRACT, image, context));
    }
}
Also used : FixCorrectionProposal(org.eclipse.jdt.internal.ui.text.correction.proposals.FixCorrectionProposal) ICleanUp(org.eclipse.jdt.ui.cleanup.ICleanUp) Hashtable(java.util.Hashtable) IProposableFix(org.eclipse.jdt.internal.corext.fix.IProposableFix) UnimplementedCodeCleanUp(org.eclipse.jdt.internal.ui.fix.UnimplementedCodeCleanUp) Image(org.eclipse.swt.graphics.Image)

Aggregations

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