1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 01:15:29 +02:00

Cleanup of Messages.properties and Messages.java files.

Change-Id: Iea47d46a3ea201722fbe666a03c89dde7e5e4961
This commit is contained in:
Sergey Prigogin 2014-08-04 11:01:19 -07:00
parent 914dc65ffb
commit 5cc7505a12
51 changed files with 263 additions and 220 deletions

View file

@ -0,0 +1,25 @@
/*******************************************************************************
* Copyright (c) 2010, 2014 Google, Inc and others.
* 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:
* Sergey Prigogin (Google) - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.templateengine;
import org.eclipse.osgi.util.NLS;
class Messages extends NLS {
public static String ProjectCreatedActions_insufficient_information;
static {
// Initialize resource bundle.
NLS.initializeMessages(Messages.class.getName(), Messages.class);
}
private Messages() {
}
}

View file

@ -0,0 +1,11 @@
###############################################################################
# Copyright (c) 2014 Google, Inc and others.
# 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:
# Sergey Prigogin (Google) - initial API and implementation
###############################################################################
ProjectCreatedActions_insufficient_information=Insufficient information to create new project

View file

@ -23,7 +23,6 @@ import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
import org.eclipse.cdt.core.templateengine.TemplateEngineMessages;
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildProperty;
import org.eclipse.cdt.managedbuilder.core.BuildException;
import org.eclipse.cdt.managedbuilder.core.IBuilder;
@ -81,7 +80,7 @@ public class ProjectCreatedActions {
*/
public IManagedBuildInfo createProject(IProgressMonitor monitor, String indexerId, boolean isCProject) throws CoreException, BuildException {
if(!areFieldsValid()) {
throw new IllegalArgumentException(TemplateEngineMessages.getString("ProjectCreatedActions.InsufficientInformation")); //$NON-NLS-1$
throw new IllegalArgumentException(Messages.ProjectCreatedActions_insufficient_information);
}
IWorkspace workspace = ResourcesPlugin.getWorkspace();

View file

@ -13,14 +13,14 @@ package org.eclipse.cdt.internal.core.natives;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.core.natives.messages"; //$NON-NLS-1$
public static String Util_exception_cannotCreatePty;
public static String Util_exception_cannotSetTerminalSize;
public static String Util_error_cannotRun;
public static String Util_exception_closeError;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
// Initialize resource bundle.
NLS.initializeMessages(Messages.class.getName(), Messages.class);
}
private Messages() {

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<component id="org.eclipse.cdt.core" version="2">
<resource path="src/org/eclipse/cdt/core/resources/Messages.java" type="org.eclipse.cdt.core.resources.Messages">
<filter id="305365105">
<message_arguments>
<message_argument value="org.eclipse.cdt.core.resources.Messages"/>
<message_argument value="org.eclipse.cdt.core_5.8.0"/>
</message_arguments>
</filter>
</resource>
<resource path="templateengine/org/eclipse/cdt/core/templateengine/TemplateEngineMessages.java" type="org.eclipse.cdt.core.templateengine.TemplateEngineMessages">
<filter id="305365105">
<message_arguments>
<message_argument value="org.eclipse.cdt.core.templateengine.TemplateEngineMessages"/>
<message_argument value="org.eclipse.cdt.core_5.8.0"/>
</message_arguments>
</filter>
</resource>
</component>

View file

@ -1,6 +1,5 @@
#Thu Nov 09 15:08:09 CET 2006
eclipse.preferences.version=1
encoding//parser/org/eclipse/cdt/internal/core/index/messages.properties=8859_1
encoding//parser/org/eclipse/cdt/internal/core/pdom/db/messages.properties=8859_1
encoding//parser/org/eclipse/cdt/internal/core/pdom/indexer/messages.properties=8859_1
encoding//parser/org/eclipse/cdt/internal/core/pdom/messages.properties=8859_1
encoding//parser/org/eclipse/cdt/internal/core/index/Messages.properties=8859_1
encoding//parser/org/eclipse/cdt/internal/core/pdom/Messages.properties=8859_1
encoding//parser/org/eclipse/cdt/internal/core/pdom/db/Messages.properties=8859_1
encoding//parser/org/eclipse/cdt/internal/core/pdom/indexer/Messages.properties=8859_1

View file

@ -8,18 +8,17 @@
* Contributors:
* Markus Schorn - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.index;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.core.index.messages"; //$NON-NLS-1$
public static String CIndex_FindBindingsTask_label;
public static String IndexFactory_errorNoSuchPDOM0;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
// Initialize resource bundle.
NLS.initializeMessages(Messages.class.getName(), Messages.class);
}
private Messages() {

View file

@ -13,14 +13,12 @@ package org.eclipse.cdt.internal.core.index.provider;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.core.index.provider.messages"; //$NON-NLS-1$
public static String IndexProviderManager_InvalidIndexProvider;
public static String IndexProviderManager_NoCompatibleFragmentsAvailable;
static {
// Initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
// Initialize resource bundle.
NLS.initializeMessages(Messages.class.getName(), Messages.class);
}
private Messages() {

View file

@ -6,15 +6,16 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Markus Schorn - initial API and implementation
* Markus Schorn - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.core.pdom.messages"; //$NON-NLS-1$
public static String Checksums_taskComputeChecksums;
public static String PDOMImportTask_errorInvalidArchive;
public static String PDOMImportTask_errorInvalidPDOMVersion;
public static String PDOMManager_ClosePDOMJob;
public static String PDOMManager_creationOfIndexInterrupted;
public static String PDOMManager_ExistingFileCollides;
@ -31,9 +32,10 @@ public class Messages extends NLS {
public static String AbstractIndexerTask_parsingFileTask;
public static String AbstractIndexerTask_errorWhileParsing;
public static String AbstractIndexerTask_tooManyIndexProblems;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
// Initialize resource bundle.
NLS.initializeMessages(Messages.class.getName(), Messages.class);
}
private Messages() {

View file

@ -8,19 +8,21 @@
# Contributors:
# Markus Schorn (Wind River Systems)
###############################################################################
Checksums_taskComputeChecksums=Computing checksums
PDOMImportTask_errorInvalidArchive=Invalid Archive: {0}
PDOMImportTask_errorInvalidPDOMVersion=The version of the {0} to import for project {1} does not match
PDOMManager_notifyJob_label=Notify Index Change Listeners
PDOMManager_StartJob_name=Setting up indexer
PDOMManager_ClosePDOMJob=Close database
PDOMManager_notifyTask_message=Notify Listeners
PDOMManager_indexMonitorDetail={0}/{1} sources, {2} headers
PDOMManager_ExistingFileCollides=A pdom already exists at location {0}
PDOMManager_ExistingFileCollides=A PDOM file already exists at location {0}
PDOMManager_creationOfIndexInterrupted=Creation of index was interrupted
PDOMWriter_errorResolvingName=Error resolving ''{0}'' in {1}.
PDOMWriter_errorWhileParsing=Error while parsing {0}.
Checksums_taskComputeChecksums=Computing checksums
TeamPDOMExportOperation_errorCreatingTempFile=Cannot create temp file
TeamPDOMExportOperation_errorCreatingTempFile=Cannot create a temporary file
TeamPDOMExportOperation_taskExportIndex=Export team shared index
TeamPDOMExportOperation_errorWriteTempFile=Cannot write to temporary file
TeamPDOMExportOperation_errorWriteTempFile=Cannot write to a temporary file
TeamPDOMExportOperation_errorCreateArchive=Error creating archive
AbstractIndexerTask_parsingFileTask=parsing {0} ({1})
AbstractIndexerTask_errorWhileParsing=Error while parsing {0}.

View file

@ -23,7 +23,6 @@ import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
import java.util.zip.ZipException;
import java.util.zip.ZipFile;
import org.eclipse.cdt.core.CCorePlugin;
@ -35,7 +34,6 @@ import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.cdt.internal.core.CCoreInternals;
import org.eclipse.cdt.internal.core.index.IIndexFragmentFile;
import org.eclipse.cdt.internal.core.pdom.indexer.IndexerPreferences;
import org.eclipse.cdt.internal.core.pdom.indexer.Messages;
import org.eclipse.cdt.internal.core.pdom.indexer.PDOMIndexerTask;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
@ -95,17 +93,9 @@ public class TeamPDOMImportOperation implements IWorkspaceRunnable {
doImportIndex(importFile, pm);
fSuccess= true;
}
}
catch (InterruptedException e) {
} catch (InterruptedException e) {
throw new OperationCanceledException();
}
catch (ZipException e) {
ex= e;
}
catch (IOException e) {
ex= e;
}
catch (CoreException e) {
} catch (IOException | CoreException e) {
ex= e;
}
@ -149,8 +139,7 @@ public class TeamPDOMImportOperation implements IWorkspaceRunnable {
try {
importIndex(zip, monitor);
checksums= getChecksums(zip);
}
finally {
} finally {
try {
zip.close();
} catch (IOException e) {
@ -181,12 +170,10 @@ public class TeamPDOMImportOperation implements IWorkspaceRunnable {
if (obj instanceof Map<?, ?>) {
return (Map<?,?>) obj;
}
}
finally {
} finally {
input.close();
}
}
catch (Exception e) {
} catch (Exception e) {
CCorePlugin.log(e);
}
}
@ -202,10 +189,10 @@ public class TeamPDOMImportOperation implements IWorkspaceRunnable {
WritablePDOM pdom= (WritablePDOM) obj;
pdom.acquireReadLock();
try {
List<FileAndChecksum> filesToCheck= new ArrayList<FileAndChecksum>();
List<FileAndChecksum> filesToCheck= new ArrayList<>();
if (!pdom.isSupportedVersion()) {
throw new CoreException(CCorePlugin.createStatus(
NLS.bind(Messages.PDOMImportTask_errorInvalidPDOMVersion, fProject.getElementName())));
NLS.bind(Messages.PDOMImportTask_errorInvalidPDOMVersion, INDEX_NAME, fProject.getElementName())));
}
final IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
@ -246,8 +233,7 @@ public class TeamPDOMImportOperation implements IWorkspaceRunnable {
List<FileAndChecksum> updateTimestamps= getUnchangedWithDifferentTimestamp(checksums, filesToCheck, monitor);
updateIndex(pdom, 1, filesToDelete, updateTimestamps, monitor);
}
finally {
} finally {
pdom.releaseReadLock();
}
}
@ -279,8 +265,7 @@ public class TeamPDOMImportOperation implements IWorkspaceRunnable {
}
}
}
}
finally {
} finally {
pdom.releaseWriteLock(giveupReadlocks, true);
}
}
@ -294,7 +279,7 @@ public class TeamPDOMImportOperation implements IWorkspaceRunnable {
return Collections.emptyList();
}
List<FileAndChecksum> result= new ArrayList<TeamPDOMImportOperation.FileAndChecksum>();
List<FileAndChecksum> result= new ArrayList<>();
for (FileAndChecksum cs : filesToCheck) {
checkMonitor(monitor);
@ -313,10 +298,7 @@ public class TeamPDOMImportOperation implements IWorkspaceRunnable {
}
}
}
} catch (IOException e) {
CCorePlugin.log(e);
result.add(cs);
} catch (CoreException e) {
} catch (IOException | CoreException e) {
CCorePlugin.log(e);
result.add(cs);
}

View file

@ -14,9 +14,8 @@ import java.util.MissingResourceException;
import java.util.ResourceBundle;
public class Messages {
private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.core.pdom.db.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
private static final ResourceBundle RESOURCE_BUNDLE =
ResourceBundle.getBundle(Messages.class.getName());
private Messages() {
}

View file

@ -14,10 +14,8 @@ import java.util.MissingResourceException;
import java.util.ResourceBundle;
public class Messages {
private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.core.pdom.dom.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
.getBundle(BUNDLE_NAME);
private static final ResourceBundle RESOURCE_BUNDLE =
ResourceBundle.getBundle(Messages.class.getName());
private Messages() {
}

View file

@ -6,14 +6,13 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Andrew Ferguson (Symbian) - Initial implementation
* Andrew Ferguson (Symbian) - Initial implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.export;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.core.pdom.export.messages"; //$NON-NLS-1$
public static String GeneratePDOM_GenericGenerationFailed;
public static String GeneratePDOM_Incomplete;
public static String GeneratePDOM_NullLocationConverter;
@ -25,9 +24,10 @@ public class Messages extends NLS {
public static String GeneratePDOMApplication_Initializing;
public static String GeneratePDOMApplication_InvalidIndexerID;
public static String GeneratePDOMApplication_UsingDefaultProjectProvider;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
// Initialize resource bundle.
NLS.initializeMessages(Messages.class.getName(), Messages.class);
}
private Messages() {

View file

@ -6,17 +6,13 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Markus Schorn - initial API and implementation
* Markus Schorn - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.indexer;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.core.pdom.indexer.messages"; //$NON-NLS-1$
public static String PDOMImportTask_errorInvalidArchive;
public static String PDOMImportTask_errorInvalidPDOMVersion;
class Messages extends NLS {
public static String PDOMIndexerTask_collectingFilesTask;
public static String PDOMIndexerTask_indexerInfo;
public static String TodoTaskUpdater_DeleteJob;
@ -31,8 +27,8 @@ public class Messages extends NLS {
public static String PDOMRebuildTask_0;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
// Initialize resource bundle.
NLS.initializeMessages(Messages.class.getName(), Messages.class);
}
private Messages() {

View file

@ -10,8 +10,6 @@
###############################################################################
PDOMIndexerTask_collectingFilesTask=Collecting files (project ''{0}'')
PDOMIndexerTask_indexerInfo=Indexed ''{0}'' ({1} sources, {2} headers) in {3} sec: {4} declarations; {5} references; {6} unresolved inclusions; {7} syntax errors; {8} unresolved names ({9})
PDOMImportTask_errorInvalidPDOMVersion=The version of the cdt-index to import for project {0} does not match
PDOMImportTask_errorInvalidArchive=Invalid Archive: {0}
PDOMImportTask_readingIndexJob_Name=Reading Index from archive
PDOMImportTask_readingChecksumsJob_Name=Reading checksums from archive
PDOMImportTask_checkingFilesJob_Name=Checking files in project

View file

@ -1,33 +1,28 @@
/*******************************************************************************
* Copyright (c) 2011 IBM Corporation and others.
* 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
* Copyright (c) 2011 IBM Corporation and others.
* 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:
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.resources;
import org.eclipse.osgi.util.NLS;
/**
* @since 5.3
*/
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.cdt.core.resources.messages"; //$NON-NLS-1$
class Messages extends NLS {
public static String RefreshExclusion_0;
public static String RefreshScopeManager_0;
public static String RefreshScopeManager_1;
public static String RefreshScopeManager_2;
public static String RefreshScopeManager_3;
public static String RefreshScopeManager_4;
public static String ResourceExclusion_name;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
// Initialize resource bundle.
NLS.initializeMessages(Messages.class.getName(), Messages.class);
}
private Messages() {

View file

@ -14,5 +14,3 @@ RefreshScopeManager_1=Error instantiating XML transformer.
RefreshScopeManager_2=Error transforming XML.
RefreshScopeManager_3=Error parsing refresh settings from project {0}
RefreshScopeManager_4=Error loading refresh settings: no project description for project {0}
ResourceExclusion_name=Resource Exclusions

View file

@ -12,13 +12,12 @@ package org.eclipse.cdt.internal.core.cdtvariables;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME= "org.eclipse.cdt.internal.core.cdtvariables.messages"; //$NON-NLS-1$
class Messages extends NLS {
public static String EclipseVariablesVariableSupplier_illegal_variable;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
// Initialize resource bundle.
NLS.initializeMessages(Messages.class.getName(), Messages.class);
}
private Messages() {

View file

@ -13,11 +13,9 @@ package org.eclipse.cdt.internal.core.envvar;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
public class Messages {
private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.core.envvar.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
.getBundle(BUNDLE_NAME);
class Messages {
private static final ResourceBundle RESOURCE_BUNDLE =
ResourceBundle.getBundle(Messages.class.getName());
private Messages() {
}

View file

@ -0,0 +1,25 @@
/*******************************************************************************
* Copyright (c) 2011 IBM Corporation and others.
* 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:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.resources;
import org.eclipse.osgi.util.NLS;
class Messages extends NLS {
public static String ResourceExclusion_name;
static {
// Initialize resource bundle.
NLS.initializeMessages(Messages.class.getName(), Messages.class);
}
private Messages() {
}
}

View file

@ -0,0 +1,11 @@
###############################################################################
# Copyright (c) 2011 IBM Corporation and others.
# 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:
# IBM Corporation - initial API and implementation
###############################################################################
ResourceExclusion_name=Resource Exclusions

View file

@ -1,42 +1,27 @@
/*******************************************************************************
* Copyright (c) 2011, 2012 IBM Corporation and others.
* 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
* Copyright (c) 2011, 2012 IBM Corporation and others.
* 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:
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.resources;
import java.util.LinkedList;
import java.util.List;
import org.eclipse.cdt.core.resources.ExclusionInstance;
import org.eclipse.cdt.core.resources.Messages;
import org.eclipse.cdt.core.resources.RefreshExclusion;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
/**
*
* <strong>EXPERIMENTAL</strong>. This class or interface has been added as part of a work in progress. There
* is no guarantee that this API will work or that it will remain the same. Please do not use this API without
* consulting with the CDT team.
*
* @author vkong
* @since 5.3
*
*/
public class ResourceExclusion extends RefreshExclusion {
/*
* (non-Javadoc)
*
* @see org.eclipse.cdt.core.resources.RefreshExclusion#getName()
*/
@Override
public synchronized String getName() {
return Messages.ResourceExclusion_name;
@ -47,16 +32,9 @@ public class ResourceExclusion extends RefreshExclusion {
return true;
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.cdt.core.resources.RefreshExclusion#testExclusion(org.eclipse.core.resources.IResource)
*/
@Override
public synchronized boolean testExclusion(IResource resource) {
// Populate the resources to be excluded by this exclusion
// Populate the resources to be excluded by this exclusion.
List<IResource> excludedResources = new LinkedList<IResource>();
List<ExclusionInstance> exclusionInstances = getExclusionInstances();
@ -66,15 +44,15 @@ public class ResourceExclusion extends RefreshExclusion {
if (excludedResources.contains(resource)) {
return true;
} else { // check to see if the given resource is part of this exclusion
}
for (IResource excludedResource : excludedResources) {
// TODO: need to update this for Phase 2 implementation
if (excludedResource instanceof IContainer) {
IContainer container = (IContainer) excludedResource;
if (container.getFullPath().isPrefixOf(resource.getFullPath())) {
return true;
}
// Check to see if the given resource is part of this exclusion.
for (IResource excludedResource : excludedResources) {
// TODO: need to update this for Phase 2 implementation
if (excludedResource instanceof IContainer) {
IContainer container = (IContainer) excludedResource;
if (container.getFullPath().isPrefixOf(resource.getFullPath())) {
return true;
}
}
}
@ -84,10 +62,7 @@ public class ResourceExclusion extends RefreshExclusion {
@Override
public Object clone() {
ResourceExclusion clone = new ResourceExclusion();
copyTo(clone);
return clone;
}
}

View file

@ -0,0 +1,25 @@
/*******************************************************************************
* Copyright (c) 2007 Symbian Software Limited and others.
* 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:
* Bala Torati (Symbian) - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.templateengine;
import org.eclipse.osgi.util.NLS;
class Messages extends NLS {
public static String TemplateCore_init_failed;
static {
// Initialize resource bundle.
NLS.initializeMessages(Messages.class.getName(), Messages.class);
}
private Messages() {
}
}

View file

@ -0,0 +1,11 @@
###############################################################################
# Copyright (c) 2007 Symbian Software Limited and others.
# 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:
# Bala Torati (Symbian) - Initial API and implementation
###############################################################################
TemplateCore_init_failed=Failed to initialize: {0}

View file

@ -26,9 +26,7 @@ import org.eclipse.cdt.core.templateengine.process.TemplateProcessHandler;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import com.ibm.icu.text.MessageFormat;
import org.eclipse.osgi.util.NLS;
/**
* TemplateCore class is responsible providing the non-UI part of template and
@ -44,7 +42,7 @@ public class TemplateCore {
private static final String ID = "id"; //$NON-NLS-1$
private static final String TYPE = "type"; //$NON-NLS-1$
private static Map<TemplateInfo, TemplateCore> templateCache = new HashMap<TemplateInfo, TemplateCore>();
private static Map<TemplateInfo, TemplateCore> templateCache = new HashMap<>();
public static final Comparator<TemplateCore> TEMPLATE_ID_CASE_INSENSITIVE_COMPARATOR = new Comparator<TemplateCore>() {
@Override
@ -74,7 +72,7 @@ public class TemplateCore {
try {
descriptorURL= TemplateEngineHelper.getTemplateResourceURL(templateInfo.getPluginId(), templateInfo.getTemplatePath());
} catch(IOException ioe) {
String msg= MessageFormat.format(TemplateEngineMessages.getString("TemplateCore.InitFailed"), new Object[]{templateInfo.getTemplatePath()}); //$NON-NLS-1$
String msg= NLS.bind(Messages.TemplateCore_init_failed, templateInfo.getTemplatePath());
throw new TemplateInitializationException(msg);
}
if(descriptorURL==null)

View file

@ -6,13 +6,12 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Bala Torati (Symbian) - Initial API and implementation
* Bala Torati (Symbian) - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.templateengine;
import java.io.IOException;
import java.net.URL;
import com.ibm.icu.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -21,11 +20,11 @@ import java.util.Map;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.osgi.util.NLS;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
/**
* This class contains methods to get first process block element, next process block
* element and checks for next process block element.
@ -50,7 +49,7 @@ public class TemplateDescriptor {
* @throws TemplateInitializationException
*/
public TemplateDescriptor(URL descriptorURL, String pluginId) throws TemplateInitializationException {
String msg= MessageFormat.format(TemplateEngineMessages.getString("TemplateCore.InitFailed"), new Object[]{descriptorURL}); //$NON-NLS-1$
String msg= NLS.bind(Messages.TemplateCore_init_failed, descriptorURL.toString());
try {
this.document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(descriptorURL.openStream());
} catch(ParserConfigurationException pce) {

View file

@ -22,7 +22,6 @@ import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.templateengine.TemplateCore;
import org.eclipse.cdt.core.templateengine.TemplateDescriptor;
import org.eclipse.cdt.core.templateengine.TemplateEngine;
import org.eclipse.cdt.core.templateengine.TemplateEngineMessages;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@ -211,7 +210,7 @@ public class ConditionalProcessGroup {
}
if (!isConditionValueTrue()) {
List<IStatus> statuses = new ArrayList<IStatus>(1);
statuses.add(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, IStatus.INFO, TemplateEngineMessages.getString("ConditionalProcessGroup.notExecuting") + id, null)); //$NON-NLS-1$
statuses.add(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, IStatus.INFO, Messages.getString("ConditionalProcessGroup.notExecuting") + id, null)); //$NON-NLS-1$
return statuses;
}
List<IStatus> statuses = new ArrayList<IStatus>(processes.size());
@ -234,7 +233,7 @@ public class ConditionalProcessGroup {
Map<String, String> valueStore = template.getValueStore();
for(String value : macros) {
if (valueStore.get(value) == null) {
return TemplateEngineMessages.getString("ConditionalProcessGroup.unexpandableMacro") + value; //$NON-NLS-1$
return Messages.getString("ConditionalProcessGroup.unexpandableMacro") + value; //$NON-NLS-1$
}
}
}

View file

@ -6,25 +6,20 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Bala Torati (Symbian) - Initial API and implementation
* Bala Torati (Symbian) - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.templateengine;
package org.eclipse.cdt.core.templateengine.process;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
public class TemplateEngineMessages {
private static final String BUNDLE_NAME = "org.eclipse.cdt.core.templateengine.messages"; //$NON-NLS-1$
class Messages {
private static final ResourceBundle RESOURCE_BUNDLE =
ResourceBundle.getBundle(Messages.class.getName());
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
.getBundle(BUNDLE_NAME);
/**
* @since 5.6
*/
public static String ProcessRunner_missingArg;
private TemplateEngineMessages() {
private Messages() {
}
public static String getString(String key) {

View file

@ -6,11 +6,9 @@
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Bala Torati (Symbian) - Initial API and implementation
# Bala Torati (Symbian) - Initial API and implementation
###############################################################################
TemplateEngine.internalError=Internal Error:
TemplateCore.InitFailed=Failed to initialize: {0}
TemplateEngine.templateEngine=Template Engine
ProjectCreatedActions.InsufficientInformation=Insufficient information to create new project

View file

@ -19,7 +19,6 @@ import java.util.Set;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.templateengine.TemplateCore;
import org.eclipse.cdt.core.templateengine.TemplateEngine;
import org.eclipse.cdt.core.templateengine.TemplateEngineMessages;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@ -119,8 +118,8 @@ public class Process {
for (int i= 0; i < args.length; i++) {
ProcessArgument arg = args[i];
if ((macro = arg.getFirstNonExpandableMacro()) != null) {
return TemplateEngineMessages.getString("Process.argument") + arg.getName() + //$NON-NLS-1$
TemplateEngineMessages.getString("Process.expandableMacro") + macro; //$NON-NLS-1$
return Messages.getString("Process.argument") + arg.getName() + //$NON-NLS-1$
Messages.getString("Process.expandableMacro") + macro; //$NON-NLS-1$
}
}
}
@ -136,11 +135,11 @@ public class Process {
private String getProcessMessage(int code, String msg) {
switch (code) {
case IStatus.ERROR:
return id + TemplateEngineMessages.getString("Process.error") + msg; //$NON-NLS-1$
return id + Messages.getString("Process.error") + msg; //$NON-NLS-1$
case IStatus.OK:
return id + TemplateEngineMessages.getString("Process.success") + msg; //$NON-NLS-1$
return id + Messages.getString("Process.success") + msg; //$NON-NLS-1$
default:
return id + TemplateEngineMessages.getString("Process.info") + msg; //$NON-NLS-1$
return id + Messages.getString("Process.info") + msg; //$NON-NLS-1$
}
}
@ -152,7 +151,7 @@ public class Process {
*/
public IStatus process(IProgressMonitor monitor) throws ProcessFailureException {
if (processRunner == null) {
throw new ProcessFailureException(TemplateEngineMessages.getString("Process.unknownProcess") + processType); //$NON-NLS-1$
throw new ProcessFailureException(Messages.getString("Process.unknownProcess") + processType); //$NON-NLS-1$
}
if (!processRunner.areArgumentsMatchingRequiredParameters(args)) {
throw new ProcessFailureException(processRunner.getArgumentsMismatchMessage(args));
@ -162,7 +161,7 @@ public class Process {
}
resolve();
processRunner.process(template, args, id, monitor);
return new Status(IStatus.INFO, CCorePlugin.PLUGIN_ID, IStatus.OK, getProcessMessage(IStatus.OK, TemplateEngineMessages.getString("Process.executedSuccessfully") + Arrays.asList(args)), null); //$NON-NLS-1$
return new Status(IStatus.INFO, CCorePlugin.PLUGIN_ID, IStatus.OK, getProcessMessage(IStatus.OK, Messages.getString("Process.executedSuccessfully") + Arrays.asList(args)), null); //$NON-NLS-1$
}
private void resolve() {

View file

@ -25,7 +25,6 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.eclipse.cdt.core.templateengine.TemplateEngineMessages;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
@ -54,7 +53,7 @@ public class ProcessHelper {
RandomAccessFile raf = null;
if (!toFile.exists()) {
throw new FileNotFoundException(MessageFormat.format(
TemplateEngineMessages.getString("ProcessHelper.fileNotFound"), //$NON-NLS-1$
Messages.getString("ProcessHelper.fileNotFound"), //$NON-NLS-1$
toFile.getPath()));
} else {
try {
@ -121,7 +120,7 @@ public class ProcessHelper {
StringBuilder buffer = new StringBuilder();
if (!new java.io.File(source.getFile()).exists()) {
throw new FileNotFoundException(MessageFormat.format(
TemplateEngineMessages.getString("ProcessHelper.fileNotFound"), //$NON-NLS-1$
Messages.getString("ProcessHelper.fileNotFound"), //$NON-NLS-1$
source.getFile()));
} else {
contentsReader = new InputStreamReader(source.openStream());

View file

@ -11,7 +11,6 @@
package org.eclipse.cdt.core.templateengine.process;
import org.eclipse.cdt.core.templateengine.TemplateCore;
import org.eclipse.cdt.core.templateengine.TemplateEngineMessages;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@ -21,7 +20,6 @@ import com.ibm.icu.text.MessageFormat;
* Abstract ProcessRunner class provides the methods to implement for processes.
*/
public abstract class ProcessRunner {
private ProcessParameter[] params = new ProcessParameter[0];
void setProcessParameters(ProcessParameter[] params) {
@ -39,7 +37,7 @@ public abstract class ProcessRunner {
* @since 5.6
*/
protected ProcessFailureException missingArgException(String processId, String varname) {
String msg = MessageFormat.format(TemplateEngineMessages.ProcessRunner_missingArg, varname);
String msg = MessageFormat.format(Messages.ProcessRunner_missingArg, varname);
return new ProcessFailureException(getProcessMessage(processId, IStatus.ERROR, msg));
}
@ -70,22 +68,22 @@ public abstract class ProcessRunner {
*/
public String getArgumentsMismatchMessage(ProcessArgument[] args) {
if (params == null && args != null) {
return TemplateEngineMessages.getString("ProcessRunner.unexpectedArguments"); //$NON-NLS-1$
return Messages.getString("ProcessRunner.unexpectedArguments"); //$NON-NLS-1$
}
if (params != null && args == null) {
return TemplateEngineMessages.getString("ProcessRunner.missingArguments"); //$NON-NLS-1$
return Messages.getString("ProcessRunner.missingArguments"); //$NON-NLS-1$
}
if (params == null && args == null) {
return null;
}
if (params.length != args.length) {
return TemplateEngineMessages.getString("ProcessRunner.missingArguments"); //$NON-NLS-1$
return Messages.getString("ProcessRunner.missingArguments"); //$NON-NLS-1$
}
for (int i = 0; i < params.length; i++) {
ProcessParameter param = params[i];
ProcessArgument arg = args[i];
if (!arg.isOfParameterType(param)) {
return TemplateEngineMessages.getString("ProcessRunner.argumentsMismatch") + arg.getName(); //$NON-NLS-1$
return Messages.getString("ProcessRunner.argumentsMismatch") + arg.getName(); //$NON-NLS-1$
}
}
return null;
@ -97,11 +95,11 @@ public abstract class ProcessRunner {
protected final String getProcessMessage(String processId, int code, String msg) {
switch (code) {
case IStatus.ERROR:
return processId + TemplateEngineMessages.getString("ProcessRunner.error") + msg; //$NON-NLS-1$
return processId + Messages.getString("ProcessRunner.error") + msg; //$NON-NLS-1$
case IStatus.OK:
return processId + TemplateEngineMessages.getString("ProcessRunner.success") + msg; //$NON-NLS-1$
return processId + Messages.getString("ProcessRunner.success") + msg; //$NON-NLS-1$
default:
return processId + TemplateEngineMessages.getString("ProcessRunner.info") + msg; //$NON-NLS-1$
return processId + Messages.getString("ProcessRunner.info") + msg; //$NON-NLS-1$
}
}

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Bala Torati (Symbian) - Initial API and implementation
* Bala Torati (Symbian) - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.templateengine.process.processes;
@ -14,10 +14,8 @@ import java.util.MissingResourceException;
import java.util.ResourceBundle;
public class Messages {
private static final String BUNDLE_NAME = "org.eclipse.cdt.core.templateengine.process.processes.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
.getBundle(BUNDLE_NAME);
private static final ResourceBundle RESOURCE_BUNDLE =
ResourceBundle.getBundle(Messages.class.getName());
private Messages() {
}

View file

@ -6,14 +6,13 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Markus Schorn - initial API and implementation
* Markus Schorn - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.core.messages"; //$NON-NLS-1$
public static String Util_unexpectedError;
public static String Addr_valueOutOfRange;
public static String CommandLauncher_CommandCancelled;
@ -57,8 +56,8 @@ public class Messages extends NLS {
public static String XmlUtil_InternalErrorSerializing;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
// Initialize resource bundle.
NLS.initializeMessages(Messages.class.getName(), Messages.class);
}
private Messages() {

View file

@ -6,18 +6,16 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Markus Schorn - initial API and implementation
* Sergey Prigogin (Google)
* Markus Schorn - initial API and implementation
* Sergey Prigogin (Google)
*******************************************************************************/
package org.eclipse.cdt.internal.ui.util;
import com.ibm.icu.text.MessageFormat;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME= Messages.class.getName();
import com.ibm.icu.text.MessageFormat;
public class Messages extends NLS {
public static String EditorUtility_calculatingChangedRegions_message;
public static String EditorUtility_error_calculatingChangedRegions;
@ -34,6 +32,6 @@ public class Messages extends NLS {
}
static {
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
NLS.initializeMessages(Messages.class.getName(), Messages.class);
}
}

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Bala Torati (Symbian) - Initial API and implementation
* Bala Torati (Symbian) - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.ui.templateengine;
@ -14,10 +14,8 @@ import java.util.MissingResourceException;
import java.util.ResourceBundle;
public class Messages {
private static final String BUNDLE_NAME = "org.eclipse.cdt.ui.templateengine.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
.getBundle(BUNDLE_NAME);
private static final ResourceBundle RESOURCE_BUNDLE =
ResourceBundle.getBundle(Messages.class.getName());
private Messages() {
}

View file

@ -43,4 +43,6 @@ UISelectWidget_ErrorNoneSelected0=Please choose a value for {0}
UITextWidget.0=\ Project already exists in workspace.
SimpleElementException.0=This Operation not supported on InputUIElement
TemplateEngineMessage.Error=CDT New Project Wizard Template Engine Error
TemplateEngine.internalError=Internal Error:
TemplateEngine.templateEngine=Template Engine

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Bala Torati (Symbian) - Initial API and implementation
* Bala Torati (Symbian) - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.ui.templateengine;
@ -20,7 +20,6 @@ import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.cdt.core.templateengine.TemplateEngineMessages;
import org.eclipse.cdt.core.templateengine.TemplateEngineUtil;
import org.eclipse.cdt.core.templateengine.process.ProcessFailureException;
import org.eclipse.cdt.ui.CUIPlugin;
@ -61,17 +60,17 @@ public class TemplateEngineUIUtil {
message = null;
}
} else {
status = new Status(IStatus.ERROR, CUIPlugin.getPluginId(), -1, TemplateEngineMessages.getString("TemplateEngine.internalError") + message, t); //$NON-NLS-1$
status = new Status(IStatus.ERROR, CUIPlugin.getPluginId(), -1, Messages.getString("TemplateEngine.internalError") + message, t); //$NON-NLS-1$
}
} else {
status = new Status(IStatus.ERROR, CUIPlugin.getPluginId(), -1, TemplateEngineMessages.getString("TemplateEngine.internalError") + message, null); //$NON-NLS-1$
status = new Status(IStatus.ERROR, CUIPlugin.getPluginId(), -1, Messages.getString("TemplateEngine.internalError") + message, null); //$NON-NLS-1$
}
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if(window == null){
IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows();
window = windows[0];
}
ErrorDialog.openError(window.getShell(), TemplateEngineMessages.getString("TemplateEngine.templateEngine"), message, status); //$NON-NLS-1$
ErrorDialog.openError(window.getShell(), Messages.getString("TemplateEngine.templateEngine"), message, status); //$NON-NLS-1$
}
/**
@ -87,7 +86,7 @@ public class TemplateEngineUIUtil {
IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows();
window = windows[0];
}
ErrorDialog.openError(window.getShell(), TemplateEngineMessages.getString("TemplateEngine.templateEngine"), message, status); //$NON-NLS-1$
ErrorDialog.openError(window.getShell(), Messages.getString("TemplateEngine.templateEngine"), message, status); //$NON-NLS-1$
}
}

View file

@ -13,16 +13,16 @@ package org.eclipse.cdt.internal.build.crossgcc;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.build.crossgcc.messages"; //$NON-NLS-1$
public static String SetCrossCommandWizardPage_browse;
public static String SetCrossCommandWizardPage_description;
public static String SetCrossCommandWizardPage_name;
public static String SetCrossCommandWizardPage_path;
public static String SetCrossCommandWizardPage_prefix;
public static String SetCrossCommandWizardPage_title;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
// Initialize resource bundle.
NLS.initializeMessages(Messages.class.getName(), Messages.class);
}
private Messages() {