1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

ICElement.getResource() no longer throw an exception.

This commit is contained in:
Alain Magloire 2003-03-27 19:32:04 +00:00
parent 5d93fce5e0
commit d750e21df8
3 changed files with 16 additions and 32 deletions

View file

@ -267,11 +267,8 @@ public class IndexManager implements IElementChangedListener {
}
if (kind == ICElementDelta.REMOVED) {
try {
IResource resource = element.getResource();
removeResource(resource);
} catch (CModelException e) {
}
}
// if (kind == ICElementDelta.ADDED) {

View file

@ -93,16 +93,12 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
}
ICElement ce = (ICElement) obj;
IProject project;
try {
project = (IProject) ce.getCProject().getResource();
IPath programFile = project.getFile(programName).getLocation();
ce = CCorePlugin.getDefault().getCoreModel().create(programFile);
if (ce != null && ce.exists()) {
return ce;
}
}
catch (CModelException e) {
}
return (ICElement) obj;
}
}

View file

@ -204,12 +204,8 @@ public class CMainTab extends CLaunchConfigurationTab {
dialog.setTitle("Program Selection");
if (dialog.open() == ElementListSelectionDialog.OK) {
IBinary binary = (IBinary) dialog.getFirstResult();
try {
fProgText.setText(binary.getResource().getProjectRelativePath().toString());
}
catch (CModelException e) {
}
}
}
/**
@ -369,7 +365,6 @@ public class CMainTab extends CLaunchConfigurationTab {
if (binary != null) {
String path;
try {
path = binary.getResource().getProjectRelativePath().toOSString();
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, path);
String name = binary.getElementName();
@ -380,10 +375,6 @@ public class CMainTab extends CLaunchConfigurationTab {
name = getLaunchConfigurationDialog().generateName(name);
config.rename(name);
}
catch (CModelException e) {
}
}
}
/**
* @see ILaunchConfigurationTab#getName()