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
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
12 package net.sourceforge.phpdt.internal.ui.text.spelling;
14 import java.util.Locale;
16 import net.sourceforge.phpdt.internal.ui.PHPUIMessages;
17 import net.sourceforge.phpdt.internal.ui.text.java.IInvocationContext;
20 * Proposal to change the letter case of a word.
24 public class ChangeCaseProposal extends WordCorrectionProposal {
27 * Creates a new change case proposal.
30 * The problem arguments associated with the spelling problem
32 * The offset in the document where to apply the proposal
34 * The lenght in the document to apply the proposal
36 * The invocation context for this proposal
38 * The locale to use for the case change
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);
50 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getDisplayString()
52 public String getDisplayString() {
53 return PHPUIMessages.getString("Spelling.case.label"); //$NON-NLS-1$