alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>

   <!-- Phase 1 -->
   <!-- Declare the view part to hold the default implementation --> 
   <extension
         point="org.eclipse.ui.views">
      <category
            id="org.eclipse.ui.examples.navigator.category"
            name="Common Navigator Examples"/>
      <view
            allowMultiple="false"
            class="org.eclipse.ui.navigator.CommonNavigator"
            icon="icons/filenav_nav.gif"
            id="org.eclipse.ui.examples.navigator.view"
            name="Example View"/>
   </extension>
   
   <!-- Declare the viewer configuration, and the default content/action bindings -->
   <extension
         point="org.eclipse.ui.navigator.viewer">
      <viewer viewerId="org.eclipse.ui.examples.navigator.view">
         <popupMenu
                allowsPlatformContributions="true"
                id="org.eclipse.ui.examples.navigator.view#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="org.eclipse.ui.examples.navigator.view">
         <includes>
            <contentExtension pattern="org.eclipse.ui.navigator.resourceContent"/>
            <contentExtension pattern="org.eclipse.ui.navigator.resources.filters.*"/> 
            <contentExtension pattern="org.eclipse.ui.examples.navigator.filters.*"/> 
         </includes>
      </viewerContentBinding>
      <viewerActionBinding viewerId="org.eclipse.ui.examples.navigator.view">
         <includes>
            <actionExtension pattern="org.eclipse.ui.navigator.resources.*"/>
         </includes>
      </viewerActionBinding>
   </extension>
   
   <!-- Declare a simple filter example that uses core expressions -->
   <extension
         point="org.eclipse.ui.navigator.navigatorContent">
      <commonFilter
            id="org.eclipse.ui.examples.navigator.filters.hideNonJavaProjects"
            name="Hide non-Java Projects">
         <filterExpression>
            <not>
               <adapt type="org.eclipse.core.resources.IProject">
                  <test
                        property="org.eclipse.core.resources.projectNature"
                        value="org.eclipse.jdt.core.javanature"/>
               </adapt>
            </not>
         </filterExpression>
      </commonFilter>
   </extension>
  
  <!-- Phase 2 -->
  <!-- Declare a content extension that renders the contents of a properties file -->
  <extension
         point="org.eclipse.ui.navigator.navigatorContent">
         
      <navigatorContent 
            id="org.eclipse.ui.examples.navigator.propertiesContent" 
            name="Properties File Contents"
            contentProvider="org.eclipse.ui.examples.navigator.PropertiesContentProvider"
            labelProvider="org.eclipse.ui.examples.navigator.PropertiesLabelProvider" 
            activeByDefault="true"
            icon="icons/prop_ps.gif"
            priority="normal" >
         <triggerPoints>
         	<or>
	            <and>
	               <instanceof value="org.eclipse.core.resources.IResource"/>
	               <test
	                     forcePluginActivation="true"
	                     property="org.eclipse.core.resources.extension"
	                     value="properties"/>
	            </and>
				<instanceof value="org.eclipse.ui.examples.navigator.PropertiesTreeData"/>
			</or>
         </triggerPoints>
         <possibleChildren>
            <or>
               <instanceof value="org.eclipse.ui.examples.navigator.PropertiesTreeData"/> 
            </or>
         </possibleChildren>
         <actionProvider
               class="org.eclipse.ui.examples.navigator.actions.PropertyActionProvider"
               id="org.eclipse.ui.examples.navigator.properties.actions.OpenProvider"/>
      </navigatorContent>
   </extension>
   
   <!-- Bind the Properties content extension to the viewer -->
   <extension
         point="org.eclipse.ui.navigator.viewer">
      <viewerContentBinding viewerId="org.eclipse.ui.examples.navigator.view">
         <includes>
            <contentExtension pattern="org.eclipse.ui.examples.navigator.propertiesContent"/>
         </includes>
      </viewerContentBinding>
   </extension>
   
   <!-- Contribute an Object Contribution to delete individual properties in the view -->
   <extension
         point="org.eclipse.ui.popupMenus">
      <objectContribution
            adaptable="false"
            id="org.eclipse.ui.examples.navigator.actions.propertiesResource"
            objectClass="org.eclipse.ui.examples.navigator.PropertiesTreeData">
         <action
               class="org.eclipse.ui.examples.navigator.actions.DeletePropertyAction"
               enablesFor="1"
               helpContextId="org.eclipse.ui.edit.delete"
               icon="icons/delete_obj.gif"
               id="org.eclipse.ui.examples.navigator.actions.deleteProperty"
               label="Delete Property"
               menubarPath="group.edit"
               tooltip="Delete a specific property"/>
      </objectContribution> 
   </extension>
   
   <!-- 
   	Bind the Action Provider independently 
   <extension
         point="org.eclipse.ui.navigator.navigatorContent">         
     <actionProvider
           class="org.eclipse.ui.examples.navigator.actions.PropertyActionProvider"
           id="org.eclipse.ui.examples.navigator.properties.actions.OpenProvider"/> 
   </extension>
   
   <extension
         point="org.eclipse.ui.navigator.viewer">
      <viewerActionBinding viewerId="org.eclipse.ui.examples.navigator.view">
         <includes>
            <actionExtension 
            	pattern="org.eclipse.ui.examples.navigator.properties.actions.*"/>
         </includes>
      </viewerActionBinding>
   </extension> 
   
   -->
  
  
</plugin>
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.