Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 140337

Summary: [CView] Common Navigator extensions
Product: [Tools] CDT Reporter: Anton Leherbauer <aleherb+eclipse>
Component: cdt-coreAssignee: Anton Leherbauer <aleherb+eclipse>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: cdtdoug, janees.ek, martin.gutschelhofer, mikhail.sennikovskiy, neerajbhope
Version: 3.1   
Target Milestone: 4.0 M5   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Project Explorer extensions
none
Project wizard extensions none

Description Anton Leherbauer CLA 2006-05-05 07:09:21 EDT
Adopt the new Common Navigator (CN) framework and create CDT specific extensions to plug the content and functionality of the C/C++ Projects view (aka CView) into any Common Navigator view. The extensions will be initially contributed to the new general purpose "Project Explorer", which serves as a playground for early adopters of the technology (like JDT). This should also help to stabilize and improve the CN framework by providing feedback and bug reports.
Comment 1 Doug Schaefer CLA 2006-06-19 14:19:38 EDT
Just went through Michael Edger's blog tutorial on the CN (is that the official acronym?). Adopting the Project Explorer as our standard navigator solution opens us up for a lot of cool integrations (such as mixed Java/C projects). I look forward to your proposal. I think this is something we should probably do very early in 4.0. It shouldn't be too much work.
Comment 2 Janees Elamkulam CLA 2006-06-20 02:05:51 EDT
Yes this is easy to implement. current CView content provider is comaptible with the CN. We need to implement the IPipelinedTreeContentProvider, to overide the content provided by the resource extention.

Comment 3 Anton Leherbauer CLA 2006-06-20 06:24:59 EDT
I think I can provide a first patch rather soon (by the end of June). My  proposal is basically a single sentence: Duplicate the CView functionality by means of the CN framework and eventually replace the CView completely with a CN based view. The first step is to populate the Project Explorer with CDT content. Based on that work, we can then rather easily create a new "CView" which is open for extensions from ISVs for their products. 
Does that make sense?

BTW, mixing Java and CDT content in one project is currently not possible yet, because both models have their own specific project roots (IJavaProject, ICProject), but it is possible to view Java projects together with CDT projects in the same view, each with it's model-specific content. To really mix Java/C content, some more work is necessary both on the JDT- and the CDT-side.
Comment 4 Doug Schaefer CLA 2006-06-20 10:13:00 EDT
I think that's what I meant. Proper support for CDT and JDT projects in the same navigator so we don't need to keep flipping perspectives.

As for mixed projects, we should start working on a solution to this as well. I don't think the problem is that difficult and I'm sure the JDT guys would be interested in working together on a solution. Once we get the CDT content in the Project Explorer, we can take a closer look at what bad things happen when you have projects with both natures.
Comment 5 Anton Leherbauer CLA 2006-06-29 05:18:56 EDT
Created attachment 45522 [details]
Project Explorer extensions

This is a snapshot of the Common Navigator extensions to populate the Project Explorer with CDT content. It is complete in the sense that it has almost all the features of the current C/C++ Projects view. There are only few features which the CN framework currently lacks and which cannot be easily replicated outside the framework:
- browser-like navigation (go into, back, forward, up), bug 115220
- persistence of expansion and selection state, bug 149000
- name filter patterns, bug 118932

Other known limitations:
- refactor actions (rename and move) are reused from the "resourceContent" 
  extension, which imposes some restrictions, because those actions are 
  not available if the selected element is an ICElement.
  The CDT Refactor > Rename action which is available in this case is not 
  applicable for translation units. And Refactor > Move is not available at 
  all currently. 
  While it is possible to add renmame and move actions for translation units 
  specifically, I'd suggest to add support for this in the refactoring code 
  where it actually belongs.
- resource name filter does not work for non-IResource elements (.settings 
  folder cannot be filtered away with the .* filter) 
- no show-in support (eg. in the editor context menu Show In > Project Explorer)
- if JDT and CDT extensions are enabled in parallel CDT projects are duplicated
- working set filter actions are not on the top of the view menu (working set 
  filters should be supported by the framework not by individual content 
  providers, bug 146555
- the context menu layout is a little bit different and group markers are on 
  different positions than with CView
- the wizard shortcuts from the the builder plugins (eg. New > C++ Make Project, 
  etc.) are not part of this patch. I'll post a separate patch for those.

I intend to commit this in the next days to the 4.0 stream.
Please add feedback, problem reports, etc. to this bug.
Comment 6 Anton Leherbauer CLA 2006-06-30 04:52:26 EDT
Created attachment 45567 [details]
Project wizard extensions

This patch adds project wizard shortcuts of the builder plugins to the Project Explorer context menu (New > ...)
Comment 7 Anton Leherbauer CLA 2006-07-03 05:43:37 EDT
Committed to HEAD.
Comment 8 Anton Leherbauer CLA 2006-10-20 08:07:00 EDT
Closing.
Comment 9 Sascha Radike CLA 2006-12-29 10:10:02 EST
"- if JDT and CDT extensions are enabled in parallel CDT projects are duplicated"

How can this be fixed ? It does not look pretty.
Comment 10 Anton Leherbauer CLA 2007-01-08 03:56:40 EST
(In reply to comment #9)
> "- if JDT and CDT extensions are enabled in parallel CDT projects are
> duplicated"
> How can this be fixed ? It does not look pretty.

It must be fixed in JDT. See bug 150404.
Comment 11 Doug Schaefer CLA 2007-04-30 11:26:24 EDT
Can we get rid of the CView and the Navigator View out of the C/C++ perspective now? Reopening this bug for the discussion and closure.
Comment 12 Doug Schaefer CLA 2007-04-30 11:43:58 EDT
Never mind. Dave pointed me to a newer one more on the topic.