Changeset 1245

Show
Ignore:
Timestamp:
08/23/08 20:16:34 (5 months ago)
Author:
asterite
Message:

A little toy: quick fix for illegal C style cast :-)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/descent.ui/src/descent/internal/ui/text/correction/CorrectionMessages.java

    r429 r1245  
    4040    public static String CorrectPackageDeclarationProposal_change_description; 
    4141    public static String JavaCorrectionProcessor_addquote_description; 
     42    public static String JavaCorrectionProcessor_addcast_description; 
    4243    public static String ChangeCorrectionProposal_error_title; 
    4344    public static String ChangeCorrectionProposal_error_message; 
  • trunk/descent.ui/src/descent/internal/ui/text/correction/CorrectionMessages.properties

    r429 r1245  
    5151 
    5252JavaCorrectionProcessor_addquote_description=Insert missing quote 
     53JavaCorrectionProcessor_addcast_description=Insert correct cast 
    5354 
    5455ChangeCorrectionProposal_error_title=Quick Fix 
  • trunk/descent.ui/src/descent/internal/ui/text/correction/QuickFixProcessor.java

    r1176 r1245  
    2424        switch (problemId) { 
    2525            case IProblem.UnterminatedStringConstant: 
     26            case IProblem.CStyleCastIllegal: 
    2627                return true; 
    2728            default: 
     
    7677                proposals.add(new ReplaceCorrectionProposal(quoteLabel, context.getCompilationUnit(), pos, 0, "\"", 0)); //$NON-NLS-1$ 
    7778                break; 
     79            case IProblem.CStyleCastIllegal: 
     80                String castLabel= CorrectionMessages.JavaCorrectionProcessor_addcast_description; 
     81                pos= problem.getOffset(); 
     82                proposals.add(new ReplaceCorrectionProposal(castLabel, context.getCompilationUnit(), pos, 0, "cast", 0)); //$NON-NLS-1$ 
     83                break; 
    7884            default: 
    7985        }