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

   <extension
         id="application"
         point="org.eclipse.core.runtime.applications">
      <application>
         <run
               class="org.eclipse.emf.example.databinding.project.ui.rcp.Application">
         </run>
      </application>
   </extension>
   <extension
         point="org.eclipse.ui.perspectives">
      <perspective
            name="%perspective.name"
            class="org.eclipse.emf.example.databinding.project.ui.rcp.Perspective"
            id="org.eclipse.emf.example.project.ui.rcp.perspective">
      </perspective>
   </extension>
   <extension
         point="org.eclipse.ui.views">
      <view
            allowMultiple="true"
            class="org.eclipse.emf.example.databinding.project.ui.rcp.views.ProjectAdminViewPart"
            id="org.eclipse.emf.example.databinding.project.ui.rcp.views.ProjectAdminViewPart"
            name="%view.name"
            restorable="true">
      </view>
   </extension>
   <extension
         point="org.eclipse.ui.services">
      <sourceProvider
            provider="org.eclipse.emf.example.databinding.project.ui.rcp.ResourceProvider">
         <variable
               name="modelresource"
               priorityLevel="activePartId">
         </variable>
         <variable
               name="committer"
               priorityLevel="activePartId">
         </variable>
         <variable
               name="project"
               priorityLevel="activePartId">
         </variable>
      </sourceProvider>
   </extension>
   <extension
         point="org.eclipse.ui.commands">
      <command
            id="org.eclipse.emf.examples.databinding.project.ui.rcp.newperson"
            name="%command.name">
         <commandParameter
               id="org.eclipse.emf.examples.databinding.project.ui.rcp.person.action"
               name="%commandParameter.name"
               optional="true"
               values="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.PersonParamValues">
         </commandParameter>
      </command>
      <command
            id="org.eclipse.emf.examples.databinding.project.ui.rcp.editperson"
            name="%command.name.0">
         <commandParameter
               id="org.eclipse.emf.examples.databinding.project.ui.rcp.person.action"
               name="%commandParameter.name.0"
               optional="true"
               values="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.PersonParamValues">
         </commandParameter>
      </command>
      <command
            defaultHandler="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.OpenXMIHandler"
            id="org.eclipse.emf.examples.databinding.project.ui.rcp.openxmi"
            name="%command.name.1">
      </command>
      <command
            defaultHandler="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.NewXMIHandler"
            id="org.eclipse.emf.examples.databinding.project.ui.rcp.newxmi"
            name="%command.name.2">
      </command>
      <command
            id="org.eclipse.emf.examples.databinding.project.ui.rcp.createtopproject"
            name="%command.name.3">
      </command>
      <command
            id="org.eclipse.emf.examples.databinding.project.ui.rcp.createsubproject"
            name="%command.name.4">
      </command>
      <command
            id="org.eclipse.emf.examples.databinding.project.ui.rcp.newcommittership"
            name="%command.name.5">
      </command>
      <command
            id="org.eclipse.emf.examples.databinding.project.ui.rcp.editcommittership"
            name="%command.name.6">
      </command>
   </extension>
   <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            locationURI="popup:org.eclipse.emf.examples.databinding.project.ui.rcp.projectexp?after=additions">
         <command
               commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.editperson"
               label="%command.label"
               style="push">
            <parameter
                  name="org.eclipse.emf.examples.databinding.project.ui.rcp.person.action"
                  value="edit">
            </parameter>
            <visibleWhen
                  checkEnabled="true">
            </visibleWhen>
         </command>
         <command
               commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.newcommittership"
               label="%command.label.0"
               style="push">
            <visibleWhen
                  checkEnabled="true">
               <with
                     variable="activeMenuSelection">
                  <and>
                     <count
                           value="1">
                     </count>
                     <iterate
                           ifEmpty="false"
                           operator="and">
                        <instanceof
                              value="org.eclipse.emf.examples.databinding.project.core.model.project.Project">
                        </instanceof>
                     </iterate>
                  </and>
               </with>
            </visibleWhen>
         </command>
         <command
               commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.editcommittership"
               label="%command.label.1"
               style="push">
            <visibleWhen
                  checkEnabled="true">
            </visibleWhen>
         </command>
         <command
               commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.createsubproject"
               label="%command.label.2"
               style="push">
            <visibleWhen
                  checkEnabled="true">
               <with
                     variable="activeMenuSelection">
                  <and>
                     <count
                           value="1">
                     </count>
                     <iterate
                           ifEmpty="false"
                           operator="and">
                        <instanceof
                              value="org.eclipse.emf.examples.databinding.project.core.model.project.Project">
                        </instanceof>
                     </iterate>
                  </and>
               </with>
            </visibleWhen>
         </command>
      </menuContribution>
      <menuContribution
            locationURI="menu:open?after=additions">
         <command
               commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.openxmi"
               label="%command.label.3"
               style="push">
         </command>
      </menuContribution>
      <menuContribution
            locationURI="menu:new?before=after_resource">
         <command
               commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.newxmi"
               label="%command.label.4"
               style="push">
         </command>
      </menuContribution>
      <menuContribution
            locationURI="menu:new?after=after_resource">
         <command
               commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.createsubproject"
               label="%command.label.5"
               style="push">
         </command>
      </menuContribution>
      <menuContribution
            locationURI="menu:new?after=after_resource">
         <command
               commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.createtopproject"
               label="%command.label.6"
               style="push">
         </command>
      </menuContribution>
      <menuContribution
            locationURI="menu:new?after=after_resource">
         <command
               commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.newperson"
               label="%command.label.7"
               style="push">
            <parameter
                  name="org.eclipse.emf.examples.databinding.project.ui.rcp.person.action"
                  value="new">
            </parameter>
         </command>
      </menuContribution>
   </extension>
   <extension
         point="org.eclipse.ui.handlers">
      <handler
            class="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.PersonEditingHandler"
            commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.editperson">
         <enabledWhen>
            <and>
            <with
                  variable="committer">
               <not>
                  <equals
                        value="null">
                  </equals>
               </not>
            </with>
            <with
                  variable="modelresource">
               <not>
                  <equals
                        value="null">
                  </equals>
               </not>
            </with>
            </and>
            
         </enabledWhen>
      </handler>
      <handler
            class="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.CreateToplevelProjectHandler"
            commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.createtopproject">
         <enabledWhen>
            <with
                  variable="modelresource">
               <not>
                  <equals
                        value="null">
                  </equals>
               </not>
            </with>
         </enabledWhen>
      </handler>
      <handler
            class="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.CreateSublevelProjectHandler"
            commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.createsubproject">
         <enabledWhen>
            <and>
               <with
                     variable="project">
                  <not>
                     <equals
                           value="null">
                     </equals>
                  </not>
               </with>
               <with
                     variable="modelresource">
                  <not>
                     <equals
                           value="null">
                     </equals>
                  </not>
               </with>
            </and>
         </enabledWhen>
      </handler>
      <handler
            class="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.CreateCommittershipHandler"
            commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.newcommittership">
         <enabledWhen>
            <and>
               <with
                     variable="project">
                  <not>
                     <equals
                           value="null">
                     </equals>
                  </not>
               </with>
               <with
                     variable="modelresource">
                  <not>
                     <equals
                           value="null">
                     </equals>
                  </not>
               </with>
            </and>
         </enabledWhen>
      </handler>
      <handler
            class="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.PersonEditingHandler"
            commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.newperson">
         <enabledWhen>
            <with
                  variable="modelresource">
               <not>
                  <equals
                        value="null">
                  </equals>
               </not>
            </with>
         </enabledWhen>
      </handler>
      <handler
            class="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.EditCommittershipHandler"
            commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.editcommittership">
         <enabledWhen>
            <and>
               <with
                     variable="committer">
                  <not>
                     <equals
                           value="null">
                     </equals>
                  </not>
               </with>
               <with
                     variable="modelresource">
                  <not>
                     <equals
                           value="null">
                     </equals>
                  </not>
               </with>
            </and>
         </enabledWhen>
      </handler>
   </extension>

</plugin>
