|
Lines 3-9
Link Here
|
| 3 |
<HEAD> |
3 |
<HEAD> |
| 4 |
|
4 |
|
| 5 |
<meta name="copyright" |
5 |
<meta name="copyright" |
| 6 |
content="Copyright (c) Oakland Software and others 2008. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page."> |
6 |
content="Copyright (c) Oakland Software and others 2008, 2009. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page."> |
| 7 |
|
7 |
|
| 8 |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> |
8 |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> |
| 9 |
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> |
9 |
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> |
|
Lines 17-22
Link Here
|
| 17 |
<BODY BGCOLOR="#ffffff"> |
17 |
<BODY BGCOLOR="#ffffff"> |
| 18 |
<H1>Common Navigator Framework</H1> |
18 |
<H1>Common Navigator Framework</H1> |
| 19 |
|
19 |
|
|
|
20 |
<p>A Viewer provides the user with a view of objects using a single |
| 21 |
content provider, label provider, sorter and filter. The Common |
| 22 |
Navigator Framework (CNF) extends this idea by allowing a single view to |
| 23 |
dynamically use multiple and unrelated sets of content providers, label |
| 24 |
providers, sorters and filters. These can be activated in the view |
| 25 |
depending on declarative expressions or using API calls. |
| 26 |
The CNF implemented by the <b><a |
| 27 |
href="../reference/api/org/eclipse/ui/navigator/package-summary.html"> |
| 28 |
org.eclipse.ui.navigator</a></b> plugin.</p> |
| 29 |
|
| 30 |
<p>The CNF uses the idea of <i>Navigator Content Extensions</i> |
| 31 |
(NCE) which can refer to a content provider, label provider, sorter, or |
| 32 |
drag adaptor (note that filters are configured separately). An NCE has |
| 33 |
associated expressions that tell it when it is active. NCEs are also |
| 34 |
presented to the user in the view context menu so that user can turn |
| 35 |
them on or off in order to show the view in different ways. Examples of |
| 36 |
NCEs are a resource content extension that controls how resources are |
| 37 |
presented and Java content extension that shows Java projects. In the |
| 38 |
IDE's Project Explorer, you can turn off the Java content extension |
| 39 |
getting a pure resource view of the workspace.</p> |
| 40 |
|
| 41 |
<p>By using the NCEs it's possible to include different <i>model objects</i> directly |
| 42 |
in the view. These model objects might be related in a cascading fashion. For example |
| 43 |
a resource object (an <code>IFile</code>) might refer to a Java class object. This Java class |
| 44 |
object can be presented directly in the view by defining an NCE. The Java class object |
| 45 |
can have children (representing methods, fields, etc) all of which appear in the view. |
| 46 |
You can then add another NCE to display model objects related to the Java (or resource |
| 47 |
object) that display content related to a Java Server Page object. This can |
| 48 |
all be done without the "lower level" NCEs (resources, Java) being aware of the existence of the "outer" NCEs (JSP). |
| 49 |
Further, it's possible for outer NCEs to override by suppressing processing associated with |
| 50 |
lower level NCEs according to their requirements. And even further, it's possible (using |
| 51 |
the pipelining mechanism) for even level in this cascaded set of NCEs to arrange the presentation |
| 52 |
of the objects according to their specifications, moving, adding, or suppressing objects as necessary. |
| 53 |
</p> |
| 54 |
|
| 55 |
<p>???The CNF has depends only on <code>org.eclipse.ui</code> |
| 56 |
and is suitable for use both within the IDE and in an RCP application.</p> |
| 57 |
|
| 58 |
<p>The CNF is highly configurable and many of its components can be used separately (though this is not |
| 59 |
the typical case). For example, |
| 60 |
it's possible use the service that manages content extensions with a viewer other than the standard |
| 61 |
<code>CommonViewer</code>. </p> |
| 62 |
|
| 63 |
|
| 64 |
<h2>Major Components of the Common Navigator Framework</h2> |
| 65 |
|
| 66 |
<p>The CNF has the following major parts:</p> |
| 67 |
<ol> |
| 68 |
<li><b>View Part</b> - <b><a |
| 69 |
href="../reference/api/org/eclipse/ui/navigator/CommonNavigator.html">CommonNavigator |
| 70 |
</a></b>.</li> |
| 71 |
<li><b>Viewer</b> -<b><a |
| 72 |
href="../reference/api/org/eclipse/ui/navigator/CommonViewer.html">CommonViewer |
| 73 |
</a></b> the implementation of a viewer that is contained in the above view |
| 74 |
part.</li> |
| 75 |
<li><b>Navigator Content Service</b> - <b><a |
| 76 |
href="../reference/api/org/eclipse/ui/navigator/INavigatorContentService.html">INavigatorContentService |
| 77 |
</a></b> a service that manages content extensions and allows them to be |
| 78 |
discovered based on objects associated with a viewer. Most users do not |
| 79 |
interact directly with the Content Service, but it is possible to use |
| 80 |
it independently from the common navigator view part.</li> |
| 81 |
</ol> |
| 82 |
|
| 83 |
<h2>Navigators - Where the CNF Fits</h2> |
| 84 |
|
| 85 |
<p>There are currently 3 major navigators in the Eclipse IDE.</p> |
| 86 |
<ol> |
| 87 |
<li><b>Project Explorer</b> - This is an instance of the CommonNavigator that is provided by the <b><a |
| 88 |
href="../reference/api/org/eclipse/ui/navigator/resources/package-summary.html"> |
| 89 |
org.eclipse.ui.navigator.resources</a></b> plugin. It provides a view of the workspace |
| 90 |
and has a large number of NCEs contributed for resources, Java, C, Web Tools, Data Tools, PHP, etc.</li> |
| 91 |
<li> |
| 92 |
<b>Package Explorer</b> - Provided by the Java Development Tools (JDT) UI project, this provides |
| 93 |
a view of Java classes for the workspace. Generally speaking, the presentation of the Package Explorer |
| 94 |
and Project Explorer for Java objects is substantially similar. The JDT is not used for projects beyond Java. |
| 95 |
</li> |
| 96 |
<li><b>Navigator</b> - This view is an implementation of the now deprecated (as of 3.5) |
| 97 |
ResourceNavigator class |
| 98 |
provided in the <code>org.eclipse.ui.ide</code> plugin. It shows only the workspace resources and does not |
| 99 |
support extensibility to show other content. In a future release, the Navigator view will |
| 100 |
be provided by an implementation of the CommonNavigator. |
| 101 |
</li> |
| 102 |
</ol> |
| 103 |
<p>The only navigator intended for general purpose client use if the CNF, which can be used |
| 104 |
either by adding NCEs visable in the Project Explorer (if developing an IDE plugin), or using a |
| 105 |
separate instance of the CommonNavigator as a view.</p> |
| 106 |
|
| 107 |
|
| 20 |
|
108 |
|
| 21 |
<p>The Common Navigator Framework (CNF) provides a general purpose |
109 |
<p>The Common Navigator Framework (CNF) provides a general purpose |
| 22 |
configurable navigator view which can be shared by many applications |
110 |
configurable navigator view which can be shared by many applications |