Project Navigator [message #303501] |
Tue, 16 May 2006 14:28  |
Eclipse User |
|
|
|
Originally posted by: lars.nospam.dontspam.no
Hi,
I'm about to finish out in-house IDE and I would like the navigator to show
only projects with a specific nature.
I would also like to filter out files with a leading dot (e.g. .project etc)
What is the best approach for this. For pre 3.2 plug-ins I have seen
examples with TreeViewer with advanced
resource handling mechanism. In 3.2 I understand that there is some new
navigator API available, but I have not
found any good examples on this.
Please advice what is the best approach (targeting 3.2 and beyond)
A req. for my solution is that VCS (like ClearCase) is selecteable for
context menus (thus allowing check-in / check-out) from
our own project navigator view.
Any help/hints appreciated
BR
L
|
|
|
|
Re: Project Navigator [message #303683 is a reply to message #303564] |
Thu, 18 May 2006 22:39  |
Eclipse User |
|
|
|
Hi Lars,
Take a look at the org.eclipse.ui.navigator.navigatorContent extension
point and specifically the "commonFilter" element defined there. To hide
projects that do not have a specific nature (in the Project Explorer),
you'll need to add one of these extensions. Be sure to also define a
viewerContentBinding for this filter for the view id
"org.eclipse.ui.navigator.ProjectExplorer". The best examples available
currently are in the code (as Michael points out) and the slides from
Eclipse Con
( http://eclipsezilla.eclipsecon.org/php/attachment.php?bugid= 260). The
*. filter is available by default.
If you're defining your own view, you can use the Common Navigator
default view part implementation
(org.eclipse.ui.navigator.CommonNavigator) to get the view up and
running, with your own custom view id. You'll need to define an
org.eclipse.ui.views extension referencing the class
(org.eclipse.ui.navigator.CommonNavigator), and an
org.eclipse.ui.navigator.viewer/viewer extension that configures the
viewer. From there you can define bindings (via
org.eclipse.ui.navigator.viewer/viewerContentBinding) to absorb the
default resource content and filters. You can also declare your own
extensions (org.eclipse.ui.navigator.navigatorContent) to add filters,
just like you can to the default Project Explorer. If you want the
resource content and actions, declare an extension like:
<extension point="org.eclipse.ui.views">
<view category="org.eclipse.ui"
class="org.eclipse.ui.navigator.CommonNavigator" icon="--your icon
here--" id="--your viewer id here--" name="--your viewer name--" />
</extension>
<extension point="org.eclipse.ui.navigator.viewer">
<viewer viewerId="--your viewer id here--">
<popupMenu allowsPlatformContributions="true" id="--your viewer id
here--#PopupMenu">
<insertionPoint name="group.new" />
<insertionPoint name="group.open" separator="true" />
<insertionPoint name="group.openWith" />
<insertionPoint name="group.edit" separator="true" />
<insertionPoint name="group.reorganize" />
<insertionPoint name="group.port" separator="true" />
<insertionPoint name="group.build" separator="true" />
<insertionPoint name="group.generate" separator="true" />
<insertionPoint name="group.search" separator="true" />
<insertionPoint name="additions" separator="true" />
<insertionPoint name="group.properties" separator="true" />
</popupMenu>
</viewer>
<viewerContentBinding viewerId="--your viewer id here--">
<includes>
<contentExtension pattern="org.eclipse.ui.navigator.resourceContent" />
<contentExtension
pattern="org.eclipse.ui.navigator.resources.filters.*" />
<contentExtension
pattern="org.eclipse.ui.navigator.resources.linkHelper" />
</includes>
</viewerContentBinding>
<viewerActionBinding viewerId="--your viewer id here--">
<includes>
<actionExtension pattern="org.eclipse.ui.navigator.resources.*" />
</includes>
</viewerActionBinding>
<dragAssistant
class=" org.eclipse.ui.navigator.resources.ResourceDragAdapterAssist ant "
viewerId="--your viewer id here--" />
</extension>
As for the actions, you will either need to use the plugins provided to
you by the repository provider; or define your own. The Common Navigator
framework provides support for standard object/viewer contributions (see
org.eclipse.ui.popupMenus) or for solutions that require more
programmatic control, you can use
org.eclipse.ui.navigator.navigatorContent: actionProvider or
navigatorContent/actionProvider if the actions are associated with a
particular extension.
HTH,
Michael D. Elder
Michael Valenta wrote:
> Lars,
>
> The org.eclipse.ui.navigator plugin contains the Common Navigator
> framework and the org.eclipse.ui.navigator.resources plugin defines a
> content extension that for Resources. This is the best plkace to start
> if you are looking for an example.
>
> Michael
>
> Lars wrote:
>> Hi,
>>
>> I'm about to finish out in-house IDE and I would like the navigator to
>> show only projects with a specific nature.
>> I would also like to filter out files with a leading dot (e.g.
>> .project etc)
>>
>> What is the best approach for this. For pre 3.2 plug-ins I have seen
>> examples with TreeViewer with advanced
>> resource handling mechanism. In 3.2 I understand that there is some
>> new navigator API available, but I have not
>> found any good examples on this.
>>
>> Please advice what is the best approach (targeting 3.2 and beyond)
>>
>> A req. for my solution is that VCS (like ClearCase) is selecteable for
>> context menus (thus allowing check-in / check-out) from
>> our own project navigator view.
>>
>> Any help/hints appreciated
>>
>>
>> BR
>>
>> L
>>
>>
>>
>>
>>
>>
>>
|
|
|
Powered by
FUDForum. Page generated in 0.03298 seconds