mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 10:46:02 +02:00
The method ICElement.getResource() do not throw an Exception.
This commit is contained in:
parent
ee5e73d5fe
commit
0dfb3bd0ef
3 changed files with 22 additions and 32 deletions
|
@ -102,10 +102,7 @@ class CViewDragAdapter extends DragSourceAdapter {
|
|||
IResource res = null;
|
||||
if (next instanceof ICElement) {
|
||||
ICElement celement = (ICElement)next;
|
||||
try {
|
||||
res = celement.getResource();
|
||||
} catch (CModelException e) {
|
||||
}
|
||||
res = celement.getResource();
|
||||
}
|
||||
if (res == null) {
|
||||
event.doit = false;
|
||||
|
|
|
@ -112,34 +112,30 @@ public class CDocumentProvider extends FileDocumentProvider implements IWorkingC
|
|||
}
|
||||
|
||||
public IBuffer createBuffer(IOpenable owner) {
|
||||
try {
|
||||
if (owner instanceof IWorkingCopy) {
|
||||
if (owner instanceof IWorkingCopy) {
|
||||
|
||||
IWorkingCopy unit= (IWorkingCopy) owner;
|
||||
ITranslationUnit original= (ITranslationUnit) unit.getOriginalElement();
|
||||
IResource resource= original.getResource();
|
||||
if (resource instanceof IFile) {
|
||||
IFileEditorInput providerKey= new FileEditorInput((IFile) resource);
|
||||
|
||||
IDocument document= null;
|
||||
IStatus status= null;
|
||||
|
||||
try {
|
||||
document= internalGetDocument(providerKey);
|
||||
} catch (CoreException x) {
|
||||
status= x.getStatus();
|
||||
document= new Document();
|
||||
initializeDocument(document);
|
||||
}
|
||||
|
||||
DocumentAdapter adapter= new DocumentAdapter(unit, document, new DefaultLineTracker(), CDocumentProvider.this, providerKey);
|
||||
adapter.setStatus(status);
|
||||
return adapter;
|
||||
IWorkingCopy unit= (IWorkingCopy) owner;
|
||||
ITranslationUnit original= (ITranslationUnit) unit.getOriginalElement();
|
||||
IResource resource= original.getResource();
|
||||
if (resource instanceof IFile) {
|
||||
IFileEditorInput providerKey= new FileEditorInput((IFile) resource);
|
||||
|
||||
IDocument document= null;
|
||||
IStatus status= null;
|
||||
|
||||
try {
|
||||
document= internalGetDocument(providerKey);
|
||||
} catch (CoreException x) {
|
||||
status= x.getStatus();
|
||||
document= new Document();
|
||||
initializeDocument(document);
|
||||
}
|
||||
|
||||
DocumentAdapter adapter= new DocumentAdapter(unit, document, new DefaultLineTracker(), CDocumentProvider.this, providerKey);
|
||||
adapter.setStatus(status);
|
||||
return adapter;
|
||||
}
|
||||
} catch (CModelException e) {
|
||||
return DocumentAdapter.NULL;
|
||||
|
||||
}
|
||||
return DocumentAdapter.NULL;
|
||||
}
|
||||
|
|
|
@ -125,10 +125,7 @@ public class EditorUtility {
|
|||
Process objdump = null;
|
||||
IPath path;
|
||||
IResource file = null;
|
||||
try {
|
||||
file = bin.getResource();
|
||||
} catch (CModelException e1) {
|
||||
}
|
||||
file = bin.getResource();
|
||||
if (file == null)
|
||||
return store;
|
||||
path = file.getLocation();
|
||||
|
|
Loading…
Add table
Reference in a new issue