1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Patch For Tanya : Internationalization of Strings in the CModel

This commit is contained in:
Hoda Amer 2004-02-13 15:58:14 +00:00
parent b416d5f3b9
commit 6caa13a5b1
32 changed files with 122 additions and 97 deletions

View file

@ -1,3 +1,19 @@
2004-02-10 Tanya Wolff
Start of Fix for 51192: The defect is for all org.eclipse.cdt.core strings, but each package
should be handled by respective component owners.
These files have strings extracted; the other
changed files have only strings commented out with //$NON-NLS-1$
See defect 51192 for how these strings were extracted with the
"Find strings to externalize" wizard.
model/org.eclipse.cdt.internal.core.model/ArchiveContainer.java
model/org.eclipse.cdt.internal.core.model/BinaryContainer.java
model/org.eclipse.cdt.internal.core.model/BinaryRunner.java
model/org.eclipse.cdt.internal.core.model/CModelBuilder.java
model/org.eclipse.cdt.internal.core.model/CModelStatus.java
model/org.eclipse.cdt.internal.core.model/NullBinaryParser.java
2004-02-10 Vladimir Hirsl 2004-02-10 Vladimir Hirsl
Fix for PR# 51373: NPE when trying to instantiate a CBuildConsole with non null id Fix for PR# 51373: NPE when trying to instantiate a CBuildConsole with non null id

View file

@ -31,7 +31,7 @@ public class CoreModel {
private static CoreModel cmodel = null; private static CoreModel cmodel = null;
private static CModelManager manager = null; private static CModelManager manager = null;
public final static String CORE_MODEL_ID = CCorePlugin.PLUGIN_ID + ".coremodel"; public final static String CORE_MODEL_ID = CCorePlugin.PLUGIN_ID + ".coremodel"; //$NON-NLS-1$
/** /**
* Creates an ICElement form and IPath. * Creates an ICElement form and IPath.

View file

@ -6,7 +6,7 @@ package org.eclipse.cdt.internal.core.model;
*/ */
import java.util.Map; import java.util.Map;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.model.CModelException; import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.IArchive; import org.eclipse.cdt.core.model.IArchive;
import org.eclipse.cdt.core.model.IArchiveContainer; import org.eclipse.cdt.core.model.IArchiveContainer;
@ -17,7 +17,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
public class ArchiveContainer extends Openable implements IArchiveContainer { public class ArchiveContainer extends Openable implements IArchiveContainer {
public ArchiveContainer (CProject cProject) { public ArchiveContainer (CProject cProject) {
super (cProject, null, "Archives", CElement.C_VCONTAINER); super (cProject, null, CCorePlugin.getResourceString("CoreModel.ArchiveContainer.Archives"), CElement.C_VCONTAINER); //$NON-NLS-1$
} }
public IArchive[] getArchives() { public IArchive[] getArchives() {

View file

@ -82,7 +82,7 @@ public class Binary extends Openable implements IBinary {
cpu = ((IBinaryObject)getBinaryFile()).getCPU(); cpu = ((IBinaryObject)getBinaryFile()).getCPU();
} }
} }
return (cpu == null ? "" : cpu); return (cpu == null ? "" : cpu); //$NON-NLS-1$
} }
public String[] getNeededSharedLibs() { public String[] getNeededSharedLibs() {
@ -127,7 +127,7 @@ public class Binary extends Openable implements IBinary {
soname = ((IBinaryShared)getBinaryFile()).getSoName(); soname = ((IBinaryShared)getBinaryFile()).getSoName();
} }
} }
return (soname == null ? "" : soname); return (soname == null ? "" : soname); //$NON-NLS-1$
} }
public boolean isLittleEndian() { public boolean isLittleEndian() {

View file

@ -6,7 +6,7 @@ package org.eclipse.cdt.internal.core.model;
*/ */
import java.util.Map; import java.util.Map;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.model.CModelException; import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.IBinary; import org.eclipse.cdt.core.model.IBinary;
import org.eclipse.cdt.core.model.IBinaryContainer; import org.eclipse.cdt.core.model.IBinaryContainer;
@ -17,7 +17,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
public class BinaryContainer extends Openable implements IBinaryContainer { public class BinaryContainer extends Openable implements IBinaryContainer {
public BinaryContainer (CProject cProject) { public BinaryContainer (CProject cProject) {
super (cProject, null, "Binaries", CElement.C_VCONTAINER); super (cProject, null, CCorePlugin.getResourceString("CoreModel.BinaryContainer.Binaries"), CElement.C_VCONTAINER); //$NON-NLS-1$
} }
public IBinary[] getBinaries() { public IBinary[] getBinaries() {

View file

@ -80,7 +80,7 @@ public class BinaryElement extends CElement implements IBinaryElement, ISourceMa
throw new CModelException(e, ICModelStatusConstants.IO_EXCEPTION); throw new CModelException(e, ICModelStatusConstants.IO_EXCEPTION);
} }
} }
return ""; return ""; //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -115,7 +115,7 @@ public class BinaryElement extends CElement implements IBinaryElement, ISourceMa
} else { } else {
// TODO-model: handle non-absolute paths when finding source files // TODO-model: handle non-absolute paths when finding source files
// ??? assert() // ??? assert()
path = new Path(""); path = new Path(""); //$NON-NLS-1$
} }
// Fall back to the project sourcemapper. // Fall back to the project sourcemapper.
if (tu == null) { if (tu == null) {

View file

@ -14,6 +14,7 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceVisitor; import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.cdt.core.CCorePlugin;
public class BinaryRunner { public class BinaryRunner {
IProject project; IProject project;
@ -52,7 +53,7 @@ public class BinaryRunner {
} }
} }
}, "Binary Search Thread"); }, CCorePlugin.getResourceString("CoreModel.BinaryRunner.Binary_Search_Thread")); //$NON-NLS-1$
runner.start(); runner.start();
} }

View file

@ -21,7 +21,7 @@ public class BinaryVariable extends BinaryElement implements IVariable {
*/ */
public String getInitializer() { public String getInitializer() {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return ""; return ""; //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -29,7 +29,7 @@ public class BinaryVariable extends BinaryElement implements IVariable {
*/ */
public String getTypeName() { public String getTypeName() {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return ""; return ""; //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -215,44 +215,44 @@ public abstract class CElement extends PlatformObject implements ICElement {
} }
public String toDebugString() { public String toDebugString() {
return getElementName() + " " + getTypeString(getElementType()); return getElementName() + " " + getTypeString(getElementType()); //$NON-NLS-1$
} }
// util // util
public static String getTypeString(int type) { public static String getTypeString(int type) {
switch (type) { switch (type) {
case C_MODEL: case C_MODEL:
return "CMODEL"; return "CMODEL"; //$NON-NLS-1$
case C_PROJECT: case C_PROJECT:
return "CPROJECT"; return "CPROJECT"; //$NON-NLS-1$
case C_CCONTAINER: case C_CCONTAINER:
return "CCONTAINER"; return "CCONTAINER"; //$NON-NLS-1$
case C_UNIT: case C_UNIT:
return "TRANSLATION_UNIT"; return "TRANSLATION_UNIT"; //$NON-NLS-1$
case C_FUNCTION: case C_FUNCTION:
return "C_FUNCTION"; return "C_FUNCTION"; //$NON-NLS-1$
case C_FUNCTION_DECLARATION: case C_FUNCTION_DECLARATION:
return "C_FUNCTION_DECLARATION"; return "C_FUNCTION_DECLARATION"; //$NON-NLS-1$
case C_VARIABLE: case C_VARIABLE:
return "C_VARIABLE"; return "C_VARIABLE"; //$NON-NLS-1$
case C_VARIABLE_DECLARATION: case C_VARIABLE_DECLARATION:
return "C_VARIABLE_DECLARATION"; return "C_VARIABLE_DECLARATION"; //$NON-NLS-1$
case C_INCLUDE: case C_INCLUDE:
return "C_INCLUDE"; return "C_INCLUDE"; //$NON-NLS-1$
case C_MACRO: case C_MACRO:
return "C_MACRO"; return "C_MACRO"; //$NON-NLS-1$
case C_STRUCT: case C_STRUCT:
return "C_STRUCT"; return "C_STRUCT"; //$NON-NLS-1$
case C_CLASS: case C_CLASS:
return "C_CLASS"; return "C_CLASS"; //$NON-NLS-1$
case C_UNION: case C_UNION:
return "C_UNION"; return "C_UNION"; //$NON-NLS-1$
case C_FIELD: case C_FIELD:
return "C_FIELD"; return "C_FIELD"; //$NON-NLS-1$
case C_METHOD: case C_METHOD:
return "C_METHOD"; return "C_METHOD"; //$NON-NLS-1$
default: default:
return "UNKNOWN"; return "UNKNOWN"; //$NON-NLS-1$
} }
} }

View file

@ -78,7 +78,7 @@ public class CModelBuilder {
{ {
IProject currentProject = null; IProject currentProject = null;
boolean hasCppNature = true; boolean hasCppNature = true;
String code = ""; String code = ""; //$NON-NLS-1$
// get the current project // get the current project
if (translationUnit != null && translationUnit.getCProject() != null) { if (translationUnit != null && translationUnit.getCProject() != null) {
@ -137,11 +137,11 @@ public class CModelBuilder {
} }
catch( ParserFactoryError pfe ) catch( ParserFactoryError pfe )
{ {
throw new ParserException( "Parser/Scanner construction failure."); throw new ParserException( CCorePlugin.getResourceString("CModelBuilder.Parser_Construction_Failure")); //$NON-NLS-1$
} }
// call parse // call parse
if( ! parser.parse() && throwExceptionOnError ) if( ! parser.parse() && throwExceptionOnError )
throw new ParserException("Parse failure"); throw new ParserException(CCorePlugin.getResourceString("CModelBuilder.Parse_Failure")); //$NON-NLS-1$
return quickParseCallback.getCompilationUnit(); return quickParseCallback.getCompilationUnit();
} }
@ -154,7 +154,7 @@ public class CModelBuilder {
catch( ParserException e ) catch( ParserException e )
{ {
Util.debugLog( "Parse Exception in CModelBuilder", IDebugLogConstants.MODEL ); Util.debugLog( "Parse Exception in CModelBuilder", IDebugLogConstants.MODEL ); //$NON-NLS-1$
//e.printStackTrace(); //e.printStackTrace();
} }
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
@ -164,7 +164,7 @@ public class CModelBuilder {
} }
catch( NullPointerException npe ) catch( NullPointerException npe )
{ {
Util.debugLog( "NullPointer exception in CModelBuilder", IDebugLogConstants.MODEL); Util.debugLog( "NullPointer exception in CModelBuilder", IDebugLogConstants.MODEL); //$NON-NLS-1$
//npe.printStackTrace(); //npe.printStackTrace();
} }
@ -343,7 +343,7 @@ public class CModelBuilder {
private Namespace createNamespace(Parent parent, IASTNamespaceDefinition nsDef){ private Namespace createNamespace(Parent parent, IASTNamespaceDefinition nsDef){
// create element // create element
String type = "namespace"; String type = "namespace"; //$NON-NLS-1$
String nsName = (nsDef.getName() == null ) String nsName = (nsDef.getName() == null )
? "" ? ""
: nsDef.getName().toString(); : nsDef.getName().toString();
@ -362,7 +362,7 @@ public class CModelBuilder {
private Enumeration createEnumeration(Parent parent, IASTEnumerationSpecifier enumSpecifier){ private Enumeration createEnumeration(Parent parent, IASTEnumerationSpecifier enumSpecifier){
// create element // create element
String type = "enum"; String type = "enum"; //$NON-NLS-1$
String enumName = (enumSpecifier.getName() == null ) String enumName = (enumSpecifier.getName() == null )
? "" ? ""
: enumSpecifier.getName().toString(); : enumSpecifier.getName().toString();
@ -407,8 +407,8 @@ public class CModelBuilder {
private Structure createClass(Parent parent, IASTClassSpecifier classSpecifier, boolean isTemplate){ private Structure createClass(Parent parent, IASTClassSpecifier classSpecifier, boolean isTemplate){
// create element // create element
String className = ""; String className = ""; //$NON-NLS-1$
String type = ""; String type = ""; //$NON-NLS-1$
int kind = ICElement.C_CLASS; int kind = ICElement.C_CLASS;
ASTClassKind classkind = classSpecifier.getClassKind(); ASTClassKind classkind = classSpecifier.getClassKind();
if(classkind == ASTClassKind.CLASS){ if(classkind == ASTClassKind.CLASS){
@ -416,7 +416,7 @@ public class CModelBuilder {
kind = ICElement.C_CLASS; kind = ICElement.C_CLASS;
else else
kind = ICElement.C_TEMPLATE_CLASS; kind = ICElement.C_TEMPLATE_CLASS;
type = "class"; type = "class"; //$NON-NLS-1$
className = (classSpecifier.getName() == null ) className = (classSpecifier.getName() == null )
? "" ? ""
: classSpecifier.getName().toString(); : classSpecifier.getName().toString();
@ -426,7 +426,7 @@ public class CModelBuilder {
kind = ICElement.C_STRUCT; kind = ICElement.C_STRUCT;
else else
kind = ICElement.C_TEMPLATE_STRUCT; kind = ICElement.C_TEMPLATE_STRUCT;
type = "struct"; type = "struct"; //$NON-NLS-1$
className = (classSpecifier.getName() == null ) className = (classSpecifier.getName() == null )
? "" ? ""
: classSpecifier.getName().toString(); : classSpecifier.getName().toString();
@ -436,7 +436,7 @@ public class CModelBuilder {
kind = ICElement.C_UNION; kind = ICElement.C_UNION;
else else
kind = ICElement.C_TEMPLATE_UNION; kind = ICElement.C_TEMPLATE_UNION;
type = "union"; type = "union"; //$NON-NLS-1$
className = (classSpecifier.getName() == null ) className = (classSpecifier.getName() == null )
? "" ? ""
: classSpecifier.getName().toString(); : classSpecifier.getName().toString();

View file

@ -111,9 +111,9 @@ public class CModelManager implements IResourceChangeListener {
*/ */
private HashMap sourceMappers = new HashMap(); private HashMap sourceMappers = new HashMap();
public static final String [] sourceExtensions = {"c", "cxx", "cc", "C", "cpp"}; public static final String [] sourceExtensions = {"c", "cxx", "cc", "C", "cpp"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
public static final String [] headerExtensions = {"h", "hh", "hpp", "H"}; public static final String [] headerExtensions = {"h", "hh", "hpp", "H"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
public static final IWorkingCopy[] NoWorkingCopy = new IWorkingCopy[0]; public static final IWorkingCopy[] NoWorkingCopy = new IWorkingCopy[0];

View file

@ -44,7 +44,7 @@ public class CModelStatus extends Status implements ICModelStatus, ICModelStatus
/** /**
* Singleton OK object * Singleton OK object
*/ */
public static final ICModelStatus VERIFIED_OK = new CModelStatus(OK, OK, org.eclipse.cdt.internal.core.Util.bind("status.OK"));; public static final ICModelStatus VERIFIED_OK = new CModelStatus(OK, OK, org.eclipse.cdt.internal.core.Util.bind("status.OK"));; //$NON-NLS-1$
/** /**
* Constructs an C model status with no corresponding elements. * Constructs an C model status with no corresponding elements.
@ -157,7 +157,7 @@ public class CModelStatus extends Status implements ICModelStatus, ICModelStatus
* Returns the message that is relevant to the code of this status. * Returns the message that is relevant to the code of this status.
*/ */
public String getMessage() { public String getMessage() {
return "Error in C Plugin"; return CCorePlugin.getResourceString("CoreModel.CModelStatus.Error_in_CPlugin"); //$NON-NLS-1$
} }
/** /**
* @see IOperationStatus * @see IOperationStatus

View file

@ -82,7 +82,7 @@ public class CPathEntry implements ICPathEntry {
switch (kind) { switch (kind) {
case ICPathEntry.CDT_PROJECT : case ICPathEntry.CDT_PROJECT :
return "prj"; return "prj"; //$NON-NLS-1$
case ICPathEntry.CDT_SOURCE : case ICPathEntry.CDT_SOURCE :
return "src"; //$NON-NLS-1$ return "src"; //$NON-NLS-1$
case ICPathEntry.CDT_LIBRARY : case ICPathEntry.CDT_LIBRARY :

View file

@ -491,7 +491,7 @@ public class CProject extends CContainer implements ICProject {
default : default :
{ {
ICModelStatus status = new CModelStatus(ICModelStatus.ERROR, "CPathEntry: unknown kind (" + kindAttr + ")"); //$NON-NLS-1$ ICModelStatus status = new CModelStatus(ICModelStatus.ERROR, "CPathEntry: unknown kind (" + kindAttr + ")"); //$NON-NLS-1$ //$NON-NLS-2$
throw new CModelException(status); throw new CModelException(status);
} }
} }

View file

@ -15,7 +15,7 @@ import org.eclipse.cdt.core.model.IEnumerator;
***********************************************************************/ ***********************************************************************/
public class Enumerator extends SourceManipulation implements IEnumerator{ public class Enumerator extends SourceManipulation implements IEnumerator{
String constantExpression = ""; String constantExpression = ""; //$NON-NLS-1$
public Enumerator(ICElement parent, String name) { public Enumerator(ICElement parent, String name) {
super(parent, name, CElement.C_ENUMERATOR); super(parent, name, CElement.C_ENUMERATOR);

View file

@ -15,7 +15,7 @@ import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
public class FieldInfo extends SourceManipulationInfo { public class FieldInfo extends SourceManipulationInfo {
String typeStr = ""; String typeStr = ""; //$NON-NLS-1$
boolean isConst = false; boolean isConst = false;
boolean isVolatile = false; boolean isVolatile = false;
boolean isMutable = false; boolean isMutable = false;

View file

@ -30,7 +30,7 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction
if (returnType != null) if (returnType != null)
return returnType; return returnType;
else else
return ""; return ""; //$NON-NLS-1$
} }
public void setReturnType(String type){ public void setReturnType(String type){
@ -53,9 +53,9 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction
StringBuffer sig = new StringBuffer(getElementName()); StringBuffer sig = new StringBuffer(getElementName());
sig.append(getParameterClause()); sig.append(getParameterClause());
if(isConst()) if(isConst())
sig.append(" const"); sig.append(" const"); //$NON-NLS-1$
if(isVolatile()) if(isVolatile())
sig.append(" volatile"); sig.append(" volatile"); //$NON-NLS-1$
return sig.toString(); return sig.toString();
} }
@ -63,24 +63,24 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction
StringBuffer sig = new StringBuffer(); StringBuffer sig = new StringBuffer();
if(getNumberOfParameters() > 0){ if(getNumberOfParameters() > 0){
sig.append("("); sig.append("("); //$NON-NLS-1$
String[] paramTypes = getParameterTypes(); String[] paramTypes = getParameterTypes();
int i = 0; int i = 0;
sig.append(paramTypes[i++]); sig.append(paramTypes[i++]);
while (i < paramTypes.length){ while (i < paramTypes.length){
sig.append(", "); sig.append(", "); //$NON-NLS-1$
sig.append(paramTypes[i++]); sig.append(paramTypes[i++]);
} }
sig.append(")"); sig.append(")"); //$NON-NLS-1$
} }
else{ else{
sig.append("()"); sig.append("()"); //$NON-NLS-1$
} }
return sig.toString(); return sig.toString();
} }
public String getParameterInitializer(int pos) { public String getParameterInitializer(int pos) {
return ""; return ""; //$NON-NLS-1$
} }
public String[] getExceptions(){ public String[] getExceptions(){

View file

@ -61,7 +61,7 @@ public class FunctionTemplate extends FunctionDeclaration implements ITemplate{
public String getTemplateSignature() { public String getTemplateSignature() {
StringBuffer sig = new StringBuffer(getElementName()); StringBuffer sig = new StringBuffer(getElementName());
if(getNumberOfTemplateParameters() > 0){ if(getNumberOfTemplateParameters() > 0){
sig.append("<"); sig.append("<"); //$NON-NLS-1$
String[] paramTypes = getTemplateParameterTypes(); String[] paramTypes = getTemplateParameterTypes();
int i = 0; int i = 0;
sig.append(paramTypes[i++]); sig.append(paramTypes[i++]);
@ -69,19 +69,19 @@ public class FunctionTemplate extends FunctionDeclaration implements ITemplate{
sig.append(", "); sig.append(", ");
sig.append(paramTypes[i++]); sig.append(paramTypes[i++]);
} }
sig.append(">"); sig.append(">"); //$NON-NLS-1$
} }
else{ else{
sig.append("<>"); sig.append("<>"); //$NON-NLS-1$
} }
sig.append(this.getParameterClause()); sig.append(this.getParameterClause());
if(isConst()) if(isConst())
sig.append(" const"); sig.append(" const"); //$NON-NLS-1$
if(isVolatile()) if(isVolatile())
sig.append(" volatile"); sig.append(" volatile"); //$NON-NLS-1$
if((this.getReturnType() != null) && (this.getReturnType().length() > 0)){ if((this.getReturnType() != null) && (this.getReturnType().length() > 0)){
sig.append(" : "); sig.append(" : "); //$NON-NLS-1$
sig.append(this.getReturnType()); sig.append(this.getReturnType());
} }

View file

@ -15,11 +15,11 @@ public class Macro extends SourceManipulation implements IMacro {
} }
public String getIdentifierList() { public String getIdentifierList() {
return ""; return ""; //$NON-NLS-1$
} }
public String getTokenSequence() { public String getTokenSequence() {
return ""; return ""; //$NON-NLS-1$
} }
protected CElementInfo createElementInfo () { protected CElementInfo createElementInfo () {

View file

@ -38,7 +38,7 @@ public class MethodDeclaration extends FunctionDeclaration implements IMethodDec
public boolean isDestructor() { public boolean isDestructor() {
// is not implemented in the parser's quick mode // is not implemented in the parser's quick mode
//return isDestructor; //return isDestructor;
return getElementName().startsWith("~"); return getElementName().startsWith("~"); //$NON-NLS-1$
} }
public void setConstructor(boolean isConstructor) { public void setConstructor(boolean isConstructor) {
@ -50,7 +50,7 @@ public class MethodDeclaration extends FunctionDeclaration implements IMethodDec
} }
public boolean isOperator(){ public boolean isOperator(){
return getElementName().startsWith("operator"); return getElementName().startsWith("operator"); //$NON-NLS-1$
} }
public boolean isPureVirtual(){ public boolean isPureVirtual(){

View file

@ -62,27 +62,27 @@ public class MethodTemplate extends MethodDeclaration implements ITemplate{
public String getTemplateSignature() { public String getTemplateSignature() {
StringBuffer sig = new StringBuffer(getElementName()); StringBuffer sig = new StringBuffer(getElementName());
if(getNumberOfTemplateParameters() > 0){ if(getNumberOfTemplateParameters() > 0){
sig.append("<"); sig.append("<"); //$NON-NLS-1$
String[] paramTypes = getTemplateParameterTypes(); String[] paramTypes = getTemplateParameterTypes();
int i = 0; int i = 0;
sig.append(paramTypes[i++]); sig.append(paramTypes[i++]);
while (i < paramTypes.length){ while (i < paramTypes.length){
sig.append(", "); sig.append(", "); //$NON-NLS-1$
sig.append(paramTypes[i++]); sig.append(paramTypes[i++]);
} }
sig.append(">"); sig.append(">"); //$NON-NLS-1$
} }
else{ else{
sig.append("<>"); sig.append("<>"); //$NON-NLS-1$
} }
sig.append(this.getParameterClause()); sig.append(this.getParameterClause());
if(isConst()) if(isConst())
sig.append(" const"); sig.append(" const"); //$NON-NLS-1$
if(isVolatile()) if(isVolatile())
sig.append(" volatile"); sig.append(" volatile"); //$NON-NLS-1$
if((this.getReturnType() != null) && (this.getReturnType().length() > 0)){ if((this.getReturnType() != null) && (this.getReturnType().length() > 0)){
sig.append(" : "); sig.append(" : "); //$NON-NLS-1$
sig.append(this.getReturnType()); sig.append(this.getReturnType());
} }

View file

@ -16,7 +16,7 @@ import org.eclipse.cdt.core.model.INamespace;
public class Namespace extends SourceManipulation implements INamespace{ public class Namespace extends SourceManipulation implements INamespace{
String typeName = ""; String typeName = ""; //$NON-NLS-1$
public Namespace(ICElement parent, String name) { public Namespace(ICElement parent, String name) {
super(parent, name, CElement.C_NAMESPACE); super(parent, name, CElement.C_NAMESPACE);
} }

View file

@ -6,7 +6,7 @@ package org.eclipse.cdt.internal.core.model;
*/ */
import java.io.IOException; import java.io.IOException;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.IBinaryParser; import org.eclipse.cdt.core.IBinaryParser;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
@ -18,14 +18,14 @@ public class NullBinaryParser implements IBinaryParser {
* @see org.eclipse.cdt.core.IBinaryParser#getBinary(org.eclipse.core.runtime.IPath) * @see org.eclipse.cdt.core.IBinaryParser#getBinary(org.eclipse.core.runtime.IPath)
*/ */
public IBinaryFile getBinary(IPath path) throws IOException { public IBinaryFile getBinary(IPath path) throws IOException {
throw new IOException("not a binary file"); throw new IOException(CCorePlugin.getResourceString("CoreModel.NullBinaryParser.Not_binary_file")); //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.IBinaryParser#getFormat() * @see org.eclipse.cdt.core.IBinaryParser#getFormat()
*/ */
public String getFormat() { public String getFormat() {
return "Null Format"; return CCorePlugin.getResourceString("CoreModel.NullBinaryParser.Null_Format"); //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -56,7 +56,7 @@ class SourceManipulationInfo extends CElementInfo {
throw new CModelException(e, ICModelStatusConstants.IO_EXCEPTION); throw new CModelException(e, ICModelStatusConstants.IO_EXCEPTION);
} }
} }
return ""; return ""; //$NON-NLS-1$
} }
/** /**

View file

@ -18,11 +18,11 @@ public class StructureInfo extends VariableInfo {
super(element); super(element);
if (element.getElementType() == ICElement.C_CLASS) if (element.getElementType() == ICElement.C_CLASS)
this.setTypeName("class"); this.setTypeName("class"); //$NON-NLS-1$
else if (element.getElementType() == ICElement.C_UNION) else if (element.getElementType() == ICElement.C_UNION)
this.setTypeName("union"); this.setTypeName("union"); //$NON-NLS-1$
else else
this.setTypeName("struct"); this.setTypeName("struct"); //$NON-NLS-1$
} }
public boolean isUnion() { public boolean isUnion() {

View file

@ -52,18 +52,18 @@ public class StructureTemplate extends Structure implements ITemplate{
public String getTemplateSignature() { public String getTemplateSignature() {
StringBuffer sig = new StringBuffer(getElementName()); StringBuffer sig = new StringBuffer(getElementName());
if(getNumberOfTemplateParameters() > 0){ if(getNumberOfTemplateParameters() > 0){
sig.append("<"); sig.append("<"); //$NON-NLS-1$
String[] paramTypes = getTemplateParameterTypes(); String[] paramTypes = getTemplateParameterTypes();
int i = 0; int i = 0;
sig.append(paramTypes[i++]); sig.append(paramTypes[i++]);
while (i < paramTypes.length){ while (i < paramTypes.length){
sig.append(", "); sig.append(", "); //$NON-NLS-1$
sig.append(paramTypes[i++]); sig.append(paramTypes[i++]);
} }
sig.append(">"); sig.append(">"); //$NON-NLS-1$
} }
else{ else{
sig.append("<>"); sig.append("<>"); //$NON-NLS-1$
} }
return sig.toString(); return sig.toString();
} }

View file

@ -16,7 +16,7 @@ import org.eclipse.cdt.core.model.ITypeDef;
public class TypeDef extends SourceManipulation implements ITypeDef{ public class TypeDef extends SourceManipulation implements ITypeDef{
String typeName= ""; String typeName= ""; //$NON-NLS-1$
public TypeDef(ICElement parent, String name) { public TypeDef(ICElement parent, String name) {
super(parent, name, CElement.C_TYPEDEF); super(parent, name, CElement.C_TYPEDEF);
} }

View file

@ -193,13 +193,13 @@ public class Util implements ICLogConstants {
if ( CCorePlugin.getDefault().isDebugging() && isActive(client)) { if ( CCorePlugin.getDefault().isDebugging() && isActive(client)) {
// Time stamp // Time stamp
if(addTimeStamp) if(addTimeStamp)
message = MessageFormat.format( "[{0}] {1}", new Object[] { new Long( System.currentTimeMillis() ), message } ); message = MessageFormat.format( "[{0}] {1}", new Object[] { new Long( System.currentTimeMillis() ), message } ); //$NON-NLS-1$
while (message.length() > 100) { while (message.length() > 100) {
String partial = message.substring(0, 100); String partial = message.substring(0, 100);
message = message.substring(100); message = message.substring(100);
System.out.println(partial + "\\"); System.out.println(partial + "\\"); //$NON-NLS-1$
} }
if (message.endsWith("\n")) { if (message.endsWith("\n")) { //$NON-NLS-1$
System.err.print(message); System.err.print(message);
} else { } else {
System.out.println(message); System.out.println(message);

View file

@ -19,7 +19,7 @@ public class Variable extends VariableDeclaration implements IVariable {
} }
public String getInitializer() { public String getInitializer() {
return ""; return ""; //$NON-NLS-1$
} }
} }

View file

@ -7,7 +7,7 @@ package org.eclipse.cdt.internal.core.model;
class VariableInfo extends SourceManipulationInfo { class VariableInfo extends SourceManipulationInfo {
String typeStr = ""; String typeStr = ""; //$NON-NLS-1$
boolean isConst = false; boolean isConst = false;
boolean isVolatile = false; boolean isVolatile = false;
boolean isStatic = false; boolean isStatic = false;

View file

@ -49,21 +49,21 @@ public class VariableTemplate extends Variable implements ITemplate {
public String getTemplateSignature() { public String getTemplateSignature() {
StringBuffer sig = new StringBuffer(getElementName()); StringBuffer sig = new StringBuffer(getElementName());
if(getNumberOfTemplateParameters() > 0){ if(getNumberOfTemplateParameters() > 0){
sig.append("<"); sig.append("<"); //$NON-NLS-1$
String[] paramTypes = getTemplateParameterTypes(); String[] paramTypes = getTemplateParameterTypes();
int i = 0; int i = 0;
sig.append(paramTypes[i++]); sig.append(paramTypes[i++]);
while (i < paramTypes.length){ while (i < paramTypes.length){
sig.append(", "); sig.append(", "); //$NON-NLS-1$
sig.append(paramTypes[i++]); sig.append(paramTypes[i++]);
} }
sig.append(">"); sig.append(">"); //$NON-NLS-1$
} }
else{ else{
sig.append("<>"); sig.append("<>"); //$NON-NLS-1$
} }
sig.append(" : "); sig.append(" : "); //$NON-NLS-1$
sig.append(this.getTypeName()); sig.append(this.getTypeName());
return sig.toString(); return sig.toString();

View file

@ -5,3 +5,11 @@
# #
################################################ ################################################
CBuilder.build_error= Build Error CBuilder.build_error= Build Error
CoreModel.BinaryRunner.Binary_Search_Thread=Binary Search Thread
CoreModel.CModelBuilder.Parser_Construction_Failure=Parser/Scanner construction failure.
CoreModel.CModelBuilder.Parse_Failure=Parse failure
CoreModel.ArchiveContainer.Archives=Archives
CoreModel.BinaryContainer.Binaries=Binaries
CoreModel.CModelStatus.Error_in_CPlugin=Error in C Plugin
CoreModel.NullBinaryParser.Not_binary_file=not a binary file
CoreModel.NullBinaryParser.Null_Format=Null Format