From 572553e0f991bc9dd1479d6f5065646ef726d549 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Thu, 28 Aug 2003 19:46:41 +0000 Subject: [PATCH] Use CFileElementWorkingCopy --- .../cdt/internal/ui/editor/CContentOutlinePage.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java index 60744aea925..ad03ffd6e6d 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java @@ -185,24 +185,23 @@ public class CContentOutlinePage extends Page implements IContentOutlinePage, IS registerToolbarActions(); - //IFileEditorInput editorInput= (IFileEditorInput)fEditor.getEditorInput(); IEditorInput editorInput= (IEditorInput)fEditor.getEditorInput(); IDocumentProvider provider= fEditor.getDocumentProvider(); try { if (editorInput instanceof IFileEditorInput){ - //fInput = new CFileElementWorkingCopy((IFileEditorInput)editorInput, provider); IWorkingCopyManager wcManager = CUIPlugin.getDefault().getWorkingCopyManager(); fInput = (WorkingCopy)wcManager.getWorkingCopy(editorInput); if (fInput == null) { + // XXX This should never happen. Put an assert. fInput = new CFileElementWorkingCopy((IFileEditorInput)editorInput, provider); } } else if (editorInput instanceof 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); - } else + } else { throw new CoreException(new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, 0, "no Editor Input", null)); - + } treeViewer.setInput(fInput); } catch (CoreException e) { CUIPlugin.getDefault().log(e.getStatus());