mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
NLS-style string resources. This change removes public visibility from SourceLookupMessages class that was given to it by mistake.
This commit is contained in:
parent
f257c2f55d
commit
7791c5f8b3
6 changed files with 94 additions and 75 deletions
|
@ -1,5 +1,43 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<component id="org.eclipse.cdt.debug.core" version="2">
|
||||
<resource path="src/org/eclipse/cdt/debug/core/sourcelookup/MappingSourceContainer.java" type="org.eclipse.cdt.debug.core.sourcelookup.MappingSourceContainer">
|
||||
<filter id="643846161">
|
||||
<message_arguments>
|
||||
<message_argument value="MapEntrySourceContainer"/>
|
||||
<message_argument value="MappingSourceContainer"/>
|
||||
<message_argument value="addMapEntries(MapEntrySourceContainer[])"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
<filter id="643846161">
|
||||
<message_arguments>
|
||||
<message_argument value="MapEntrySourceContainer"/>
|
||||
<message_argument value="MappingSourceContainer"/>
|
||||
<message_argument value="addMapEntry(MapEntrySourceContainer)"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
<filter id="643846161">
|
||||
<message_arguments>
|
||||
<message_argument value="MapEntrySourceContainer"/>
|
||||
<message_argument value="MappingSourceContainer"/>
|
||||
<message_argument value="removeMapEntries(MapEntrySourceContainer[])"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
<filter id="643846161">
|
||||
<message_arguments>
|
||||
<message_argument value="MapEntrySourceContainer"/>
|
||||
<message_argument value="MappingSourceContainer"/>
|
||||
<message_argument value="removeMapEntry(MapEntrySourceContainer)"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/cdt/debug/core/sourcelookup/SourceLookupMessages.java" type="org.eclipse.cdt.debug.core.sourcelookup.SourceLookupMessages">
|
||||
<filter comment="SourceLookupMessages class is no longer public." id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.cdt.debug.core.sourcelookup.SourceLookupMessages"/>
|
||||
<message_argument value="org.eclipse.cdt.debug.core_7.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/cdt/debug/internal/core/srcfinder/CSourceFinder.java" type="org.eclipse.cdt.debug.internal.core.srcfinder.CSourceFinder">
|
||||
<filter id="574619656">
|
||||
<message_arguments>
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
* Nokia - Initial implementation (159833)
|
||||
* Broadcom - http://bugs.eclipse.org/247853
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.debug.core.sourcelookup;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -58,16 +57,13 @@ public class AbsolutePathSourceContainer extends AbstractSourceContainer {
|
|||
|
||||
// The file is not already in the workspace so try to create an external translation unit for it.
|
||||
ISourceLookupDirector director = getDirector();
|
||||
if (director != null)
|
||||
{
|
||||
if (director != null) {
|
||||
ILaunchConfiguration launchConfiguration = director.getLaunchConfiguration();
|
||||
if (launchConfiguration != null)
|
||||
{
|
||||
if (launchConfiguration != null) {
|
||||
String projectName = launchConfiguration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); //$NON-NLS-1$
|
||||
if (projectName.length() > 0) {
|
||||
ICProject project = CoreModel.getDefault().getCModel().getCProject(projectName);
|
||||
if (project != null)
|
||||
{
|
||||
if (project != null) {
|
||||
IPath path = Path.fromOSString(file.getCanonicalPath());
|
||||
String id = CoreModel.getRegistedContentTypeId(project.getProject(), path.lastSegment());
|
||||
return new ExternalTranslationUnit[] { new ExternalTranslationUnit(project, path, id) };
|
||||
|
@ -89,8 +85,7 @@ public class AbsolutePathSourceContainer extends AbstractSourceContainer {
|
|||
*/
|
||||
private IProject getProject() {
|
||||
ISourceLookupDirector director = getDirector();
|
||||
if (director != null)
|
||||
{
|
||||
if (director != null) {
|
||||
ILaunchConfiguration config = director.getLaunchConfiguration();
|
||||
if (config != null) {
|
||||
try {
|
||||
|
@ -105,13 +100,11 @@ public class AbsolutePathSourceContainer extends AbstractSourceContainer {
|
|||
return null;
|
||||
}
|
||||
|
||||
public boolean isValidAbsoluteFilePath( String name )
|
||||
{
|
||||
public boolean isValidAbsoluteFilePath(String name) {
|
||||
return isValidAbsoluteFilePath(new File(name));
|
||||
}
|
||||
|
||||
public boolean isValidAbsoluteFilePath( File file )
|
||||
{
|
||||
public boolean isValidAbsoluteFilePath(File file) {
|
||||
return file.isAbsolute() && file.exists() && file.isFile();
|
||||
}
|
||||
|
||||
|
@ -126,7 +119,7 @@ public class AbsolutePathSourceContainer extends AbstractSourceContainer {
|
|||
}
|
||||
|
||||
public String getName() {
|
||||
return SourceLookupMessages.getString( "AbsolutePathSourceContainer.0" ); //$NON-NLS-1$
|
||||
return SourceLookupMessages.AbsolutePathSourceContainer_0;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -104,7 +104,9 @@ public class MappingSourceContainer extends AbstractSourceContainer {
|
|||
if (single == null) {
|
||||
single = e;
|
||||
} else if (multiStatus == null) {
|
||||
multiStatus = new MultiStatus(DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, new IStatus[]{ single.getStatus() }, SourceLookupMessages.getString("MappingSourceContainer.0"), null); //$NON-NLS-1$
|
||||
multiStatus = new MultiStatus(DebugPlugin.getUniqueIdentifier(),
|
||||
DebugPlugin.INTERNAL_ERROR, new IStatus[] { single.getStatus() },
|
||||
SourceLookupMessages.MappingSourceContainer_0, null);
|
||||
multiStatus.add(e.getStatus());
|
||||
} else {
|
||||
multiStatus.add(e.getStatus());
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
* Contributors:
|
||||
* Freescale - Initial implementation
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.debug.core.sourcelookup;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -35,7 +34,6 @@ import org.eclipse.debug.core.ILaunchConfiguration;
|
|||
* @since 7.0
|
||||
*/
|
||||
public class ProgramRelativePathSourceContainer extends AbstractSourceContainer{
|
||||
|
||||
/**
|
||||
* Unique identifier for the relative path source container type
|
||||
* (value <code>org.eclipse.cdt.debug.core.containerType.programRelativePath</code>).
|
||||
|
@ -84,7 +82,6 @@ public class ProgramRelativePathSourceContainer extends AbstractSourceContainer{
|
|||
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#findSourceElements(java.lang.String)
|
||||
*/
|
||||
public Object[] findSourceElements(String sourceName) throws CoreException {
|
||||
|
||||
if (sourceName == null) {
|
||||
return new Object[0];
|
||||
}
|
||||
|
@ -119,7 +116,7 @@ public class ProgramRelativePathSourceContainer extends AbstractSourceContainer{
|
|||
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getName()
|
||||
*/
|
||||
public String getName() {
|
||||
return SourceLookupMessages.getString("ProgramRelativePathSourceContainer.0"); //$NON-NLS-1$
|
||||
return SourceLookupMessages.ProgramRelativePathSourceContainer_0;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -130,7 +127,6 @@ public class ProgramRelativePathSourceContainer extends AbstractSourceContainer{
|
|||
}
|
||||
|
||||
private synchronized IPath getProgramLocation() throws CoreException {
|
||||
|
||||
// compute fProgramPath only if doesn't exist already
|
||||
if (fProgramPath.isEmpty()) {
|
||||
// get launch configuration
|
||||
|
@ -166,8 +162,7 @@ public class ProgramRelativePathSourceContainer extends AbstractSourceContainer{
|
|||
try {
|
||||
if (project != null) {
|
||||
exeFile = project.getProject().getFile(new Path(programName));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// A DSF launch config need not reference a project. Try
|
||||
// treating program name as either an absolute path or a
|
||||
// path relative to the working directory
|
||||
|
@ -175,14 +170,11 @@ public class ProgramRelativePathSourceContainer extends AbstractSourceContainer{
|
|||
if (path.toFile().exists()) {
|
||||
fProgramPath = path;
|
||||
return fProgramPath;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return fProgramPath; // return empty path
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (IllegalArgumentException e){
|
||||
} catch (IllegalArgumentException e) {
|
||||
return fProgramPath; // return empty path
|
||||
}
|
||||
|
||||
|
|
|
@ -7,28 +7,22 @@
|
|||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
* Sergey Prigogin (Google)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.core.sourcelookup;
|
||||
|
||||
import java.util.MissingResourceException;
|
||||
import java.util.ResourceBundle;
|
||||
import org.eclipse.osgi.util.NLS;
|
||||
|
||||
public class SourceLookupMessages {
|
||||
class SourceLookupMessages extends NLS {
|
||||
public static String MappingSourceContainer_0;
|
||||
public static String AbsolutePathSourceContainer_0;
|
||||
public static String ProgramRelativePathSourceContainer_0;
|
||||
|
||||
private static final String BUNDLE_NAME = "org.eclipse.cdt.debug.core.sourcelookup.SourceLookupMessages"; //$NON-NLS-1$
|
||||
|
||||
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME );
|
||||
static {
|
||||
NLS.initializeMessages(SourceLookupMessages.class.getName(), SourceLookupMessages.class);
|
||||
}
|
||||
|
||||
private SourceLookupMessages() {
|
||||
}
|
||||
|
||||
public static String getString( String key ) {
|
||||
// TODO Auto-generated method stub
|
||||
try {
|
||||
return RESOURCE_BUNDLE.getString( key );
|
||||
}
|
||||
catch( MissingResourceException e ) {
|
||||
return '!' + key + '!';
|
||||
}
|
||||
// Do not instantiate
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,6 @@
|
|||
# QNX Software Systems - initial API and implementation
|
||||
# Nokia - added support for AbsolutePathSourceContainer
|
||||
###############################################################################
|
||||
MappingSourceContainer.0=Source lookup error
|
||||
AbsolutePathSourceContainer.0=Absolute File Path
|
||||
ProgramRelativePathSourceContainer.0=Program Relative File Path
|
||||
MappingSourceContainer_0=Source lookup error
|
||||
AbsolutePathSourceContainer_0=Absolute File Path
|
||||
ProgramRelativePathSourceContainer_0=Program Relative File Path
|
||||
|
|
Loading…
Add table
Reference in a new issue