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

<plugin>
   <extension-point id="selection" name="selection" schema="schema/selection.exsd"/>
   <extension-point id="tableEditor" name="tableEditor" schema="schema/tableEditor.exsd"/>
   <extension-point id="queryEditor" name="queryEditor" schema="schema/queryEditor.exsd"/>

   <extension point="org.eclipse.ui.views">
      <category name="DBViewer Plugin" id="zigen.plugin.db">
      </category>
      <view name="%db.tree.view" icon="icons/db.gif" category="zigen.plugin.db" class="zigen.plugin.db.ui.views.TreeView" id="zigen.plugin.db.ui.views.TreeView">
      </view>
      <view name="%sql.history.view" icon="icons/clock.gif" category="zigen.plugin.db" class="zigen.plugin.db.ui.views.HistoryView" id="zigen.plugin.db.ui.views.HistoryView">
      </view>
      <view name="%sql.execute.view" allowMultiple="true" category="zigen.plugin.db" class="zigen.plugin.db.ui.views.SQLExecuteView" icon="icons/db.gif" id="zigen.plugin.db.ui.views.SQLExecuteView">
      </view>
      <!--<view name ="SQL Outline" category="zigen.plugin.db"
            class="zigen.plugin.db.ui.views.SQLContentOutline"
            icon="icons/db.gif"
            id="zigen.plugin.db.ui.views.ContentOutline"/>-->
   </extension>

   <extension point="org.eclipse.ui.editors">
      <editor  name="TableView Editor(no select)" icon="icons/table.gif" class="zigen.plugin.db.ui.editors.TableViewEditorFor32" contributorClass="zigen.plugin.db.ui.editors.TableViewerContributor" id="zigen.plugin.db.ui.editors.TableViewEditor" extensions="dbv">
      </editor>

      <editor name="QueryView Editor(no select)" icon="icons/view.gif" extensions="dbv" class="zigen.plugin.db.ui.editors.QueryViewEditor2" contributorClass="zigen.plugin.db.ui.editors.QueryViewerContributor" id="zigen.plugin.db.ui.editors.QueryViewEditor2">
      </editor>

      <editor name="SQL Editor" class="zigen.plugin.db.ui.editors.sql.SqlEditor2" contributorClass="zigen.plugin.db.ui.editors.sql.SqlEditorContributor" default="false" extensions="sql" icon="icons/sqlfile.gif" id="zigen.plugin.db.ui.editors.sql.SqlEditor"/>

      <editor name="PL/SQL Editor" class="zigen.plugin.db.ui.editors.sql.PlsqlEditor" contributorClass="zigen.plugin.db.ui.editors.sql.PlsqlEditorContributor" default="false" extensions="plsql" icon="icons/plsqlfile.gif" id="zigen.plugin.db.ui.editors.sql.PlsqlEditor"/>

      <editor name="Source Editor(no select)" class="zigen.plugin.db.ui.editors.sql.SourceEditor" default="false" extensions="sqlx" icon="icons/plsqlfile.gif" contributorClass="zigen.plugin.db.ui.editors.sql.SourceEditorContributor" id="zigen.plugin.db.ui.editors.sql.SourceEditor"/>

      <editor name="SEQUENCE Editor(no select)" class="zigen.plugin.db.ui.editors.sql.SequenceEditor" default="false" extensions="sqlx" icon="icons/sequence.gif" id="zigen.plugin.db.ui.editors.sql.SequenceEditor"/>

      <editor
            class="zigen.plugin.db.diff.DDLDiffEditor"
            contributorClass="zigen.plugin.db.diff.DDLDiffContributor"
            default="false"
            extensions="diff"
            icon="icons/diff.gif"
            id="zigen.plugin.db.diff.DDLDiffEditor"
            name="DDL Diff(no select)"/>

   </extension>
  <extension
        id="zigen.plugin.db.markers.myProblem"
        name="PLSQLProblem MarkerType"
        point="org.eclipse.core.resources.markers">
     <super type="org.eclipse.core.resources.problemmarker"/>
     <super type="org.eclipse.core.resources.textmarker"/>
     <persistent value="true"/>
     <attribute name="selection"/>
  </extension>



   <extension point="org.eclipse.ui.perspectives">
      <perspective name="DBViewer" icon="icons/db.gif" fixed="false" class="zigen.plugin.db.PerspectiveFactory"
       id="zigen.plugin.db.PerspectiveFactory">
      </perspective>
   </extension>
   <extension point="org.eclipse.ui.perspectiveExtensions">

      	<perspectiveExtension targetID="zigen.plugin.db.PerspectiveFactory">

         <!--<newWizardShortcut id="org.eclipse.jdt.ui.wizards.NewProjectCreationWizard"/>-->

         <viewShortcut id="zigen.plugin.db.ui.views.TreeView">
         </viewShortcut>

         <viewShortcut id="zigen.plugin.db.ui.views.SQLExecuteView">
         </viewShortcut>

         <viewShortcut id="zigen.plugin.db.ui.views.HistoryView">
         </viewShortcut>

         <viewShortcut id="zigen.plugin.db.ui.views.ContentOutline">
         </viewShortcut>

         <perspectiveShortcut id="zigen.plugin.db.PerspectiveFactory">
         </perspectiveShortcut>

         <perspectiveShortcut id="org.eclipse.debug.ui.DebugPerspective">
         </perspectiveShortcut>

         <view ratio="0.25" relative="org.eclipse.ui.editorss" closeable="true" visible="true" relationship="left"
          id="zigen.plugin.db.ui.views.TreeView">
         </view>

         <!--<view relative="zigen.plugin.db.ui.views.TreeView" id="org.eclipse.jdt.ui.PackageExplorer" relationship="stack">
         </view>-->
         <view ratio="0.7" relative="zigen.plugin.db.ui.views.TreeView" id="zigen.plugin.db.ui.views.HistoryView"
          relationship="bottom">
         </view>

         <view ratio="0.7" relative="org.eclipse.ui.editorss" closeable="true" visible="true" relationship="bottom"
          id="zigen.plugin.db.ui.views.SQLExecuteView">
         </view>

         <!--<view ratio="0.8" relative="org.eclipse.ui.editorss" closeable="true" visible="true" relationship="right"
          id="zigen.plugin.db.ui.views.ContentOutline">
         </view>-->
      </perspectiveExtension>
   </extension>

   <extension point="org.eclipse.ui.preferencePages">
      <page name="DBViewer Plugin" class="zigen.plugin.db.preference.PreferencePage" id="zigen.plugin.db.preference.PreferencePage">
      </page>
      <page name="%connection.string" category="zigen.plugin.db.preference.PreferencePage" class="zigen.plugin.db.preference.URLPreferencePage" id="zigen.plugin.db.preference.URLPreferencePage">
      </page>
      <page name="%export.csv" category="zigen.plugin.db.preference.PreferencePage" class="zigen.plugin.db.preference.CSVPreferencePage" id="zigen.plugin.db.preference.CSVPreferencePage">
      </page>
      <page name="%db.tree.view" class="zigen.plugin.db.preference.DBTreeViewPreferencePage" category="zigen.plugin.db.preference.PreferencePage" id="zigen.plugin.db.preference.DBTreeViewPreferencePage">
      </page>
      <page name="%sql.format" category="zigen.plugin.db.preference.PreferencePage" class="zigen.plugin.db.preference.SQLFormatPreferencePage" id="zigen.plugin.db.preference.SQLFormatPreferencePage">
      </page>
      <page name="%sql.editor" category="zigen.plugin.db.preference.PreferencePage" class="zigen.plugin.db.preference.SQLEditorPreferencePage" id="zigen.plugin.db.preference.SQLEditorPreferencePage">
      </page>
      <page name="%sql.content.assist" category="zigen.plugin.db.preference.PreferencePage" class="zigen.plugin.db.preference.CodeAssistPreferencePage" id="zigen.plugin.db.preference.CodeAssistPreferencePage">
      </page>
      <page name="%sql.template" category="zigen.plugin.db.preference.PreferencePage" class="zigen.plugin.db.preference.SQLTemplatesPreferencePage" id="zigen.plugin.db.preference.SQLTemplatesPreferencePage">
      </page>
   </extension>

   <extension point="org.eclipse.core.runtime.preferences">
      <initializer class="zigen.plugin.db.PreferenceInitializer">
      </initializer>
   </extension>

    <extension point="org.eclipse.ui.propertyPages">
	   <page id="zigen.plugin.db.properties.DBPropertyPage"
	         name="DBViewer Plugin"
	         objectClass="org.eclipse.core.resources.IProject"
	         class="zigen.plugin.db.properties.DBPropertyPage">
	   </page>
    </extension>
    <extension point="org.eclipse.ui.editors.templates">
         <contextType name="SQL" class="zigen.plugin.db.ui.views.internal.SQLContextType"
          id="zigen.plugin.db.template.sql">
    	</contextType>

        <contextType name="Function" class="zigen.plugin.db.ui.views.internal.SQLContextType"
          id="zigen.plugin.db.template.sql.function">
    	</contextType>
	  <!--
      <resolver
            class="zigen.plugin.db.ui.views.internal.TableVariableResolver"
            contextTypeId="zigen.plugin.db.template.sql"
            description="table resolver"
            icon="icons/table.gif"
            name="table resolver"
            type="tableName">
      </resolver>
      -->

      <include file="templates/sqlTemplate.xml"
      		   translations="$nl$/templates/sqlTemplate.properties">
      </include>

   </extension>

   	<extension point="org.eclipse.ui.commands">
  			<category id="zigen.plugin.db.category" name="DBViewer"/>

  			<!--
  			<command  categoryId="zigen.plugin.db.category"
      			  	id="zigen.plugin.SQLFormatActionCommand" name="Format SQL"/>-->

  			<command categoryId="zigen.plugin.db.category" id="zigen.plugin.SQLExecuteActionCommand" name="Execute All SQL"/>

      		<command categoryId="zigen.plugin.db.category" id="zigen.plugin.SQLCurrentExecuteActionCommand" name="Execute Current SQL"/>

      		<command categoryId="zigen.plugin.db.category" id="zigen.plugin.SQLSelectedExecuteActionCommand" name="Execute Selected SQL"/>

      		<command categoryId="zigen.plugin.db.category" id="zigen.plugin.SQLNextCommand" name="Next SQL History"/>

      		<command categoryId="zigen.plugin.db.category" id="zigen.plugin.SQLBackCommand" name="Back SQL History"/>

      		<command categoryId="zigen.plugin.db.category" id="zigen.plugin.InsertRecordCommand" name="Create New Record"/>


 	</extension>

	<extension point="org.eclipse.ui.bindings">
  			<key sequence="CTRL+I" commandId="zigen.plugin.InsertRecordCommand" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
  			</key>
  			<key commandId="zigen.plugin.SQLExecuteActionCommand" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" sequence="SHIFT+ENTER">
            </key>
  			<key commandId="zigen.plugin.SQLCurrentExecuteActionCommand" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" sequence="CTRL+ENTER">
            </key>
  			<key commandId="zigen.plugin.SQLSelectedExecuteActionCommand" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" sequence="CTRL+SHIFT+ENTER">
  			</key>
  			<key commandId="zigen.plugin.SQLNextCommand" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" sequence="CTRL+ALT+ARROW_RIGHT">
            </key>
  			<key commandId="zigen.plugin.SQLBackCommand" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" sequence="CTRL+ALT+ARROW_LEFT">
            </key>


	</extension>

	<extension point="org.eclipse.ui.actionSets">
	    <actionSet id="zigen.plugin.db.actionSet" label="DBViewer・Plugin" visible="false">
	       <menu id="sampleMenu" label="&amp;DBViewer">
	          <separator name="sampleGroup"/>
	          <separator name="sampleGroup2"/>
	          <separator name="sampleGroup3"/>
	       </menu>
	       <action definitionId="zigen.plugin.SQLNextCommand" icon="icons/forward.gif"
	         id="zigen.plugin.db.actions.SQLNextAction" label="%history.next.sql"
	          menubarPath="sampleMenu/sampleGroup3" retarget="true"/>

	       <action definitionId="zigen.plugin.SQLBackCommand" icon="icons/back.gif"
	         id="zigen.plugin.db.actions.SQLBackAction" label="%history.back.sql"
	          menubarPath="sampleMenu/sampleGroup3" retarget="true"/>

	       <action definitionId="zigen.plugin.SQLSelectedExecuteActionCommand" icon="icons/execute.gif"
	        id="zigen.plugin.db.actions.SQLSelectedExecuteAction" label="%execute.selected.sql"
	         menubarPath="sampleMenu/sampleGroup" retarget="true"/>

	       <action definitionId="zigen.plugin.SQLCurrentExecuteActionCommand" icon="icons/execute.gif"
	        id="zigen.plugin.db.actions.SQLCurrentExecuteAction" label="%execute.current.sql"
	         menubarPath="sampleMenu/sampleGroup" retarget="true"/>

	       <action definitionId="zigen.plugin.SQLExecuteActionCommand" icon="icons/execute.gif"
	        id="zigen.plugin.db.actions.SQLExecuteAction" label="%execute.all.sql"
	         menubarPath="sampleMenu/sampleGroup" retarget="true"/>

	    </actionSet>

	    <actionSet id="zigen.plugin.db.actionSet2" label="DBViewer Plugin" visible="false">
		   	<action class="zigen.plugin.db.ui.actions.InsertRecordAction"
		   	 id="zigen.plugin.db.ui.actions.InsertRecordAction"
		   	  label="%create.new.record"
		   	  menubarPath="edit/additions"
		   	  definitionId="zigen.plugin.InsertRecordCommand"
		   	  retarget="false"/>
	    </actionSet>
	</extension>

   	<extension point="org.eclipse.ui.actionSetPartAssociations">
  		<actionSetPartAssociation targetID="zigen.plugin.db.actionSet">
     		<part id="zigen.plugin.db.ui.views.SQLExecuteView"/>
     		<part id="zigen.plugin.db.ui.editors.sql.SqlEditor"/>
  		</actionSetPartAssociation>
	</extension>

	<extension point="org.eclipse.ui.popupMenus">

      <objectContribution id="zigen.plugin.db.contribution" nameFilter="*.sql" objectClass="org.eclipse.core.resources.IFile">
         <action enablesFor="1" label="%execute.sql" icon="icons/execute.gif"
          class="zigen.plugin.db.ui.popup.ExecSQLFileAction"
          menubarPath="additions" id="zigen.plugin.db.ui.popup.ExecSQLFileAction"/>
      </objectContribution>
      <objectContribution id="zigen.plugin.db.contribution2" nameFilter="*.plsql" objectClass="org.eclipse.core.resources.IFile">
         <action enablesFor="1" label="%execute.plsql" icon="icons/script.gif"
          class="zigen.plugin.db.ui.popup.ExecScriptFileAction"
          menubarPath="additions" id="zigen.plugin.db.ui.popup.ExecScriptFileAction"/>
      </objectContribution>

	<viewerContribution targetID="zigen.plugin.db.ui.views.SQLExecuteView" id="zigen.plugin.db.ui.actions.CopySQLForStringBufferContext">
   		<menu id="Menu1" label="%assist.java.development">
      	<separator name="Group1"/>
   		</menu>

		<!-- JDK5 -->
		<action class="zigen.plugin.db.ui.actions.CopySQLForStringBuilderContext2Action"
	  	 icon="icons/db.gif" id="zigen.plugin.db.ui.actions.CopySQLForStringBuilderContext2Action"
	  	  label="%copy.string.builder2" menubarPath="Menu1/Group1">
	    	<selection class="org.eclipse.jface.text.ITextSelection">
	    	</selection>
		</action>

		<action class="zigen.plugin.db.ui.actions.CopySQLForStringBuffer2ContextAction" icon="icons/db.gif"
		 id="zigen.plugin.db.ui.actions.CopySQLForStringBuffer2ContextAction"
		  label="%copy.string.buffer2" menubarPath="Menu1/Group1">
	    	<selection class="org.eclipse.jface.text.ITextSelection">
	    	</selection>
		</action>
	  	<action class="zigen.plugin.db.ui.actions.CopySQLForStringBufferContextAction"
	  	 icon="icons/db.gif" id="zigen.plugin.db.ui.actions.CopySQLForStringBufferContextAction"
	  	  label="%copy.string.buffer" menubarPath="Menu1/Group1">
	    	<selection class="org.eclipse.jface.text.ITextSelection">
	    	</selection>
		</action>



	</viewerContribution>

   	<viewerContribution id="zigen.plugin.db.ui.actions.CopySQLForStringBuilderContext" targetID="zigen.plugin.db.ui.views.SQLExecuteView">
      <menu id="Menu2" label="%assist.cs.development">
         <separator name="Group2"/>
		</menu>
      <action class="zigen.plugin.db.ui.actions.CopySQLForStringBuilderContextAction" icon="icons/db.gif"
      	 id="zigen.plugin.db.ui.actions.CopySQLForStringBuilderContextAction"
      	  label="%copy.string.builder" menubarPath="Menu2/Group2">
        <selection class="org.eclipse.jface.text.ITextSelection">
	    </selection>
	  </action>
   	</viewerContribution>

	<viewerContribution id="zigen.plugin.db.viewContribution" targetID="zigen.plugin.db.ui.views.SQLExecuteView">

  		<menu id="Replace" label="%convert">
        	<separator name="Group"/>
  		</menu>

  		<action class="zigen.plugin.db.ui.actions.ReplaceSemicron2SuraAction" id="zigen.plugin.db.ui.actions.ReplaceSemicron2SuraAction"
  		 label="%convert.semicolon" menubarPath="Replace/Group"/>

  		<action class="zigen.plugin.db.ui.actions.ReplaceSura2SemicronAction" id="zigen.plugin.db.ui.actions.ReplaceSura2SemicronAction"
  		 label="%convert.slash" menubarPath="Replace/Group"/>

  		<action class="zigen.plugin.db.ui.actions.SQLToLowerCaseAction" id="zigen.plugin.db.ui.actions.SQLToLowerCaseAction"
  		 label="%convert.smaller" menubarPath="Replace/Group"/>

  		<action class="zigen.plugin.db.ui.actions.SQLToUpperCaseAction" id="zigen.plugin.db.ui.actions.SQLToUpperCaseAction"
  		 label="%convert.capital" menubarPath="Replace/Group"/>


   	</viewerContribution>




   </extension>


   <!--
   <extension id="zigen.plugin.db.tableEditor" point="zigen.plugin.db.tableEditor">
   		<menu id="Test" label="テストアクション">
        	<separator name="Group"/>
  		</menu>

   		<contributor class="zigen.plugin.db.ui.actions.SelectAllRecordAction"
   					label="全て選択" menubarPath="Test/Group"/>
   		<contributor class="zigen.plugin.db.ui.actions.CopyRecordDataAction"
   					label="レコードをコピー" menubarPath="Test/Group"/>

   </extension>-->

  <extension point="org.eclipse.ui.popupMenus">
      <objectContribution id="zigen.plugin.db.popupMenus.column.copy"
      	objectClass="zigen.plugin.db.ui.internal.Column">

	  	<action class="zigen.plugin.db.ui.actions.CopyColumnNameWithTableNameAction"
                       id="zigen.plugin.db.ui.actions.CopyBothColumnNameWithTableNameAction"
                       label="%CopyColumnNameWithTableNameAction.label"
        		menubarPath="group.copy.column">
	  	</action>
	  		  	<action class="zigen.plugin.db.ui.actions.CopyBothColumnNameAction"
                       id="zigen.plugin.db.ui.actions.CopyBothColumnNameAction"
                       label="%CopyBothColumnNameAction.label"
        		menubarPath="group.copy.column">
	  	</action>
	  	<!--		<action class="zigen.plugin.db.ui.actions.CopyLogicalColumnNameWithTableNameAction"
                       id="zigen.plugin.db.ui.actions.CopyLogicalColumnNameWithTableNameAction"
                       label="%CopyLogicalColumnNameWithTableNameAction.label"
        		menubarPath="group.copy.column">
	  	</action>
	  	<action class="zigen.plugin.db.ui.actions.CopyLogicalColumnNameAction"
                       id="zigen.plugin.db.ui.actions.CopyLogicalColumnNameAction"
                       label="%CopyLogicalColumnNameAction.label"
        		menubarPath="group.copy.column">
	  	</action>-->

      </objectContribution>

	  <objectContribution
         adaptable="true"
         id="zigen.plugin.db.popupMenus.execute"
         objectClass="zigen.sql.parser.ast.ASTSelectStatement">

        <action
              class="zigen.plugin.db.ui.editors.sql.ExecuteAction"
              icon="icons/execute.gif"
              id="zigen.plugin.db.ui.actions.ExecuteAction"
              label="Execute"
              menubarPath="additions">
        </action>

      </objectContribution>

      <objectContribution id="zigen.plugin.db.popupMenus.createCommentStatement"
      	objectClass="zigen.plugin.db.ui.internal.ITable">
      		  	<action
                 class="zigen.plugin.db.ui.actions.CopyCommentStatementAction"
                 id="zigen.plugin.db.ui.actions.CopyCommentStatement2Action"
                 label="%Copy.CommentStatement"
                 menubarPath="group.copy.statement"
                 >	</action>
      </objectContribution>

     <objectContribution id="zigen.plugin.db.popupMenus.createSelectStatement"
      	objectClass="zigen.plugin.db.ui.internal.ITable">
      		  	<action
                 class="zigen.plugin.db.ui.actions.CopySelectStatementAction"
                 enablesFor="1"
                 id="zigen.plugin.db.ui.actions.CreateSelectStatementAction"
                 label="%Copy.SelectStatement"
                 menubarPath="group.copy.statement">
	  	</action>
      </objectContribution>

     <objectContribution id="zigen.plugin.db.popupMenus.createSelectStatement"
      	objectClass="zigen.plugin.db.ui.internal.Column">
      		  	<action
                 class="zigen.plugin.db.ui.actions.CopySelectStatementAction"
                 id="zigen.plugin.db.ui.actions.CreateSelectStatement2Action"
                 label="%Copy.SelectStatement"
                 menubarPath="group.copy.statement"
                 >
	  	</action>
      </objectContribution>


   </extension>


</plugin>
