<?xml version="1.0" encoding="UTF-8"?>
<plugin
  name="%pluginName"
  id="ru.biosoft.plugins.javascript"
  version="0.8.6"  
  provider-name="%providerName">
  
  <requires>
    <import plugin="org.eclipse.core.runtime"/>
    <import plugin="org.eclipse.core.runtime.compatibility"/>
    <import plugin="org.apache.log4j"/>
    <import plugin="com.beanexplorer"/>
    <import plugin="ru.biosoft.access"/>
    <import plugin="ru.biosoft.table"/>
    <import plugin="ru.biosoft.workbench"/>
    <import plugin="org.mozilla.javascript"/>
    <import plugin="com.developmentontheedge.util"/>
    <import plugin="com.Ostermiller.syntax"/>
    <import plugin="org.jfree.chart"/>
  </requires>

  <runtime>
    <library name="jsplugin.jar">
      <export name="*"/>
    </library>
    <library name="./">
      <export name="*"/>
    </library>
  </runtime>

  <extension-point name="function" id="function"/>
  <extension-point name="function" id="hostObject"/>
  <extension-point name="JavaScript preprocessor" id="preprocessor"/>

  <extension id="shell" point="org.eclipse.core.runtime.applications"> 
    <application> 
       <run class="ru.biosoft.plugins.javascript.JScriptRunner"/> 
    </application> 
  </extension> 

  <extension 
       point="ru.biosoft.workbench.visiblePlugin"> 
      <visiblePlugin 
         name="JavaScript"
         class="ru.biosoft.plugins.javascript.JScriptVisiblePlugin" 
         displayName="%pluginName">
      </visiblePlugin>
   </extension> 


  <extension id="JavaScript" point="biouml.workbench.diagramEditorPart"> 
      <diagramEditorPart 
        class="ru.biosoft.plugins.javascript.JScriptConsole" 
        Name="JavaScript"
        ShortDescription="JavaScript console"
        Priority = "4.1"
      /> 
  </extension> 

  <extension id="JavaScript" point="ru.biosoft.workbench.documentEditorPart"> 
      <diagramEditorPart 
        class="ru.biosoft.plugins.javascript.JScriptConsole" 
        Name="JavaScript"
        ShortDescription="JavaScript console"
        Priority = "4.1"
      /> 
  </extension> 
  
  <extension id="Context" point="biouml.workbench.diagramViewPart"> 
      <diagramEditorPart 
        class="ru.biosoft.plugins.javascript.document.ContextViewPart" 
        Name="Context/Watch"
        ShortDescription="JavaScript context"
        Priority = "4.0"
      /> 
  </extension>
  
  <extension id="Output" point="biouml.workbench.diagramViewPart"> 
      <diagramEditorPart 
        class="ru.biosoft.plugins.javascript.document.OutputViewPart" 
        Name="Output"
        ShortDescription="JavaScript context"
        Priority = "4.1"
      /> 
  </extension>

  <!-- =================================================================== -->
  <!-- JavaScript functions                                                -->
  <!-- =================================================================== -->

  <extension id="defineClass" point="ru.biosoft.plugins.javascript.function"> 
    <function
      name="defineClass" 
      class="ru.biosoft.plugins.javascript.Global" 
      method="defineClass" 
      varargs="true"> 
        <doc description="%defineClass.descr">
           <argument name="clazz" type="String" obligatory="true" description="%defineClass.arg_1"/>
           <returns type="void"/>    
           <throws type="IllegalAccessException"
             description="if access is not available to a reflected class member"/>
           <throws type="InstantiationException" 
             description="if unable to instantiate the named class"/>
           <throws type="InvocationTargetException"
             description="if an exception is thrown during execution of methods of the named class"/>
           <throws type="ClassDefinitionException"
             description="if the format of the class causes this exception in ScriptableObject.defineClass"/>
           <throws type="PropertyException"
             description="if the format of the class causes this exception in ScriptableObject.defineClass"/>
        </doc>
    </function>
  </extension>

  <extension id="deserialize" point="ru.biosoft.plugins.javascript.function"> 
    <function
      name="deserialize" 
      class="ru.biosoft.plugins.javascript.Global" 
      method="deserialize" 
      varargs="true"> 
        <doc description="%deserialize.descr">
           <argument name="filename" type="String" obligatory="true" description="%deserialize.arg_1"/>
           <returns type="Object" description="%deserialize.return"/>    
           <throws type="IOException"/>
           <throws type="ClassNotFoundException"/>
        </doc>
    </function>
  </extension>

  <extension id="help" point="ru.biosoft.plugins.javascript.function"> 
    <function
      name="help" 
      class="ru.biosoft.plugins.javascript.Global" 
      method="help" 
      varargs="true"> 
        <doc description="%help.descr">
           <argument name="obj" type="Object" obligatory="true" description="%help.arg_1"/>
           <example code="%help.ex_1c" description="%help.ex_1d"/>
           <example code="%help.ex_2c" description="%help.ex_2d"/>
           <example code="%help.ex_3c" description="%help.ex_3d"/>
           <example code="%help.ex_4c" description="%help.ex_4d"/>
        </doc>
    </function>
  </extension>

  <extension id="load" point="ru.biosoft.plugins.javascript.function"> 
    <function
      name="load" 
      class="ru.biosoft.plugins.javascript.Global" 
      method="load" 
      varargs="true"> 
        <doc description="%load.descr">
           <argument name="fileName*" type="String" obligatory="true" description="%load.arg_1"/>
           <returns type="void"/>    
           <example code="%load.ex_1c" description="%load.ex_1d"/>
        </doc>
    </function>
  </extension>

  <extension id="quit" point="ru.biosoft.plugins.javascript.function"> 
    <function
      name="quit" 
      class="ru.biosoft.plugins.javascript.Global" 
      method="quit" 
      varargs="false"> 
      <doc description="%quit.descr"/>
    </function>
  </extension>

  <extension id="print" point="ru.biosoft.plugins.javascript.function"> 
    <function
      name="print" 
      class="ru.biosoft.plugins.javascript.Global" 
      method="print" 
      varargs="true"> 
        <doc description="%print.descr">
           <argument name="expr..." type="Object" obligatory="truee" description="%print.arg_1"/>
           <example code="%print.ex_1c" description="%print.ex_1d"/>
        </doc>
    </function>
  </extension>

  <extension id="serialize" point="ru.biosoft.plugins.javascript.function"> 
    <function
      name="serialize" 
      class="ru.biosoft.plugins.javascript.Global" 
      method="serialize" 
      varargs="true"> 
        <doc description="%serialize.descr">
           <argument name="object" type="Object" obligatory="true" description="%serialize.arg_1"/>
           <argument name="filename" type="String" obligatory="true" description="%serialize.arg_1"/>
           <throws type="IOException"/>
        </doc>
    </function>
  </extension>


  <extension id="version" point="ru.biosoft.plugins.javascript.function"> 
    <function
      name="version" 
      class="ru.biosoft.plugins.javascript.Global" 
      method="version" 
      varargs="true"> 
        <doc description="%version.descr">
           <argument name="version" type="String" obligatory="false" description="%version.arg_1"/>
        </doc>
    </function>
  </extension>
  
  <extension id="plot" point="ru.biosoft.plugins.javascript.function"> 
    <function
      name="plot" 
      class="ru.biosoft.plugins.javascript.Global" 
      method="plot" 
      varargs="true"> 
        <doc description="%plot.descr">
           <signature>
              <argument name="x" type="Double[]" obligatory="true" description="%plot.arg_4"/>
              <argument name="y..." type="Double[]" obligatory="true" description="%plot.arg_5"/>
           </signature>
           <signature>
              <argument name="table" type="TableDataCollection" obligatory="true" description="%plot.arg_1"/>
              <argument name="x" type="String" obligatory="true" description="%plot.arg_2"/>
              <argument name="y..." type="String" obligatory="true" description="%plot.arg_3"/>
           </signature>
           <example code="%plot.ex_2c" description="%plot.ex_2d"/>
           <example code="%plot.ex_1c" description="%plot.ex_1d"/>
        </doc>
    </function>
  </extension>
  
  <extension id="boxPlot" point="ru.biosoft.plugins.javascript.function"> 
    <function
      name="boxPlot" 
      class="ru.biosoft.plugins.javascript.Global" 
      method="boxPlot" 
      varargs="true"> 
        <doc description="%boxAndWhisker.descr">
           <signature>
              <argument name="columns" type="String[]" obligatory="true" description="%boxAndWhisker.arg_1"/>
              <argument name="values1" type="Double[]" obligatory="true" description="%boxAndWhisker.arg_2"/>
              <argument name="values2..." type="Double[]" obligatory="true" description="%boxAndWhisker.arg_2"/>
           </signature>
           <signature>
              <argument name="table" type="TableDataCollection" obligatory="true" description="%boxAndWhisker.arg_3"/>
              <argument name="columnName1" type="String" obligatory="true" description="%boxAndWhisker.arg_4"/>
              <argument name="columnName2..." type="String" obligatory="true" description="%boxAndWhisker.arg_4"/>
           </signature>
           <example code="%boxAndWhisker.ex_1c" description="%boxAndWhisker.ex_1d"/>
           <example code="%boxAndWhisker.ex_2c" description="%boxAndWhisker.ex_2d"/>
        </doc>
    </function>
  </extension>
  
  <extension id="view" point="ru.biosoft.plugins.javascript.function"> 
    <function
      name="view" 
      class="ru.biosoft.plugins.javascript.Global" 
      method="view" 
      varargs="true"> 
        <doc description="%view.descr">
           <argument name="table" type="TableDataCollection" obligatory="true" description="%view.arg_1"/>
        </doc>
    </function>
  </extension>

<!--
  <extension id="test" point="ru.biosoft.plugins.javascript.function"> 
    <function
      name="test" 
      class="ru.biosoft.plugins.javascript.Global" 
      method="test" 
      varargs="false"> 
      <argument class="java.lang.String"/> 
      <argument class="int"/> 
    </function>
  </extension>
-->

  <extension id="JavaScript actions provider" point="ru.biosoft.access.repositoryActionsProvider"> 
      <repositoryActionsProvider class="ru.biosoft.plugins.javascript.RepositoryActionsProvider"/> 
  </extension>

  <extension id="JavaScript document factory" point="ru.biosoft.workbench.documentFactory"> 
      <documentFactory 
        class="ru.biosoft.plugins.javascript.document.JSDocumentFactory"
        key="JSDocumentFactory"
      /> 
  </extension>

</plugin>
