fix #774 infinite loop in net.sourceforge.phpeclipse.builder.IdentifierIndexManager...
[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  * Proposal to change the letter case of a word.
21  * 
22  * @since 3.0
23  */
24 public class ChangeCaseProposal extends WordCorrectionProposal {
25
26         /**
27          * Creates a new change case proposal.
28          * 
29          * @param arguments
30          *            The problem arguments associated with the spelling problem
31          * @param offset
32          *            The offset in the document where to apply the proposal
33          * @param length
34          *            The lenght in the document to apply the proposal
35          * @param context
36          *            The invocation context for this proposal
37          * @param locale
38          *            The locale to use for the case change
39          */
40         public ChangeCaseProposal(final String[] arguments, final int offset,
41                         final int length, final IInvocationContext context,
42                         final Locale locale) {
43                 super(Character.isLowerCase(arguments[0].charAt(0)) ? Character
44                                 .toUpperCase(arguments[0].charAt(0))
45                                 + arguments[0].substring(1) : arguments[0], arguments, offset,
46                                 length, context, Integer.MAX_VALUE);
47         }
48
49         /*
50          * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getDisplayString()
51          */
52         public String getDisplayString() {
53                 return PHPUIMessages.getString("Spelling.case.label"); //$NON-NLS-1$
54         }
55 }