<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at
  
  http://www.apache.org/licenses/LICENSE-2.0
  
  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
-->
<?eclipse version="3.2"?>
<plugin>
  <!-- The context menu which will be used to open the OpenLDAP configuration -->
  <extension point="org.eclipse.ui.editors">
    <editor
        class="org.apache.directory.studio.openldap.config.editor.OpenLdapServerConfigurationEditor"
        default="false"
        icon="resources/icons/editor.gif"
        id="org.apache.directory.studio.openldap.config.editor.OpenLdapServerConfigurationEditor"
        name="OpenLDAP Configuration Editor">
    </editor>
  </extension>
   
   <!-- Adds an item in the connection context menu -->
  <extension point="org.eclipse.ui.popupMenus">
    <objectContribution
        objectClass="org.apache.directory.studio.connection.core.Connection"
        id="org.apache.directory.studio.connection.core.Connection">
      <action
          class="org.apache.directory.studio.openldap.config.actions.OpenConfigurationAction"
          enablesFor="1"
          id="org.apache.directory.studio.openldap.config.actions.OpenConfigurationAction"
          label="Open Configuration"
          icon="resources/icons/editor.gif"/>
      <visibility> 
        <!-- We support OpenLDAP 2.3 and 2.4 atm -->
        <or>
          <objectState name="serverType" value="OPENLDAP_2_3"/>
          <objectState name="serverType" value="OPENLDAP_2_4"/>
        </or>
      </visibility>
   </objectContribution>
  </extension>

  <extension point="org.eclipse.ui.perspectiveExtensions">
    <perspectiveExtension targetID="org.apache.directory.studio.ldapbrowser.ui.perspective.BrowserPerspective">
      <actionSet id="%ActionSet_OpenLdapMenuActionSet_id"/>
    </perspectiveExtension>
  </extension>
   
  <extension point="org.eclipse.ui.actionSets">
    <actionSet
        id="org.apache.directory.studio.openldap.config.actions.ldapMenuActionSet"
        label="%ActionSet_OpenLdapMenuActionSet_label"
        visible="false">
      <menu id="org.apache.directory.studio.openldap.config.actions.ldapMenu" label="%ActionSet_OpenLdapMenu_label">
        <groupMarker name="%GroupMarker_OpenConfiguration_name"/>
      </menu>
      <action
          class="org.apache.directory.studio.openldap.config.actions.OpenDirectoryConfigurationAction"
          icon="resources/icons/open_configuration.gif"
          id="org.apache.directory.studio.openldap.config.actions.OpenDirectoryConfigurationAction"
          label="%Action_OpenDirectoryConfigurationAction_label"
          menubarPath="%Action_OpenDirectoryConfigurationAction_menubarpath"
          style="push"/>
    </actionSet>
  </extension>


  <!-- Add a new entry to create an OpenLDAP  configuration in the New menu -->  
  <extension point="org.eclipse.ui.newWizards">
    <category id="%NewWizards_Category_id" name="%NewWizards_Category_name" />
    <wizard
        canFinishEarly="true"
        category="%NewWizards_Category_id"
        class="org.apache.directory.studio.openldap.config.wizards.NewOpenLdapConfigurationFileWizard"
        hasPages="false"
        icon="resources/icons/editor_new.gif"
        id="%NewWizards_NewOpenLdapConfigurationFileWizard_id"
        name="%NewWizards_NewOpenLdapConfigurationFileWizard_name"
        project="false"/>
  </extension>
</plugin>
