<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2006, 2009 IBM Corporation and others. All rights reserved.
This program and the accompanying materials are made available under the terms
of the Eclipse Public License v1.0 which accompanies this distribution, and is 
available at http://www.eclipse.org/legal/epl-v10.html

Initial Contributors:
The following IBM employees contributed to the Remote System Explorer
component that contains this file: David McKnight, Kushal Munir, 
Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, 
Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.

Contributors:
Martin Oberhuber (Wind River) - [180519] declaratively register adapter factories
Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
Martin Oberhuber (Wind River) - [186748] Move ISubSystemConfigurationAdapter from UI/rse.core.subsystems.util
David McKnight (IBM) - [187711] Link with Editor action for System View
David McKnight (IBM) - [209593] [api] add support for "file permissions" and "owner" properties for unix files
Johnson Ma (Wind River) - [195402] Add tar.gz archive support
David McKnight   (IBM)        - [261019] New File/Folder actions available in Work Offline mode
David McKnight   (IBM)        - [218227][usability] Contribute a "Show in RSE" action to Resource Navigator and Project Explorer
David McKnight   (IBM)        - [328617] synchronize cache operation should also support individual files
-->
<?eclipse version="3.0"?>
<plugin>

<!-- ============================================ -->
<!-- Register Adapter Factories                   -->
<!-- ============================================ -->
 
	<extension point="org.eclipse.core.runtime.adapters">
		<!-- Remote Files --> 
		<factory 
			class="org.eclipse.rse.internal.files.ui.view.SystemViewFileAdapterFactory" 
			adaptableType="org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile">
            <adapter type="org.eclipse.rse.ui.view.ISystemViewElementAdapter"/>
			<!-- all adapter types which are subject to getAdapter() need to be registered! -->
			<!-- just having it in AdapterFactory#getAdapterList() is not sufficient. -->
			<adapter type="org.eclipse.rse.core.subsystems.ISystemDragDropAdapter"/>
			<adapter type="org.eclipse.rse.ui.view.ISystemRemoteElementAdapter"/>
			<adapter type="org.eclipse.ui.views.properties.IPropertySource"/>
			<adapter type="org.eclipse.ui.model.IWorkbenchAdapter"/>
			<adapter type="org.eclipse.ui.IActionFilter"/>
			<adapter type="org.eclipse.ui.progress.IDeferredWorkbenchAdapter"/>
			<!-- TODO Check: These are not in the adapter factories 
			     getAdapterList() Although the adapter implements them
			<adapter type="org.eclipse.rse.core.subsystems.IRemoteObjectIdentifier"/>
			-->
		</factory> 
		<!-- SearchResultSet --> 
		<factory 
				class="org.eclipse.rse.internal.files.ui.view.SystemViewSearchResultSetAdapterFactory" 
				adaptableType="org.eclipse.rse.services.search.IHostSearchResultSet">
            <adapter type="org.eclipse.rse.ui.view.ISystemViewElementAdapter"/>
			<adapter type="org.eclipse.rse.ui.view.ISystemRemoteElementAdapter"/>
			<adapter type="org.eclipse.ui.views.properties.IPropertySource"/>
			<adapter type="org.eclipse.ui.model.IWorkbenchAdapter"/>
			<adapter type="org.eclipse.ui.IActionFilter"/>
			<!-- TODO Check: These are not in the adapter factories 
			     getAdapterList() Although the adapter implements them
			<adapter type="org.eclipse.ui.progress.IDeferredWorkbenchAdapter"/>
			<adapter type="org.eclipse.rse.core.subsystems.ISystemDragDropAdapter"/>
			<adapter type="org.eclipse.rse.core.subsystems.IRemoteObjectIdentifier"/>
			<adapter type="org.eclipse.rse.ui.view.ISystemRemoveElementAdapter"/>
			-->
		</factory>
		<!-- SearchResult --> 
		<factory 
				class="org.eclipse.rse.internal.files.ui.view.SystemViewSearchResultAdapterFactory" 
				adaptableType="org.eclipse.rse.services.search.IHostSearchResult">
            <adapter type="org.eclipse.rse.ui.view.ISystemViewElementAdapter"/>
			<adapter type="org.eclipse.rse.core.subsystems.ISystemDragDropAdapter"/>
			<adapter type="org.eclipse.rse.ui.view.ISystemRemoteElementAdapter"/>
			<adapter type="org.eclipse.ui.views.properties.IPropertySource"/>
			<adapter type="org.eclipse.ui.model.IWorkbenchAdapter"/>
			<adapter type="org.eclipse.ui.IActionFilter"/>
			<!-- TODO Check: These are not in the adapter factories 
			     getAdapterList() Although the adapter implements them
			<adapter type="org.eclipse.ui.progress.IDeferredWorkbenchAdapter"/>
			<adapter type="org.eclipse.rse.core.subsystems.IRemoteObjectIdentifier"/>
			-->
		</factory>
		<!-- SubSystemConfiguration --> 
		<factory 
				class="org.eclipse.rse.internal.files.ui.view.RemoteFileSubSystemConfigurationAdapterFactory" 
				adaptableType="org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystemConfiguration">
            <adapter type="org.eclipse.rse.ui.subsystems.ISubSystemConfigurationAdapter"/>
		</factory> 
	</extension>
 
<!-- ============================================ -->
<!-- Define Files Preference Pages                -->
<!-- ============================================ -->
  
	<extension
		point="org.eclipse.ui.preferencePages">
      <page
            name="%PreferencePage.UniversalFiles"
            category="org.eclipse.rse.ui.preferences.RemoteSystemsPreferencePage"
            class="org.eclipse.rse.internal.files.ui.propertypages.UniversalPreferencePage"
            id="org.eclipse.rse.files.ui.UniversalFilesPreferences">
      </page>

      <page
            name="%PreferencePage.Cache"
            category="org.eclipse.rse.ui.preferences.RemoteSystemsPreferencePage"
            class="org.eclipse.rse.internal.files.ui.propertypages.SystemCachePreferencePage"
            id="org.eclipse.rse.core.ui.preferences.SystemCachePreferencePage">
      </page>
   </extension>
   
   
<!-- ============================================ -->
<!-- Define Remote Object Properties Pages        -->
<!-- ============================================ -->
  <extension 
       point="org.eclipse.ui.propertyPages">
      <page 
            name="%RemotePropertyPage.File.Info"
            class="org.eclipse.rse.internal.files.ui.propertypages.SystemFilePropertyPage"
            id="org.eclipse.rse.files.PropertyPage">
           <enabledWhen>
             <instanceof value="org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile"/>
         </enabledWhen>
      </page>     
      <page 
            name="%RemotePropertyPage.File.Permissions"
            class="org.eclipse.rse.internal.files.ui.propertypages.SystemFilePermissionsPropertyPage"
            id="org.eclipse.rse.files.PermissionsPropertyPage">
           <enabledWhen>
             <instanceof value="org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile"/>
   			</enabledWhen>
   			  <filter name="supportspermissions" value="true"/>
   
      </page>      
   </extension>
   
   
<!-- ============================================ -->
<!-- Define Workbench Properties Pages            -->
<!-- ============================================ -->
   <extension
         point="org.eclipse.ui.propertyPages">
<!--
      <page
            objectClass="org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem"
            name="%PropertyPage.EnvVariables"
            class="org.eclipse.rse.core.ui.propertypages.EnvironmentVariablesPropertyPage"
            id="org.eclipse.rse.EnvironmentVariablesPropertyPage">
            <filter name="envVarPP" value="true"/>
      </page> 
-->
      <page
            name="%PropertyPage.ServerLauncherSettings" 
            class="org.eclipse.rse.internal.ui.propertypages.ServerLauncherPropertyPage"
            id="org.eclipse.rse.ui.propertypages.ServerLauncherPropertyPage">
            <filter name="serverLaunchPP" value="true"/>
         <enabledWhen>
            <instanceof value="org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem"/>
         </enabledWhen>
      </page>

      
       <page
            name="%PropertyPage.Service"
            class="org.eclipse.rse.internal.files.ui.propertypages.FileServicesPropertyPage"
            id="org.eclipse.rse.files.ui.propertypages.FileServicesPropertyPage">
         <enabledWhen>
            <instanceof value="org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSystem"/>
         </enabledWhen>
      </page>
      
   </extension>
   
   

<!-- ================================================================= -->
<!-- Flag file types used by the RemoteSystemsConnection project for   -->
<!-- more intelligent team sync support			                       -->
<!-- ================================================================= -->
	<extension point="org.eclipse.team.core.fileTypes">
  		<fileTypes extension="xmi" type="text"/>
  	</extension>

<!-- ================================================================= -->
<!--     Hide RemoteSystemsConnections and RemoteSystemsTempFiles      -->
<!-- 	 in the Navigator view					                       -->
<!-- ================================================================= -->
	<extension
         point="org.eclipse.ui.ide.resourceFilters">
      <filter
            selected="true"
            pattern="RemoteSystemsConnections">
      </filter>
      <filter
            selected="true"
            pattern="RemoteSystemsTempFiles">
      </filter>
	</extension>
	

    
<!-- ================================================================= -->
<!--     Hide RemoteSystemsConnections and RemoteSystemsTempFiles      -->
<!-- 	 in the JDT view					                       -->
<!-- ================================================================= -->	
	<extension
		 point="org.eclipse.jdt.ui.javaElementFilters">
        <filter
      		targetId="org.eclipse.jdt.ui.PackageExplorer"
            name="%ViewFilter.RSEConnections"
            enabled="true"
            description=""
            pattern="RemoteSystemsConnections">
        </filter>
      <filter
   		targetId="org.eclipse.jdt.ui.PackageExplorer"
            name="%ViewFilter.RSETempFiles"
            enabled="true"
            description=""
            pattern="RemoteSystemsTempFiles">
      </filter>    
    </extension>

<!-- ================================================================= -->
<!--     Hide RemoteSystemsConnections and RemoteSystemsTempFiles      -->
<!-- 	 in the CDT CView					                       -->
<!-- ================================================================= -->	
	<extension
		 point="org.eclipse.cdt.ui.CElementFilters">
        <filter
      		targetId="org.eclipse.cdt.ui.CView"
            name="%ViewFilter.RSEConnections"
            enabled="true"
            description=""
            pattern="RemoteSystemsConnections">
        </filter>
        <filter
  	 		targetId="org.eclipse.cdt.ui.CView"
            name="%ViewFilter.RSETempFiles"
            enabled="true"
            description=""
            pattern="RemoteSystemsTempFiles">
		</filter>    
    </extension>
    
	
<!-- ================================================================= -->
<!-- Add a search page for universal, i.e. Linux, Windows and Local == -->
<!-- ================================================================= -->	
   <extension
         point="org.eclipse.search.searchPages">
      <page
            tabPosition="0"
            label="%Search.Page"
            enabled="true"
            icon="icons/full/obj16/system_search.gif"
            class="org.eclipse.rse.internal.files.ui.search.SystemSearchPage"
            sizeHint="250,160"
            id="org.eclipse.rse.internal.files.ui.search.searchPage">
      </page>
   </extension>

   <extension
         point="org.eclipse.ui.actionSets">
      <actionSet
            label="%Remote.ActionSet"
            visible="true"
            id="org.eclipse.rse.core.search.searchActionSet">
         <menu
               label="%searchMenu.label"
               path="navigate"
               id="org.eclipse.search.menu">
            <groupMarker
                  name="internalDialogGroup">
            </groupMarker>
            <groupMarker
                  name="dialogGroup">
            </groupMarker>
            <separator
                  name="contextMenuActionsGroup">
            </separator>
         </menu>
         <action
               label="%Remote.Search"
               tooltip="%Remote.Search.tooltip"
               helpContextId="org.eclipse.rse.core.rsac0000"
               icon="icons/full/obj16/system_search.gif"
               class="org.eclipse.rse.internal.files.ui.search.SystemOpenSearchPageAction"
               menubarPath="org.eclipse.search.menu/dialogGroup"
               id="org.eclipse.rse.core.search.searchAction">
         </action>
      </actionSet>
   </extension>

<!-- ================================================================= -->
<!-- Add handlers for ZIP, TAR, and JAR archive files               == -->
<!-- ================================================================= -->	
   <extension
         point="org.eclipse.rse.services.archivehandlers">
      <archivehandler
            fileNameExtension="zip"
            name="SystemZipHandler"
            class="org.eclipse.rse.services.clientserver.archiveutils.SystemZipHandler"
            id="org.eclipse.rse.services.clientserver.archiveutils.systemziphandler">
      </archivehandler>
      <archivehandler
            fileNameExtension="jar"
            name="SystemJarHandler"
            class="org.eclipse.rse.services.clientserver.archiveutils.SystemJarHandler"
            id="org.eclipse.rse.services.clientserver.archiveutils.systemjarhandler">
      </archivehandler>
      <archivehandler
            fileNameExtension="tar.gz"
            name="SystemTargzHandler"
            class="org.eclipse.rse.services.clientserver.archiveutils.SystemTgzHandler"
            id="org.eclipse.rse.services.clientserver.archiveutils.systemtargzhandler">
      </archivehandler>
      <archivehandler
            fileNameExtension="tgz"
            name="SystemTgzHandler"
            class="org.eclipse.rse.services.clientserver.archiveutils.SystemTgzHandler"
            id="org.eclipse.rse.services.clientserver.archiveutils.systemtgzhandler">
      </archivehandler>
      <archivehandler
            fileNameExtension="tar"
            name="SystemTarHandler"
            class="org.eclipse.rse.services.clientserver.archiveutils.SystemTarHandler"
            id="org.eclipse.rse.services.clientserver.archiveutils.systemtarhandler">
      </archivehandler>
   </extension>

<!-- ================================================================= -->
<!-- Add default mount path mapper              					== -->
<!-- ================================================================= -->	
   <extension
         point="org.eclipse.rse.ui.mountPathMappers">
      <mountPathMapper
            name="DefaultMountPathMapper"
            class="org.eclipse.rse.internal.files.ui.resources.DefaultMountPathMapper"
            id="org.eclipse.rse.core.resources.defaultmountpathmapper">
      </mountPathMapper>
   </extension>
   
   
   
<!-- ================================================================= -->
<!-- Add decorator for virtual, executable and link files              -->
<!-- ================================================================= -->	
	<extension point="org.eclipse.ui.decorators"> 
        <decorator
            id="org.eclipse.rse.core.virtualobject.decorator" 
            label="%VirtualObjectDecorator.label" 
            state="true" 
            lightweight="true" 
            icon="icons/full/ovr16/virtual_tsk.gif" 
            location="BOTTOM_RIGHT"> 
            <enablement>
            	<and>
                	<objectClass name="org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile"/>
                	<objectState name="isVirtual" value="true"/>
                </and> 
            </enablement>
        </decorator>
        <decorator
            id="org.eclipse.rse.core.binary.executable.decorator" 
            label="%BinaryExecutableDecorator.label" 
            state="true" 
            lightweight="true" 
            icon="icons/full/ovr16/exec_binary_ovr.gif" 
            location="BOTTOM_LEFT"> 
            <enablement>
            	<and>
                	<objectClass name="org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile"/>
	               	<objectState name="classification" value="*executable*"/>
                </and> 
            </enablement>
        </decorator>
        <decorator
            id="org.eclipse.rse.core.script.executable.decorator" 
            label="%ScriptExecutableDecorator.label" 
            state="true" 
            lightweight="true" 
            icon="icons/full/ovr16/exscript_ovr.gif" 
            location="BOTTOM_LEFT"> 
            <enablement>
            	<and>
                	<objectClass name="org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile"/>
                	<or>
	                	<objectState name="classification" value="symbolic link(script)*"/>
	                	<and>
		                	<objectState name="classification" value="*script*"/>
		                	<objectState name="classification" value="*executable*"/>
		                </and>
	                </or>
                </and> 
            </enablement>
        </decorator>
        <decorator
            id="org.eclipse.rse.core.java.executable.decorator" 
            label="%JavaExecutableDecorator.label" 
            state="true" 
            lightweight="true" 
            icon="icons/full/ovr16/exec_ovr.gif" 
            location="BOTTOM_LEFT"> 
            <enablement>
            	<and>
                	<objectClass name="org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile"/>
                	<objectState name="classification" value="*executable(java:*)*"/>
                </and> 
            </enablement>
        </decorator>
        <decorator
            id="org.eclipse.rse.core.library.decorator" 
            label="%LibraryDecorator.label" 
            state="true" 
            lightweight="true" 
            icon="icons/full/ovr16/sharedlib_ovr.gif" 
            location="BOTTOM_LEFT"> 
            <enablement>
            	<and> 
                	<objectClass name="org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile"/>
    				<or>
    					<objectState name="classification" value="*module*"/>
    					<objectState name="classification" value="*archive*"/>
    					<objectState name="classification" value="*shared object*"/>
    					<objectState name="extension" value="so a so so.*"/>
    				</or>
                </and> 
            </enablement>
        </decorator>
        <decorator
            id="org.eclipse.rse.core.link.decorator" 
            label="%LinkDecorator.label" 
            state="true" 
            lightweight="true" 
            icon="icons/full/ovr16/symblclnk_ovr.gif" 
            location="TOP_LEFT"> 
            <enablement>
            	<and>
                	<objectClass name="org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile"/>
                	<objectState name="classification" value="symbolic link*"/>
                </and> 
            </enablement>
        </decorator>

    </extension>
      <extension point="org.eclipse.ui.popupMenus">
	      <objectContribution
            objectClass="org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile"
            id="org.eclipse.rse.files.ui.actions.synchronizeCache">          
                <visibility> 
                  <and>
                    <or>
                    	<objectState name="isdirectory" value="true"/>    
                    	<objectState name="isfile" value="true"/>  
                    </or>	
                    <objectState name="isroot" value="false"/> 
                  </and>                  
                </visibility>        
         <action
               label="%synchronizeCache.label"
                tooltip="%synchronizeCache.tooltip"
               class="org.eclipse.rse.internal.files.ui.actions.SynchronizeCacheActionDelegate"
               menubarPath="group.importexport"
               id="synchronizeCache">
               <enablement>
                <objectState name="offline" value="false"/>
               </enablement>
         </action>
      </objectContribution>
      </extension>
      
      <extension
         point="org.eclipse.ui.viewActions">   
    	 <viewContribution
            targetID="org.eclipse.rse.ui.view.systemView"
            id="org.eclipse.rse.ui.view.systemView.toolbar">
        	 <action
               id="org.eclipse.rse.ui.view.systemView.toolbar.linkWithSystemView"
               toolbarPath="navigationGroup"
               class="org.eclipse.rse.internal.files.ui.actions.LinkWithSystemViewAction"
               icon="$nl$/icons/full/elcl16/synced.gif"
               style="toggle"
               helpContextId="link_editor_with_system_view_action_context"
               label="%LinkWithSystemView.label">
        	 </action>
	     </viewContribution>
	   </extension>
	   
	 <extension
         point="org.eclipse.ui.popupMenus">
      <objectContribution
            objectClass="org.eclipse.core.resources.IResource"   
            id="org.eclipse.rse.ui.ShowResourceInSystemsView">
         <action id="org.eclipse.rse.ui.ShowResourceInSystemsViewAction"
               label="%ShowInRSEView.label"
               tooltip="%ShowInRSEView.tooltip"
               class="org.eclipse.rse.internal.files.ui.actions.ShowResourceInSystemsViewDelegate">
               menubarPath="group.goto"
               enablesFor="1"               
               id="showResourceInSystemsView">
         </action>
        </objectContribution>
     </extension>
</plugin>
 