<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
	<extension point="org.eclipse.ui.views">
		<category
			id="org.drools.eclipse.views"
			name="Drools">
		</category>
		<view
			category="org.drools.eclipse.views"
			class="org.kie.eclipse.navigator.view.KieNavigatorView"
			icon="icons/navigator.gif"
			id="org.kie.eclipse.navigator.view"
			name="Kie Navigator"
			restorable="true">
		</view>
	</extension>
	<extension
		id="org.kie.common.navigator.viewer"
		point="org.eclipse.ui.navigator.viewer">
		<viewer viewerId="org.kie.eclipse.navigator.view">
 		</viewer>
		<viewerContentBinding viewerId="org.kie.eclipse.navigator.view">
			<includes>
				<contentExtension isRoot="true" pattern="org.kie.eclipse.navigator.kieContent"/>

				<!-- content from eclipse UI Package Explorer -->
				<contentExtension pattern="org.eclipse.jdt.java.ui.javaContent" />
				<contentExtension pattern="org.eclipse.jdt.java.ui.filters.*" />	
				<contentExtension pattern="org.eclipse.jdt.java.ui.javaLinkHelper" />	

				<!-- content from eclipse UI Project Viewer org.eclipse.ui.navigator.ProjectExplorer -->
				<contentExtension isRoot="false" pattern="org.eclipse.ui.navigator.resourceContent" />		       	      
				<contentExtension isRoot="false" pattern="org.eclipse.ui.navigator.resources.filters.*"/>
				<contentExtension isRoot="false" pattern="org.eclipse.ui.navigator.resources.linkHelper"/>
				<contentExtension isRoot="false" pattern="org.eclipse.ui.navigator.resources.workingSets"/>
			</includes>
		</viewerContentBinding>

		<viewerActionBinding viewerId="org.kie.eclipse.navigator.view">
			<includes>
				<actionExtension pattern="org.kie.eclipse.navigator.view.content.*"/>
				<actionExtension pattern="org.eclipse.ui.navigator.resources.*" />
			</includes>
			<excludes>
				<actionExtension pattern="org.eclipse.ui.navigator.resources.WorkingSetActions" />
				<actionExtension pattern="org.eclipse.ui.navigator.resources.GoIntoActions" />
				<actionExtension pattern="org.eclipse.jdt.ui.navigator.resources.GoIntoActions" />
				<actionExtension pattern="org.eclipse.ui.navigator.resources.PortingActions" />
			</excludes>
		</viewerActionBinding>
	</extension>
	
	<extension point="org.eclipse.ui.navigator.navigatorContent">
		<navigatorContent
			activeByDefault="true"
			contentProvider="org.kie.eclipse.navigator.view.KieNavigatorContentProvider"
			icon="icons/navigator.gif"
			id="org.kie.eclipse.navigator.kieContent"
			labelProvider="org.kie.eclipse.navigator.view.KieNavigatorLabelProvider"
			name="KIE Navigator - Server Content"
			priority="normal">
			<triggerPoints>
				<and>
					<instanceof value="org.eclipse.wst.server.core.IServer">
					</instanceof>
					<or>
						<test
							property="org.eclipse.wst.server.ui.serverType"
							value="org.jboss.ide.eclipse.as.70">
						</test>
						<test
							property="org.eclipse.wst.server.ui.serverType"
							value="org.jboss.ide.eclipse.as.71">
						</test>
						<test
							property="org.eclipse.wst.server.ui.serverType"
							value="org.jboss.ide.eclipse.as.eap.60">
						</test>
						<test
							property="org.eclipse.wst.server.ui.serverType"
							value="org.jboss.ide.eclipse.as.eap.61">
						</test>
						<test
							property="org.eclipse.wst.server.ui.serverType"
							value="org.jboss.ide.eclipse.as.wildfly.80">
						</test>
						<!-- NEW_SERVER_ADAPTER -->
					</or>
				</and>
			</triggerPoints>
			
			<possibleChildren>
				<instanceof value="org.kie.eclipse.navigator.view.content.IContentNode"/>
			</possibleChildren>
		</navigatorContent>
	
		<actionProvider
			class="org.kie.eclipse.navigator.view.actions.RefreshActionProvider"
			appearsBefore="org.eclipse.ui.navigator.resources.PropertiesActionProvider"
			overrides="org.eclipse.ui.navigator.resources.EditActions"
			id="org.kie.eclipse.navigator.view.content.container">
			<enablement>
				<instanceof value="org.kie.eclipse.navigator.view.content.IContentNode">
				</instanceof>
			</enablement>
		</actionProvider>
		
		<actionProvider
			class="org.kie.eclipse.navigator.view.actions.server.ServerActionProvider"
			appearsBefore="org.eclipse.ui.navigator.resources.PropertiesActionProvider"
			id="org.kie.eclipse.navigator.view.content.server">
			<enablement>
				<instanceof value="org.kie.eclipse.navigator.view.content.ServerNode">
				</instanceof>
			</enablement>
		</actionProvider>
		
		<actionProvider
			class="org.kie.eclipse.navigator.view.actions.organization.OrganizationActionProvider"
			appearsBefore="org.eclipse.ui.navigator.resources.PropertiesActionProvider"
			id="org.kie.eclipse.navigator.view.content.organization">
			<enablement>
				<instanceof value="org.kie.eclipse.navigator.view.content.OrganizationNode">
				</instanceof>
			</enablement>
		</actionProvider>
		
		<actionProvider
			class="org.kie.eclipse.navigator.view.actions.repository.RepositoryActionProvider"
			appearsBefore="org.eclipse.ui.navigator.resources.PropertiesActionProvider"
			id="org.kie.eclipse.navigator.view.content.repository">
			<enablement>
				<instanceof value="org.kie.eclipse.navigator.view.content.RepositoryNode">
				</instanceof>
			</enablement>
		</actionProvider>
		
		<actionProvider
			class="org.kie.eclipse.navigator.view.actions.project.ProjectActionProvider"
			appearsBefore="org.eclipse.ui.navigator.resources.PropertiesActionProvider"
			id="org.kie.eclipse.navigator.view.content.project">
			<enablement>
				<instanceof value="org.kie.eclipse.navigator.view.content.ProjectNode">
				</instanceof>
			</enablement>
		</actionProvider>
	</extension>

	<extension
		id="org.kie.eclipse.navigator.service.wildfly.80"
		name="Wildfly 8.x"
		point="org.kie.eclipse.serviceImpl">
		<containerBinding
			class="org.kie.eclipse.server.jbpm60.Kie60Service"
			serverId="org.jboss.ide.eclipse.as.wildfly.*">
		</containerBinding>
		<containerBinding
			class="org.kie.eclipse.server.jbpm60.Kie60Service"
			serverId="org.jboss.ide.eclipse.as.eap.*">
		</containerBinding>
		<containerBinding
			class="org.kie.eclipse.server.jbpm60.Kie60Service"
			serverId="org.jboss.ide.eclipse.as.*">
		</containerBinding>
	</extension>
	
  <extension
        point="org.eclipse.core.expressions.propertyTesters">
     <propertyTester
           id="org.kie.eclipse.navigator.ResourcePropertyTester"
           class="org.kie.eclipse.navigator.ResourcePropertyTester"
           namespace="org.eclipse.kie.navigator"
           properties="contentNode"
           type="org.eclipse.core.resources.IProject">
     </propertyTester>
  </extension>
	
 <extension
       point="org.eclipse.ui.propertyPages">
    <page
          class="org.kie.eclipse.navigator.preferences.ServerPropertyPage"
          id="org.kie.eclipse.navigator.serverPropertyPage"
          icon="icons/server_started.gif"
          name="Kie Server">
          <enabledWhen>
            <or>
              <instanceof
                  value="org.kie.eclipse.navigator.view.content.ServerNode">
              </instanceof>
              <instanceof
                  value="org.kie.eclipse.navigator.view.content.OrganizationNode">
              </instanceof>
              <instanceof
                  value="org.kie.eclipse.navigator.view.content.RepositoryNode">
              </instanceof>
              <instanceof
                  value="org.kie.eclipse.navigator.view.content.ProjectNode">
              </instanceof>
			  <adapt type="org.eclipse.core.resources.IProject" >
				<test property="org.eclipse.kie.navigator.contentNode" value="org.kie.eclipse.navigator.view.content.ProjectNode"/>
 			  </adapt>
            </or>
          </enabledWhen>
    </page>
 </extension>

 <extension
       point="org.eclipse.ui.propertyPages">
    <page
          class="org.kie.eclipse.navigator.preferences.OrganizationPropertyPage"
          id="org.kie.eclipse.navigator.organizationPropertyPage"
          category="org.kie.eclipse.navigator.serverPropertyPage"
          icon="icons/organization.gif"
          name="Organizational Unit">
          <enabledWhen>
            <or>
              <instanceof
                  value="org.kie.eclipse.navigator.view.content.OrganizationNode">
              </instanceof>
              <instanceof
                  value="org.kie.eclipse.navigator.view.content.RepositoryNode">
              </instanceof>
              <instanceof
                  value="org.kie.eclipse.navigator.view.content.ProjectNode">
              </instanceof>
			  <adapt type="org.eclipse.core.resources.IProject" >
				<test property="org.eclipse.kie.navigator.contentNode" value="org.kie.eclipse.navigator.view.content.ProjectNode"/>
 			  </adapt>
            </or>
          </enabledWhen>
    </page>
 </extension>

 <extension
       point="org.eclipse.ui.propertyPages">
    <page
          class="org.kie.eclipse.navigator.preferences.RepositoryPropertyPage"
          id="org.kie.eclipse.navigator.repositoryPropertyPage"
          category="org.kie.eclipse.navigator.organizationPropertyPage"
          icon="icons/repository.gif"
          name="Repository">
          <enabledWhen>
            <or>
              <instanceof
                  value="org.kie.eclipse.navigator.view.content.RepositoryNode">
              </instanceof>
              <instanceof
                  value="org.kie.eclipse.navigator.view.content.ProjectNode">
              </instanceof>
			  <adapt type="org.eclipse.core.resources.IProject" >
				<test property="org.eclipse.kie.navigator.contentNode" value="org.kie.eclipse.navigator.view.content.ProjectNode"/>
 			  </adapt>
            </or>
          </enabledWhen>
    </page>
 </extension>

 <extension
       point="org.eclipse.ui.propertyPages">
    <page
          class="org.kie.eclipse.navigator.preferences.ProjectPropertyPage"
          id="org.kie.eclipse.navigator.projectPropertyPage"
          category="org.kie.eclipse.navigator.repositoryPropertyPage"
          icon="icons/project.gif"
          name="Project">
          <enabledWhen>
            <or>
              <instanceof
                  value="org.kie.eclipse.navigator.view.content.ProjectNode">
              </instanceof>
			  <adapt type="org.eclipse.core.resources.IProject" >
				<test property="org.eclipse.kie.navigator.contentNode" value="org.kie.eclipse.navigator.view.content.ProjectNode"/>
 			  </adapt>
            </or>
          </enabledWhen>
    </page>
 </extension>
 
    <extension
         point="org.eclipse.ui.contexts">
      <context
            name="Kie Navigator Context"
            description="Kie Navigator Context"
            id="org.kie.eclipse.navigator.context">
      </context>
 	</extension>
 	<!-- TODO: fix this mess
	<extension point="org.eclipse.ui.commands">
		<command name="Refresh Node"
			defaultHandler="org.kie.eclipse.navigator.view.actions.RefreshAction"
			description="Refreshes this node"
			id="org.kie.eclipse.navigator.actions.refresh">
		</command>
	</extension>
	
	<extension point="org.eclipse.ui.bindings">
		<key sequence="F5"
			commandId="org.kie.eclipse.navigator.actions.refresh"
			schemeId="org.kie.eclipse.navigator.scheme"
			parentId="org.eclipse.ui.defaultAcceleratorConfiguration"
			contextId="org.kie.eclipse.navigator.context"/>
	</extension>
	-->

	<extension point = "org.eclipse.ui.popupMenus">
		<objectContribution
				objectClass="org.eclipse.jdt.core.IJavaProject"
				id="org.kie.eclipse.action.ConvertToKieProject">
			<action id="org.kie.eclipse.action.ConvertToKieProject"
				label="Convert to Kie Project..."
				icon="icons/convert-to-kie-project.png"
				menubarPath="org.eclipse.ui.projectConfigure/additions"
				class="org.kie.eclipse.navigator.view.actions.project.ConvertToKieProjectAction"
				definitionId="org.kie.eclipse.action.ConvertToKieProject"
				enablesFor="1">
			</action>
		</objectContribution>
	</extension>
	
</plugin>
