<extension id="org.utplsql.sqldev" version="#EXTENSION_VERSION#"
	esdk-version="2.0" xmlns="http://jcp.org/jsr/198/extension-manifest"
	rsbundle-class="org.utplsql.sqldev.resources.UtplsqlResources">
	<name rskey="EXTENSION_NAME" />
	<owner rskey="EXTENSION_OWNER" />

	<feature id="org.utplsql.sqldev" xmlns="http://xmlns.oracle.com/ide/extension">
		<category-id>db-category</category-id>
		<name>#EXTENSION_NAME#</name>
		<description><![CDATA[#EXTENSION_DESCRIPTION#]]></description>
		<type>
			<service can-user-disable="true" reload-if-used="true" />
		</type>
	</feature>

	<trigger-hooks xmlns="http://xmlns.oracle.com/ide/extension">
		<rules>
			<rule id="dbnode-is-db-connection" type="context-has-element">
				<parameters>
					<param name="element-class" value="oracle.dbtools.raptor.navigator.db.DatabaseConnection" />
				</parameters>
			</rule>
			<rule id="dbnode-is-otheruser" type="context-has-element">
				<parameters>
					<param name="element-class" value="oracle.dbtools.raptor.navigator.impl.SchemaFolder" />
				</parameters>
			</rule>
			<rule id="dbnode-is-package-folder" type="context-has-db-object-type-impl">
				<parameters>
					<param name="object-types" value="PACKAGE" />
					<param name="restrict-to" value="FOLDER" />
				</parameters>
			</rule>
			<rule id="dbnode-is-package" type="dbnode-has-object-type">
				<parameters>
					<param name="ObjectType" value="PACKAGE" />
				</parameters>
			</rule>
			<rule id="dbnode-is-package-body" type="dbnode-has-object-type">
				<parameters>
					<param name="ObjectType" value="PACKAGE BODY" />
				</parameters>
			</rule>
			<rule id="dbnode-is-member" type="context-has-element">
				<parameters>
					<param name="element-class" value="oracle.dbtools.raptor.navigator.impl.ChildObjectElement" />
				</parameters>
			</rule>
			<composite-rule id="dbnode-is-test-ready">
				<or>
					<rule-reference id="dbnode-is-db-connection" />
					<rule-reference id="dbnode-is-otheruser" />
					<rule-reference id="dbnode-is-package-folder" />
					<rule-reference id="dbnode-is-package" />
					<rule-reference id="dbnode-is-package-body" />
					<rule-reference id="dbnode-is-member" />
				</or>
			</composite-rule>
			<rule id="dbnode-is-type" type="dbnode-has-object-type">
				<parameters>
					<param name="ObjectType" value="TYPE" />
				</parameters>
			</rule>
			<rule id="dbnode-is-type-body" type="dbnode-has-object-type">
				<parameters>
					<param name="ObjectType" value="TYPE BODY" />
				</parameters>
			</rule>
			<rule id="dbnode-is-function" type="dbnode-has-object-type">
				<parameters>
					<param name="ObjectType" value="FUNCTION" />
				</parameters>
			</rule>
			<rule id="dbnode-is-procedure" type="dbnode-has-object-type">
				<parameters>
					<param name="ObjectType" value="PROCEDURE" />
				</parameters>
			</rule>
			<composite-rule id="dbnode-is-generate-ready">
				<or>
					<rule-reference id="dbnode-is-package" />
					<rule-reference id="dbnode-is-package-body" />
					<rule-reference id="dbnode-is-type" />
					<rule-reference id="dbnode-is-type-body" />
					<rule-reference id="dbnode-is-function" />
					<rule-reference id="dbnode-is-procedure" />
				</or>
			</composite-rule>
		</rules>
		<triggers>
			<dockable-factory-hook xmlns="http://xmlns.oracle.com/ide/extension">
				<factory id="UTPLSQL_RUNNER_FACTORY" class="org.utplsql.sqldev.ui.runner.RunnerFactory" />
			</dockable-factory-hook>
			<actions xmlns="http://xmlns.oracle.com/jdeveloper/1013/extension">
				<action id="utplsql.test">
					<properties>
						<property name="Name">${MENU_RUN_TEST_LABEL}</property>
						<property name="SmallIcon">res:/org/utplsql/sqldev/resources/images/utPLSQL.png</property>
						<property name="Category">Code-Editor</property>
					</properties>
				</action>
				<action id="utplsql.coverage">
					<properties>
						<property name="Name">${MENU_CODE_COVERAGE_LABEL}</property>
						<property name="SmallIcon">res:/org/utplsql/sqldev/resources/images/coverage.png</property>
						<property name="Category">Code-Editor</property>
					</properties>
				</action>
				<action id="utplsql.debug">
					<properties>
						<property name="Name">${MENU_DEBUG_TEST_LABEL}</property>
						<property name="SmallIcon">res:/org/utplsql/sqldev/resources/images/debug.png</property>
						<property name="Category">Code-Editor</property>
					</properties>
				</action>
				<action id="utplsql.generate">
					<properties>
						<property name="Name">${MENU_GENERATE_TEST_LABEL}</property>
						<property name="SmallIcon">res:/org/utplsql/sqldev/resources/images/oddgen.png</property>
						<property name="Category">Code-Editor</property>
					</properties>
				</action>
			</actions>
			<controllers xmlns="http://xmlns.oracle.com/ide/extension">
				<controller class="org.utplsql.sqldev.menu.UtplsqlController">
					<update-rules>
						<update-rule rule="always-enabled">
							<action id="utplsql.test" />
							<action id="utplsql.coverage" />
							<action id="utplsql.debug" />
							<action id="utplsql.generate" />
						</update-rule>
					</update-rules>
				</controller>
			</controllers>
			<context-menu-hook rule="always-enabled">
				<site idref="editor" />
				<menu>
					<section xmlns="http://jcp.org/jsr/198/extension-manifest"
						id="UTPLSQL_MENU" weight="2.0">
						<item action-ref="utplsql.test" weight="1.0" />
						<item action-ref="utplsql.coverage" weight="1.1" />
						<item action-ref="utplsql.debug" weight="1.2" />
						<item action-ref="utplsql.generate" weight="1.3" />
					</section>
				</menu>
			</context-menu-hook>
			<context-menu-hook rule="dbnode-is-test-ready">
				<site idref="db_nav" />
				<menu>
					<section xmlns="http://jcp.org/jsr/198/extension-manifest"
						id="UTPLSQL_MENU" weight="2.0">
						<item action-ref="utplsql.test" weight="12.1" />
						<item action-ref="utplsql.debug" weight="12.2" />
						<item action-ref="utplsql.coverage" weight="12.3" />
					</section>
				</menu>
			</context-menu-hook>
			<context-menu-hook rule="dbnode-is-generate-ready">
				<site idref="db_nav" />
				<menu>
					<section xmlns="http://jcp.org/jsr/198/extension-manifest"
						id="UTPLSQL_MENU" weight="2.0">
						<item action-ref="utplsql.generate" weight="12.3" />
					</section>
				</menu>
			</context-menu-hook>
			<accelerator-hook>
				<file>org/utplsql/sqldev/resources/accelerators.xml</file>
			</accelerator-hook>
			<settings-ui-hook>
				<page id="UTPLSQL_PREFERENCES_PAGE" parent-idref="/preferences">
					<label>${PREF_LABEL}</label>
					<traversable-class>org.utplsql.sqldev.ui.preference.PreferencePanel
					</traversable-class>
				</page>
			</settings-ui-hook>
		</triggers>
	</trigger-hooks>

	<hooks>
		<dockable-hook xmlns="http://xmlns.oracle.com/ide/extension">
			<dockable id="UTPLSQL_RUNNER_VIEW" />
		</dockable-hook>
	</hooks>	

</extension>
