<?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
Yu-Fen Kuo (MontaVista)       - [170910] Integrate Terminal with RSE
Anna Dushistova  (MontaVista) - [227535] [rseterminal][api] terminals.ui should not depend on files.core
Anna Dushistova  (MontaVista) - [234274][api] Launch Shell / Terminal commands menu placement and category
Anna Dushistova  (MontaVista) - [235934] Launch Shell/Terminal commands enabled when selection is empty
Anna Dushistova  (MontaVista) - [251492] Launch Shell Action is enabled in Offline mode
Kevin Doyle		 (IBM)		  - [249320] Launch Shell action not available in Remote System Details/Monitor views
Anna Dushistova  (MontaVista) - [257638] [rseterminal] Terminal subsystem doesn't have service properties
Uwe Stieber      (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point
-->
<?eclipse version="3.2"?>
<plugin>

    <extension point="org.eclipse.core.runtime.adapters">
        <!-- ITerminalServiceSubSystemConfiguration --> 
        <factory 
                class="org.eclipse.rse.internal.terminals.ui.configuration.adapter.TerminalServiceSubSystemConfigurationAdapterFactory" 
                adaptableType="org.eclipse.rse.subsystems.terminals.core.ITerminalServiceSubSystemConfiguration">
            <adapter type="org.eclipse.rse.ui.subsystems.ISubSystemConfigurationAdapter"/>
        </factory> 
        <factory 
            class="org.eclipse.rse.internal.terminals.ui.views.TerminalViewElementsAdapterFactory" 
            adaptableType="org.eclipse.rse.subsystems.terminals.core.elements.TerminalElement">
            <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"/>
        </factory> 
    </extension>
   <extension
         point="org.eclipse.ui.views">
      <view
            name="%terminalsView.name"
            icon="icons/terminal_view.gif"
            category="org.eclipse.rse.ui.view"
            class="org.eclipse.rse.internal.terminals.ui.views.TerminalViewer"
            id="org.eclipse.rse.terminals.ui.view.TerminalView">
      </view>
    </extension>
    <extension
           point="org.eclipse.ui.menus">
        <menuContribution
              locationURI="popup:org.eclipse.rse.views.common?after=additions">
           <command
                 commandId="org.eclipse.rse.terminals.ui.actions.LaunchTerminalCommand"
                 icon="icons/terminal_view.gif"
                 label="%Launch_Terminal_Label"
                 tooltip="%Launch_Terminal_Tooltip">
             <visibleWhen>
               <with variable="selection">
			     <count value="1" />
               <iterate>
               <and>
                  <test
                        property="org.eclipse.rse.core.isOffline"
                        value="false">
                  </test>
                  <or>
                    <and>
                      <test
                          args="terminals"
                          property="org.eclipse.rse.core.hasSubSystemCategory"
                          value="true">
                      </test>
                      <instanceof
                          value="org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile">
                      </instanceof>
                      <test
                          property="org.eclipse.rse.subsystems.files.isdirectory"
                          value="true">
                      </test>
                    </and>
                    <instanceof
                        value="org.eclipse.rse.subsystems.terminals.core.ITerminalServiceSubSystem">
                    </instanceof>
                  </or>
                 </and>
                </iterate>
              </with> 
            </visibleWhen>
          </command> 
       </menuContribution>  
     </extension>      
     <extension point="org.eclipse.ui.commands">
        <command
              categoryId="org.eclipse.rse.ui.commands.category"
              id="org.eclipse.rse.terminals.ui.actions.LaunchTerminalCommand"
              name="%Launch_Terminal_Label">
        </command>
     </extension>
     <extension
           point="org.eclipse.ui.handlers">
        <handler
              class="org.eclipse.rse.internal.terminals.ui.handlers.LaunchTerminalCommandHandler"
              commandId="org.eclipse.rse.terminals.ui.actions.LaunchTerminalCommand">
        </handler>
     </extension>
     <extension
         point="org.eclipse.ui.propertyPages">   
      <page
            name="%Terminals.Service"
            class="org.eclipse.rse.internal.terminals.ui.propertypages.TerminalServicesPropertyPage"
            id="org.eclipse.rse.terminals.ui.propertypages.TerminalServicesPropertyPage">
         <enabledWhen>
            <instanceof value="org.eclipse.rse.subsystems.terminals.core.TerminalServiceSubSystem"/>
         </enabledWhen>
      </page>
   </extension>
</plugin>
