<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<!--
   Copyright (c) 2009, 2018 Red Hat, Inc.
   
   This program and the accompanying materials are made
   available under the terms of the Eclipse Public License 2.0
   which is available at https://www.eclipse.org/legal/epl-2.0/
  
   SPDX-License-Identifier: EPL-2.0

   Contributors:
       Red Hat - initial API and implementation
 -->

<plugin>
   <extension
         point="org.eclipse.ui.importWizards">
      <category
            id="org.eclipse.linuxtools.rpm.ui"
            name="%category.name.0">
      </category>
      <wizard
            name="%wizard.name.1"
            icon="icons/rpm.gif"
            class="org.eclipse.linuxtools.internal.rpm.ui.SRPMImportWizard"
            category="org.eclipse.linuxtools.rpm.ui"
            id="org.eclipse.linuxtools.rpm.ui.SRPMImportWizard">
         <description>
            %wizard.description.1
         </description>
         <selection
               class="org.eclipse.core.resources.IResource">
         </selection>
      </wizard>
   </extension>
    <extension
         point="org.eclipse.ui.propertyPages">
      <page
            class="org.eclipse.linuxtools.internal.rpm.ui.propertypage.SpecFileHeaderPage"
            id="rg.eclipse.linuxtools.rpm.ui.propertypage.SpecFileHeaderPage"
            name="%page.name.0"
            nameFilter="*.rpm">
      </page>
      <page
            class="org.eclipse.linuxtools.internal.rpm.ui.propertypage.ChangelogPage"
            id="org.eclipse.linuxtools.rpm.ui.propertypage.ChangelogPage"
            name="%page.name.1"
            nameFilter="*.rpm">
      </page>
      <page
            class="org.eclipse.linuxtools.internal.rpm.ui.propertypage.TargetPage"
            id="org.eclipse.linuxtools.rpm.ui.propertypage.TargetPage"
            name="%page.name.2"
            nameFilter="*.rpm">
      </page>
      <page
            class="org.eclipse.linuxtools.internal.rpm.ui.propertypage.InstallScriptsPage"
            id="org.eclipse.linuxtools.rpm.ui.propertypage.InstallScriptsPage"
            name="%page.name.3"
            nameFilter="*.rpm">
      </page>
      <page
            class="org.eclipse.linuxtools.internal.rpm.ui.propertypage.ProvidesPage"
            id="org.eclipse.linuxtools.rpm.ui.propertypage.ProvidesPage"
            name="%page.name.4"
            nameFilter="*.rpm">
      </page>
   </extension>
 <extension
       point="org.eclipse.ui.newWizards">
      <wizard
              project="true"
            category="org.eclipse.linuxtools.rpm.ui.editor"
            class="org.eclipse.linuxtools.internal.rpm.ui.RPMNewProject"
            icon="icons/rpm.gif"
            id="org.eclipse.linuxtools.rpm.ui.RPMNewProject"
            name="%wizard.name.2">
      </wizard>
 </extension>
 <extension
       point="org.eclipse.ui.ide.projectNatureImages">
    <image
          icon="icons/rpm.gif"
          id="org.eclipse.linuxtools.rpm.ui.image"
          natureId="org.eclipse.linuxtools.rpm.core.rpmnature">
    </image>
 </extension>
  <extension
         point="org.eclipse.ui.console.consolePatternMatchListeners">
       <consolePatternMatchListener
            class="org.eclipse.linuxtools.internal.rpm.ui.ErrorLineMatcher"
            id="org.eclipse.linuxtools.rpm.ui.ErrorLineMatcher"
            regex=".*(error):\W(line)\W\d{1,}:.*">
         <enablement>
            <test property="org.eclipse.ui.console.consoleTypeTest" value="rpmbuild"/>
         </enablement>
      </consolePatternMatchListener>
   </extension>
  <extension
        id="org.eclipse.linuxtools.rpm.ui.popup"
        name="%extension.name"
        point="org.eclipse.ui.menus">
        <menuContribution
              locationURI="popup:org.eclipse.ui.popup.any?after=additions" >
              <separator
                    name="org.eclipse.linuxtools.rpm.ui.rpmsep1"
                    visible="true">
              </separator>
              <menu
                    icon="icons/rpm.gif"
                    id="org.eclipse.linuxtools.rpm.ui.popup"
                    label="%menu.label">
                 <separator
                       name="org.eclipse.linuxtools.rpm.ui.buildsep"
                       visible="true">
                 </separator>
                 <separator
                       name="org.eclipse.linuxtools.rpm.ui.sourcesep"
                       visible="true">
                 </separator>
                 <separator
                       name="org.eclipse.linuxtools.rpm.ui.miscsep"
                       visible="true">
                 </separator>
              </menu>
              <separator
                    name="org.eclipse.linuxtools.rpm.ui.rpmsep2"
                    visible="true">
              </separator>
        </menuContribution>
        <menuContribution
              locationURI="popup:org.eclipse.linuxtools.rpm.ui.popup?before=org.eclipse.linuxtools.rpm.ui.buildsep">
           <command
                 commandId="rpmEditor.build.command"
                 icon="icons/rpmBuildSRPM_16x16_toolbarIcon.PNG"
                 label="%command.name.0"
                 mnemonic="S"
                 tooltip="%command.name.0">
              <parameter
                    name="buildType"
                    value="SOURCE">
              </parameter>
              <visibleWhen
                    checkEnabled="false">
                 <reference
                       definitionId="org.eclipse.linuxtools.rpm.core.rpmselection">
                 </reference>
              </visibleWhen>
           </command>
           <command
                 commandId="rpmEditor.build.command"
                 icon="icons/rpmBuildRPMS_16x16_toolbarIcon.PNG"
                 label="%command.name.1"
                 mnemonic="R"
                 tooltip="%command.name.1">
              <parameter
                    name="buildType"
                    value="BINARY">
              </parameter>
              <visibleWhen
                    checkEnabled="false">
                 <reference
                       definitionId="org.eclipse.linuxtools.rpm.core.rpmselection">
                 </reference>
              </visibleWhen>
           </command>
           <command
                 commandId="rpmEditor.build.command"
                 icon="icons/rpmBuildAll_16x16_toolbarIcon.PNG"
                 label="%command.name.2"
                 mnemonic="A"
                 tooltip="%command.name.2">
              <visibleWhen
                    checkEnabled="false">
                 <reference
                       definitionId="org.eclipse.linuxtools.rpm.core.rpmselection">
                 </reference>
              </visibleWhen>
              <parameter
                    name="buildType"
                    value="ALL">
              </parameter>
           </command>
        </menuContribution>
  </extension>
  <extension
        point="org.eclipse.ui.commands">
     <command
           id="rpmEditor.build.command"
           name="%command.name.3">
        <commandParameter
              id="buildType"
              name="buildType"
              optional="false">
        </commandParameter>
        <commandParameter
              id="actOnEditor"
              name="actOnEditor"
              optional="true">
        </commandParameter>
     </command>
  </extension>
  <extension
        point="org.eclipse.ui.handlers">
     <handler
           class="org.eclipse.linuxtools.internal.rpm.ui.handlers.SpecfileEditorRPMBuildHandler"
           commandId="rpmEditor.build.command">
     </handler>
  </extension>
  <extension
        name="RPM Toolbar"
        point="org.eclipse.ui.menus">
     <menuContribution
           allPopups="false"
           locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
        <toolbar
              id="org.eclipse.linuxtools.rpm.ui.rpmBuildMenu"
              label="%toolbar.name">
           <command
                 commandId="rpmEditor.build.command"
                 icon="icons/rpmBuildAll_16x16_toolbarIcon.PNG"
                 label="%toolbar.name"
                 style="pulldown">
              <visibleWhen>
                 <iterate
                       ifEmpty="false"
                       operator="or">
                    <or>
                       <with
                             variable="activeEditorId">
                          <equals
                                value="org.eclipse.linuxtools.rpm.ui.editor.SpecfileEditor">
                          </equals>
                       </with>
                    </or>
                 </iterate>
              </visibleWhen>
              <parameter
                    name="buildType"
                    value="ALL">
              </parameter>
              <parameter
                    name="actOnEditor"
                    value="true">
              </parameter>
           </command>
        </toolbar>
     </menuContribution>
     <menuContribution
           locationURI="menu:rpmEditor.build.command">
        <command
              commandId="rpmEditor.build.command"
              icon="icons/rpmBuildSRPM_16x16_toolbarIcon.PNG"
              label="%command.name.0"
              mnemonic="S"
              tooltip="%command.name.0">
           <parameter
                 name="buildType"
                 value="SOURCE">
           </parameter>
           <parameter
                 name="actOnEditor"
                 value="true">
           </parameter>
        </command>
        <command
              commandId="rpmEditor.build.command"
              icon="icons/rpmBuildRPMS_16x16_toolbarIcon.PNG"
              label="%command.name.1"
              mnemonic="R"
              tooltip="%command.name.1">
           <parameter
                 name="buildType"
                 value="BINARY">
           </parameter>
           <parameter
                 name="actOnEditor"
                 value="true">
           </parameter>
        </command>
        <command
              commandId="rpmEditor.build.command"
              icon="icons/rpmBuildAll_16x16_toolbarIcon.PNG"
              label="%command.name.2"
              mnemonic="A"
              tooltip="%command.name.2">
           <parameter
                 name="buildType"
                 value="ALL">
           </parameter>
           <parameter
                 name="actOnEditor"
                 value="true">
           </parameter>
        </command>
     </menuContribution>
  </extension>
  <extension
        point="org.eclipse.ui.console.consolePageParticipants">
     <consolePageParticipant
           class="org.eclipse.linuxtools.internal.rpm.ui.RpmConsolePageParticipant"
           id="org.eclipse.linuxtools.rpm.ui.rpmConsolePageParticipant">
        <enablement>
           <instanceof
                 value="org.eclipse.linuxtools.internal.rpm.ui.RpmConsole">
           </instanceof>
        </enablement>
     </consolePageParticipant>
  </extension>
  <extension
         point="org.eclipse.ui.preferencePages">
      <page
            class="org.eclipse.linuxtools.internal.rpm.ui.MainPage"
            id="org.eclipse.linuxtools.rpm.ui.mainpage"
            name="%category.name.0"/>
      </extension>
</plugin>
