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;
21 * Proposal to change the letter case of a word.
25 public class ChangeCaseProposal extends WordCorrectionProposal {
28 * Creates a new change case proposal.
31 * The problem arguments associated with the spelling problem
33 * The offset in the document where to apply the proposal
35 * The lenght in the document to apply the proposal
37 * The invocation context for this proposal
39 * The locale to use for the case change
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);
46 * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getDisplayString()
48 public String getDisplayString() {
49 return PHPUIMessages.getString("Spelling.case.label"); //$NON-NLS-1$