mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-29 11:55:40 +02:00
Use CFileElementWorkingCopy
This commit is contained in:
parent
2659282961
commit
572553e0f9
1 changed files with 4 additions and 5 deletions
|
@ -185,24 +185,23 @@ public class CContentOutlinePage extends Page implements IContentOutlinePage, IS
|
||||||
|
|
||||||
registerToolbarActions();
|
registerToolbarActions();
|
||||||
|
|
||||||
//IFileEditorInput editorInput= (IFileEditorInput)fEditor.getEditorInput();
|
|
||||||
IEditorInput editorInput= (IEditorInput)fEditor.getEditorInput();
|
IEditorInput editorInput= (IEditorInput)fEditor.getEditorInput();
|
||||||
IDocumentProvider provider= fEditor.getDocumentProvider();
|
IDocumentProvider provider= fEditor.getDocumentProvider();
|
||||||
try {
|
try {
|
||||||
if (editorInput instanceof IFileEditorInput){
|
if (editorInput instanceof IFileEditorInput){
|
||||||
//fInput = new CFileElementWorkingCopy((IFileEditorInput)editorInput, provider);
|
|
||||||
IWorkingCopyManager wcManager = CUIPlugin.getDefault().getWorkingCopyManager();
|
IWorkingCopyManager wcManager = CUIPlugin.getDefault().getWorkingCopyManager();
|
||||||
fInput = (WorkingCopy)wcManager.getWorkingCopy(editorInput);
|
fInput = (WorkingCopy)wcManager.getWorkingCopy(editorInput);
|
||||||
if (fInput == null) {
|
if (fInput == null) {
|
||||||
|
// XXX This should never happen. Put an assert.
|
||||||
fInput = new CFileElementWorkingCopy((IFileEditorInput)editorInput, provider);
|
fInput = new CFileElementWorkingCopy((IFileEditorInput)editorInput, provider);
|
||||||
}
|
}
|
||||||
} else if (editorInput instanceof IStorageEditorInput){
|
} else if (editorInput instanceof IStorageEditorInput){
|
||||||
// CHECKPOINT: do we create a CFileElementWorkingCopy or just a working copy for the IStorageEditorInput?
|
// CHECKPOINT: do we create a CFileElementWorkingCopy or just a working copy for the IStorageEditorInput?
|
||||||
//fInput = ((CUIPlugin.ElementFactory)plugin.getCCore()).createWorkingCopy((IStorageEditorInput)editorInput, provider);
|
// If it is an IStorage it means that there is no underlying IFile.
|
||||||
fInput = new CFileElementWorkingCopy((IStorageEditorInput)editorInput, provider);
|
fInput = new CFileElementWorkingCopy((IStorageEditorInput)editorInput, provider);
|
||||||
} else
|
} else {
|
||||||
throw new CoreException(new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, 0, "no Editor Input", null));
|
throw new CoreException(new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, 0, "no Editor Input", null));
|
||||||
|
}
|
||||||
treeViewer.setInput(fInput);
|
treeViewer.setInput(fInput);
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
CUIPlugin.getDefault().log(e.getStatus());
|
CUIPlugin.getDefault().log(e.getStatus());
|
||||||
|
|
Loading…
Add table
Reference in a new issue