RC2 compatibility
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / ui / text / spelling / ChangeCaseProposal.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11
12 package net.sourceforge.phpdt.internal.ui.text.spelling;
13
14 import java.util.Locale;
15
16 import net.sourceforge.phpdt.internal.ui.PHPUIMessages;
17 import net.sourceforge.phpdt.internal.ui.text.java.IInvocationContext;
18  
19
20 /**
21  * Proposal to change the letter case of a word.
22  * 
23  * @since 3.0
24  */
25 public class ChangeCaseProposal extends WordCorrectionProposal {
26
27         /**
28          * Creates a new change case proposal.
29          * 
30          * @param arguments
31          *                   The problem arguments associated with the spelling problem
32          * @param offset
33          *                   The offset in the document where to apply the proposal
34          * @param length
35          *                   The lenght in the document to apply the proposal
36          * @param context
37          *                   The invocation context for this proposal
38          * @param locale
39          *                   The locale to use for the case change
40          */
41         public ChangeCaseProposal(final String[] arguments, final int offset, final int length, final IInvocationContext context, final Locale locale) {
42                 super(Character.isLowerCase(arguments[0].charAt(0)) ? Character.toUpperCase(arguments[0].charAt(0)) + arguments[0].substring(1) : arguments[0], arguments, offset, length, context, Integer.MAX_VALUE);
43         }
44
45         /*
46          * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getDisplayString()
47          */
48         public String getDisplayString() {
49                 return PHPUIMessages.getString("Spelling.case.label"); //$NON-NLS-1$
50         }
51 }