Latest revision |
Your text |
Line 6: |
Line 6: |
| = Global Structure of the plugin.xml file = | | = Global Structure of the plugin.xml file = |
| | | |
− | Bellow we present the example provided with this tutorial, each section is explained in detail afterwards:
| + | * The plugin.xml file begins with the declaration of the '''<plugin start=[value]''' tag. Here, '''[value]''' equals a boolean value (either '''true''' or '''false'''). '''We will use false as default'''. This value is only true for some core plug-ins since they will be loaded first by the plug-in engine. |
− | | |
− | [[Image:plugin1.png]]
| |
− | | |
− | * The plugin.xml file begins with the declaration of the '''<plugin start="[value]"''' tag. Here, '''[value]''' equals a boolean value (either '''true''' or '''false'''). '''We will use false as default'''. This value is only true for some core plug-ins since they will be loaded first by the plug-in engine. | |
| ** All the information pertaining the plugin will be contained from this level on. | | ** All the information pertaining the plugin will be contained from this level on. |
| * The plug-in is terminated with the closing tag '''</plugin>''' | | * The plug-in is terminated with the closing tag '''</plugin>''' |
Line 42: |
Line 38: |
| == Lifecycle == | | == Lifecycle == |
| | | |
− | The lifecycle section is only rarely used when we need to change the default behavior of our plug-in. | + | The lifecycle section only rarely used when we need to change the default behavior of our plug-in. |
| | | |
| * It is declared as '''<lifecycleclass> ''[path.to.our.lifecycle.class]''</lifecycleclass>''' | | * It is declared as '''<lifecycleclass> ''[path.to.our.lifecycle.class]''</lifecycleclass>''' |
Line 112: |
Line 108: |
| <extensions> | | <extensions> |
| | | |
− | <extension
| + | <extension |
| uid="aibench.core" | | uid="aibench.core" |
| name="aibench.core.operation-definition" | | name="aibench.core.operation-definition" |
Line 121: |
Line 117: |
| path="20@Plugins/1@MyOperations" | | path="20@Plugins/1@MyOperations" |
| /> | | /> |
− | </extension>
| + | </extension> |
| | | |
| <extension | | <extension |
Line 134: |
Line 130: |
| | | |
| == Extension Points == | | == Extension Points == |
− |
| |
− | There are two extension points defined.
| |
− | * The first one is the '''CORE - aibench.core.operation-definition'''. This one will be used only to declare new operations.
| |
− | * The second extension point is the "WORKBENCH" - "aibench.workbench.view". This one supports the declaration of several graphical components.
| |
− |
| |
− | They are analysed in the following subsections.
| |
| | | |
| === CORE: aibench.core.operation-definition (To declare new operations) === | | === CORE: aibench.core.operation-definition (To declare new operations) === |
− |
| |
− | The generic declaration takes the following form:
| |
− |
| |
− | <extension
| |
− | uid="aibench.core"
| |
− | name="aibench.core.operation-definition"
| |
− | class="myplugin4optflux.operations.MyOperation">
| |
− | <operation-description
| |
− | name="My Operation"
| |
− | uid= "myplugin_myoperation"
| |
− | path="20@Plugins/1@MyOperations"
| |
− | />
| |
− | </extension>
| |
− |
| |
− | Where:
| |
− | * '''<extension''' - declaration of the beginning of the new extension
| |
− | ** '''uid="aibench.core"''' - This is the uid of the plug-in that contains the extension point
| |
− | ** '''name="aibench.core.operation-definition"''' - The extension point to which we will connect
| |
− | ** '''class="myplugin4optflux.operations.MyOperation">''' - The path to the class that contains our operation
| |
− | ** '''<operation-description''' - beginning the operation description
| |
− | *** '''name="My Operation"''' - The name of the operation (this will be used in the OptFlux menus)
| |
− | *** '''uid= "myplugin_myoperation"''' - The UID of our operation (this must be unique and will be useful in the future as a reference for this operation)
| |
− | *** '''path="20@Plugins/1@MyOperations"''' - The path for our operation to be placed in the OptFlux menus (position@menu/position@submenu)
| |
− | ** '''/>''' - close the operation description
| |
− | * '''</extension>''' - close the declaration of the new extension
| |
− |
| |
− | ----
| |
− | ----
| |
| | | |
| === WORKBENCH: aibench.workbench.view (To declare new views or other graphical components) === | | === WORKBENCH: aibench.workbench.view (To declare new views or other graphical components) === |
− |
| |
− | Several additions can be made to the workbench through this extension point.
| |
− |
| |
− | ----
| |
| | | |
| ==== Adding a new view for a datatype ==== | | ==== Adding a new view for a datatype ==== |
− |
| |
− | The declaration takes the form of the bellow example
| |
− |
| |
− | <extension
| |
− | uid="aibench.workbench"
| |
− | name="aibench.workbench.view" >
| |
− | <view
| |
− | name="SimpleDatatype View"
| |
− | datatype="myplugin4optflux.datatypes.MySimpleDatatype"
| |
− | class="myplugin4optflux.views.MyViewForSimpleDatatype"
| |
− | />
| |
− | </extension>
| |
− |
| |
− | Where:
| |
− | * '''<extension''' - declaration of the beginning of the new extension
| |
− | ** '''uid="aibench.workbench"''' - This is the uid of the plug-in that contains the extension point
| |
− | ** '''name="aibench.aibench.view"''' - The extension point to which we will connect
| |
− | ** '''<view''' - beginning the view description
| |
− | *** '''datatype="myplugin4optflux.datatypes.MySimpleDatatype"''' - The path to the class defining the Datatype to be viewed
| |
− | *** '''class="myplugin4optflux.views.MyViewForSimpleDatatype"''' - The path to the class defining the View for the above Datatype
| |
− | ** '''/>''' - close the view description
| |
− | * '''</extension>''' - close the declaration of the new extension
| |
− |
| |
− | ----
| |
| | | |
| ==== Adding a new operation icon ==== | | ==== Adding a new operation icon ==== |
− |
| |
− | <extension
| |
− | uid="aibench.workbench"
| |
− | name="aibench.workbench.view" >
| |
− | <icon-operation
| |
− | operation="myplugin_mymapoperation"
| |
− | icon="icons/exec.png"
| |
− | />
| |
− | </extension>
| |
− |
| |
− | Where:
| |
− | * '''<extension''' - declaration of the beginning of the new extension
| |
− | ** '''uid="aibench.workbench"''' - This is the uid of the plug-in that contains the extension point
| |
− | ** '''name="aibench.aibench.view"''' - The extension point to which we will connect
| |
− | ** '''<icon-operation''' - beginning the operation icon description
| |
− | *** '''operation="myplugin_mymapoperation""''' - The UID of the operation to which we want to define a new icon
| |
− | *** '''icon="icons/exec.png"''' - The path to the icon (relative to the root of the plugin source folder)
| |
− | ** '''/>''' - close the operation icon description
| |
− | * '''</extension>''' - close the declaration of the new extension
| |
− |
| |
− | ----
| |
| | | |
| ==== Adding a new datatype icon ==== | | ==== Adding a new datatype icon ==== |
− |
| |
− | <extension
| |
− | uid="aibench.workbench"
| |
− | name="aibench.workbench.view" >
| |
− | <icon-datatype
| |
− | datatype="myplugin4optflux.datatypes.MySimpleDatatype"
| |
− | icon="icons/blocks.png"
| |
− | />
| |
− | </extension>
| |
− |
| |
− | Where:
| |
− | * '''<extension''' - declaration of the beginning of the new extension
| |
− | ** '''uid="aibench.workbench"''' - This is the uid of the plug-in that contains the extension point
| |
− | ** '''name="aibench.aibench.view"''' - The extension point to which we will connect
| |
− | ** '''<icon-datatype''' - beginning the datatype icon description
| |
− | *** '''datatype="myplugin4optflux.datatypes.MySimpleDatatype""''' - The path to the class of the Datatype to which we want to define the icon
| |
− | *** '''icon="icons/blocks.png"''' - The path to the icon (relative to the root of the plugin source folder)
| |
− | ** '''/>''' - close the datatype icon description
| |
− | * '''</extension>''' - close the declaration of the new extension
| |
− |
| |
− | ----
| |
| | | |
| ==== Adding a custom-made GUI for an operation (override default dynamic generation of input dialog) ==== | | ==== Adding a custom-made GUI for an operation (override default dynamic generation of input dialog) ==== |
− |
| |
− | YES BUT NOT YET :)
| |