mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Externalized strings
This commit is contained in:
parent
208b649f76
commit
4e0a4b9171
3 changed files with 35 additions and 12 deletions
|
@ -0,0 +1,29 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2009,2010 Alena Laskavaia
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Alena Laskavaia - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.codan.internal.checkers;
|
||||
|
||||
import org.eclipse.osgi.util.NLS;
|
||||
|
||||
/**
|
||||
* Messages
|
||||
*/
|
||||
public class CheckersMessages extends NLS {
|
||||
private static final String BUNDLE_NAME = "org.eclipse.cdt.codan.internal.checkers.messages"; //$NON-NLS-1$
|
||||
public static String NamingConventionFunctionChecker_LabelNamePattern;
|
||||
public static String ReturnChecker_Param0;
|
||||
static {
|
||||
// initialize resource bundle
|
||||
NLS.initializeMessages(BUNDLE_NAME, CheckersMessages.class);
|
||||
}
|
||||
|
||||
private CheckersMessages() {
|
||||
}
|
||||
}
|
|
@ -11,12 +11,12 @@
|
|||
package org.eclipse.cdt.codan.internal.checkers;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.eclipse.cdt.codan.core.cxx.model.AbstractIndexAstChecker;
|
||||
import org.eclipse.cdt.codan.core.model.AbstractProblemParameterInfo;
|
||||
import org.eclipse.cdt.codan.core.model.ICheckerWithParameters;
|
||||
import org.eclipse.cdt.codan.core.model.IProblem;
|
||||
import org.eclipse.cdt.codan.core.model.IProblemParameterInfo;
|
||||
import org.eclipse.cdt.codan.core.model.IProblemWorkingCopy;
|
||||
import org.eclipse.cdt.codan.core.param.SingleParameterInfo;
|
||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
|
||||
|
@ -69,16 +69,8 @@ public class NamingConventionFunctionChecker extends AbstractIndexAstChecker
|
|||
* (org.eclipse.cdt.codan.core.model.IProblemWorkingCopy)
|
||||
*/
|
||||
public void initParameters(IProblemWorkingCopy problem) {
|
||||
IProblemParameterInfo info = new AbstractProblemParameterInfo() {
|
||||
public String getLabel() {
|
||||
return "Name Pattern";
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return PARAM_KEY;
|
||||
}
|
||||
};
|
||||
problem.setParameterInfo(info);
|
||||
problem.setParameterInfo(new SingleParameterInfo(PARAM_KEY,
|
||||
CheckersMessages.NamingConventionFunctionChecker_LabelNamePattern));
|
||||
problem.setParameter(PARAM_KEY, DEFAULT_PATTERN);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
NamingConventionFunctionChecker_LabelNamePattern=Name Pattern
|
||||
ReturnChecker_Param0=Also check functions with implicit return value
|
Loading…
Add table
Reference in a new issue