Skip to main content
Last updated March 12, 2014 11:29, by Kimov
Feedicon  
<H1> IDE Provided Trigger Hooks </H1> __TOC__ == Actions == '''Name:''' actions '''Description:''' Register actions, controllers and commands. '''Usage Example:''' <nowiki><extension xmlns="http://jcp.org/jsr/198/extension-manifest" ...></nowiki> ... <nowiki><trigger-hooks xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><triggers></nowiki> <nowiki><actions xmlns="http://xmlns.oracle.com/jdeveloper/1013/extension"></nowiki> <nowiki><action id="oracle.jdevimpl.bugfiler.FileABugAction"></nowiki> <nowiki><properties></nowiki> <nowiki><property name="Name">${FILE_A_BUG_ACTION_NAME}</property></nowiki> <nowiki><property name="MnemonicKey" rskey="FILE_A_BUG_ACTION_NAME_MNEMONIC" /></nowiki> <nowiki><property name="SmallIcon">${OracleIcons.PLACEHOLDER}</property></nowiki> <nowiki><property name="LongDescription">${FILE_A_BUG_DESCRIPTION}</property></nowiki> <nowiki><property name="Category" rskey="BUILD_CATEGORY" /></nowiki> <nowiki></properties></nowiki> <nowiki></action></nowiki> <nowiki></actions></nowiki> <nowiki><controllers xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><controller class="oracle.jdevimpl.bugfiler.ReportABugController"></nowiki> <nowiki><update-rules></nowiki> <nowiki><update-rule type="always-enabled" action="oracle.jdevimpl.bugfiler.FileABugAction"/></nowiki> <nowiki></update-rules></nowiki> <nowiki></controller></nowiki> <nowiki></controllers></nowiki> <nowiki><menu-hook </nowiki> xmlns="http://jcp.org/jsr/198/extension-manifest"> <nowiki><toolbar id="javax.ide.view.MAIN_WINDOW_TOOLBAR_ID"></nowiki> <nowiki><section id="oracle.jdeveloper.filebugsection"</nowiki> after="oracle.jdeveloper.TB_RUN_DEBUG_SECTION"> <nowiki><item action-ref="oracle.jdevimpl.bugfiler.FileABugAction"/></nowiki> <nowiki></section></nowiki> <nowiki></toolbar></nowiki> <nowiki></menu-hook></nowiki> <nowiki></triggers></nowiki> <nowiki></trigger-hooks></nowiki> ... <nowiki></extension></nowiki> '''Availability:'''<nowiki> Available. Use of <controllers> inline with actions is not supported. </nowiki> '''XSD:''' actions-hook.xsd '''Use Case:''' Locating actions at runtime. == About <nowiki><controller-class> and <command-class></nowiki> tags == <nowiki>Use of the <controller-class> tag is restricted in the trigger-hooks hook, but is allowed in the standard hooks hook. The <command-class> tag can be used in either hook because no client code is necessary to handle updating the command; the extension is initialized on command invocation.</nowiki> == Controllers == Rule-based controllers are registered outside of actions, allowing for controller reuse in several actions. You should not define the ''controller-class''<nowiki> element in the action if you are using the controllers hook as this will add a redundant controller. Controllers defined inside a <triggers> section may be applied to any action (both trigger and normal). Controllers defined inside a <hooks> section can only be applied to actions also defined inside a <hooks> section, i.e, not trigger actions. Here's what a typical <controllers> section looks like:</nowiki> <nowiki><controllers xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><controller class="com.random.FooController"></nowiki> <nowiki><update-rules></nowiki> <nowiki><!-- note that this rule must be defined in the rules hook for this rule to work --></nowiki> <nowiki><update-rule rule="on-text-node-single-selection"></nowiki> <nowiki><action id="some.action.id1"></nowiki> <nowiki><label>Perform Action on {0}</label></nowiki> <nowiki><label-param macroKey="node.name" /></nowiki> <nowiki></action></nowiki> <nowiki><action id="some.action.id2" /></nowiki> <nowiki><action id="some.action.id3"></nowiki> <nowiki><label>Perform {0} Action</label></nowiki> <nowiki><label-param>My Action</label-param></nowiki> <nowiki></action></nowiki> <nowiki></update-rule></nowiki> <nowiki></update-rules></nowiki> <nowiki></controller></nowiki> <nowiki><controller class="com.random.BarController"></nowiki> <nowiki><update-rules></nowiki> <nowiki><update-rule rule="context-has-project"></nowiki> <nowiki><action id="some.action.id3"/></nowiki> <nowiki><action id="some.action.id4"/></nowiki> <nowiki><action id="some.action.id5"/></nowiki> <nowiki></update-rule></nowiki> <nowiki></update-rules></nowiki> <nowiki></controller></nowiki> <nowiki></controllers></nowiki> Here we have a controller '''com.random.FooController'''<nowiki> that can be applied to two actions [some.action.id1, some.action.id2], and controller </nowiki>'''com.random.BarController'''<nowiki> is applied to 3 actions [some.action.i3, some.action.id4,some.action.id5]. The value of the rule attribute identifies what rule to evaluate to determine whether or not the actions should be enabled. In the above example, the rule with id "on-text-node-single-selection" is used to enable the first two actions, and and "context-has-project" is used to enable the latter 3 actions. </nowiki> <nowiki>This syntax also supports updating an action's label. As shown for action [some.action.id1] above, you use the optional child elements <label> and <label-param>. The <label> element can be used to specify a fixed (unformatted) string or, when used in conjunction with <label-param>, can be used to build a formatted label. The label-param parameter accepts these macros:</nowiki> * action.name - the first label set on the action * workspace.name - resolves to workspace.shortLabel * project.name - resolves to project.shortLabel * element.name - resolves to element.shortLabel * node.name - resolves to context.getNode().shortLabel ==== Trigger Actions, Rules and Controllers Behavior ==== For trigger actions whose owning extension is not yet initialized, the action is enabled based only on the registered rules; the controller's update method is not called until the extension has been initialized. In the case that an action is invoked and the registered controller's update method has not been called, we will explicitly call the controller's update method before calling handleEvent. There are 3 expected outcomes in this situation: # Controller.update() returns true, handleEvent is called. # Controller.update() returns true, but disables the action. In this case, you must implement TriggerController to inform the user why the action cannot be performed, handleEvent is not called. # Controller.update() returns true, handleEvent() is called and steps the user through the process of setting up a context where the action can be performed. ==== When to use an oracle.ide.controller.TriggerController ==== If you cannot accurately disable an action using declarative rules, such that the action is enabled when it cannot be safely invoked, you should implement TriggerController and let the user know why the action cannot be performed in the current context. '''Availability:''' Available '''XSD:''' controllers-hook.xsd. == Menus == '''Name:''' menus '''Description:''' Adds menus and menu items to the main menu bar. '''Usage Example:''' <nowiki><extension xmlns="http://jcp.org/jsr/198/extension-manifest"></nowiki> ... <nowiki><trigger-hooks xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><triggers></nowiki> <nowiki><menu-hook xmlns="http://jcp.org/jsr/198/extension-manifest"></nowiki> <nowiki><menus></nowiki> <nowiki><!-- 'javax.ide.view.MAIN_WINDOW_MENUBAR_ID' identifies</nowiki> JDeveloper's main menu bar. --> <nowiki><menubar id="javax.ide.view.MAIN_WINDOW_MENUBAR_ID"></nowiki> <nowiki><!-- Adds trigger menu items to my custom menu. --></nowiki> <nowiki><menu id="MY_CUSTOM_MENU"></nowiki> <nowiki><!-- 'weight' is used to control where the section appears in</nowiki> the menu. Weights are sorted in ascending order, each unique value is its own section. --> <nowiki><section id="MY_CUSTOM_MENU_SECTION_ONE" weight="1.0"></nowiki> <nowiki><!-- For menu items and submenus, weight determines the</nowiki> order within a menu section. Items are sorted in ascending order or in the order they are added if the weight is not unique. --> <nowiki><item action-ref="myTriggerActionId" weight="1.0" /></nowiki> <nowiki><item action-ref="myOtherTriggerActionId" weight="2.0" /></nowiki> <nowiki></section></nowiki> <nowiki><!-- 'alphasort' is used to make a menu section sort its contents</nowiki> alphabetically by label, rather than by assigned weight. Weights are ignored if the menu item or submenu resides within a section that is marked for alphabetical sorting. --> <nowiki><section id="MY_SORTED_MENU_SECTION" weight="2.0" alphasort="true"></nowiki> <nowiki><item action-ref="someActionId" weight="10.0" /></nowiki> <nowiki><!-- 'defaultsection' defines a section where items will be added</nowiki> to this menu if no section weight is defined for an item. This allows the menu owner to define a reasonable location for extra items to be located. Notice too that the weight of the submenu is less than that of the item defined first. It will appear before the menu item. --> <nowiki><menu id="MY_SUBMENU" weight="3.0" defaultsection="1000.0"></nowiki> <nowiki></section></nowiki> <nowiki></menu></nowiki> <nowiki></menubar></nowiki> <nowiki></menus></nowiki> <nowiki></menu-hook></nowiki> <nowiki></triggers></nowiki> <nowiki></trigger-hooks></nowiki> <nowiki></extension></nowiki> '''Availability:''' Available '''XSD:''' extension.xsd. ==== FCP-supplied menu ids are: ==== * javax.ide.FILE_MENU_ID * javax.ide.EDIT_MENU_ID * javax.ide.VIEW_MENU_ID * javax.ide.HELP_MENU_ID ==== FCP-supplied sections are: ==== * javax.ide.OPEN_SECTION_ID * javax.ide.NEW_SECTION_ID * javax.ide.CLOSE_SECTION_ID * javax.ide.PRINT_SECTION_ID * javax.ide.SAVE_SECTION_ID * javax.ide.COPY_PASTE_SECTION_ID * menu-addin-section-id ==== JDeveloper menu IDs ==== Constants for many of JDeveloper's standard menu ids are defined in oracle.ide.IdeMainWindow. ==== Assigning weight and section values to menu and submenu items ==== The ''weight'' attribute allows you to specify a value for section weights and item weights. The weight is a float value which is stored as a client property in the menu item object. Weights are used to sort items in a menu in ascending order. For sections, each unique weight value identifies a new section, and again, the sections are ordered in ascending order. If the weight attribute is not specified for a section, items within the section are added to the section defined by the menu as the location to add undefined items. The default section can be defined for a menu using the 'defaultsection' attribute. Run JDeveloper with this command line flag: ''-J-Dide.IdeAction.debug=true.'' When this flag is used, the weight and section values are shown in the menu item's tooltip. == Context Menus == '''Name:''' context-menu-hook '''Description:''' Adds menu items to the context menus of editor, navigator or explorer. '''Usage Example:''' <nowiki><trigger-hooks xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><triggers></nowiki> <nowiki><context-menu-hook rule="context-has-java-source-node"></nowiki> <nowiki><site idref="navigator"/></nowiki> <nowiki><extension-listener class="my.package.MyContextMenuListener"/></nowiki> <nowiki><menu></nowiki> <nowiki><!-- 'weight' is used to control where the section appears in</nowiki> the menu. Weights are sorted in ascending order, each unique value is its own section. --> <nowiki><!-- section element must be in namespace</nowiki> http://jcp.org/jsr/198/extension-manifest. --> <nowiki><section xmlns="http://jcp.org/jsr/198/extension-manifest" id="MY_CUSTOM_MENU_SECTION_ONE" weight="1.0"></nowiki> <nowiki><!-- For menu items and submenus, weight determines the</nowiki> order within a menu section. Items are sorted in ascending order or in the order they are added if the weight is not unique. --> <nowiki><item action-ref="myTriggerActionId" weight="1.0" /></nowiki> <nowiki><item action-ref="myOtherTriggerActionId" weight="2.0" /></nowiki> <nowiki></section></nowiki> <nowiki></menu></nowiki> <nowiki></context-menu-hook></nowiki> <nowiki></triggers></nowiki> <nowiki></trigger-hooks></nowiki> '''Availability:''' Available '''XSD:'''<nowiki> context-menu-hook.xsd in ide. The <site> </nowiki>'''idref''' identifies the context menu(s) to which the menu items are to be inserted. If more than one site is specified, the site ids must be separated by commas. Sites are defined by the views themselves. Sites defined by the IDE are: '''navigator''', '''explorer''' and '''editor'''. Two additional sites are '''rescat''' and '''palette'''<nowiki>; any extension's views can define sites for access to its context menus.</nowiki> <nowiki>The <extension-listener> element is optional; if it is not used, the context-menu-hook operates as described below, whether or not the extension is loaded. See the </nowiki>[[#extension_listener | Extension Listener]] section below for more information. Each context-menu-hook must be associated with a rule. The menu items will will be inserted into the view's context menu by the context-menu-hook listener if and only if the rule evaluates to true. The value of the ''''rule' attribute''' identifies what rule to evaluate. A rule, including '''context-has-view''', which is implied by the site id, need not be repeated as a rule in the controller for the action; instead, use the '''always-enabled''' rule in the controller. This will ensure that context menu items only appear when they are enabled. <nowiki>The outer <menu> element is the context menu being added to; no menu identifier is necessary. The </nowiki><nowiki>outer <menu> element may have only <section> child elements.</nowiki> <span id="extension_listener"></span> === Extension Listener === <nowiki>The optional <extension-listener> element names a class defined in the extension that implements oracle.ide.controller.ContextMenuListener. The listener class must be public and have a null constructor. An extension using this feature should not explicitly add the listener to the same context menu in its initialization method, as this might result in more than one instance of the listener being called for the same menu.</nowiki> <nowiki>The <insert-when> rules are always tested. If true, and the extension is loaded, listener calls are forwarded to the extension listener; if the extension is not loaded and the call is </nowiki>'''menuWillShow'''<nowiki> the <menu> items are inserted. This is the logic for </nowiki>'''menuWillShow''': if (insertWhenRulesMatch()) { if (hasExtensionListener() && extensionIsLoaded()) forwardToExtensionListener(); else addMenuSection(); } Therefore, when it is called, the extension listener is responsible for adding any menus or items. The listener not limited to doing what the context-menu-hook listener does; it need not add the same menu items and may add other menu items. == Editor Menu == '''Name:''' editor-menu-hook '''Description:''' Adds menu items to the editor menu, e.g., '''Source''' menu. '''Usage Example:''' <nowiki><trigger-hooks></nowiki> <nowiki><triggers></nowiki> <nowiki><editor-menu-hook></nowiki> <nowiki><insert-when></nowiki> <nowiki><and></nowiki> <nowiki><rule type="context-has-project"/></nowiki> <nowiki><or></nowiki> <nowiki><!-- Simple rule format for rules with just one param --></nowiki> <nowiki><rule type="context-has-node" name="node-class" value="oracle.bali.xml.addin.XmlSourceNode"/></nowiki> <nowiki><!-- More typing is allowed, as well --></nowiki> <nowiki><rule type="context-has-node"></nowiki> <nowiki><parameters></nowiki> <nowiki><param name="node-class" value="="oracle.jdeveloper.model.JavaSourceNode"/></nowiki> <nowiki></parameters></nowiki> <nowiki></rule></nowiki> <nowiki></or></nowiki> <nowiki></and></nowiki> <nowiki></insert-when></nowiki> <nowiki><menu></nowiki> <nowiki><!-- 'weight' is used to control where the section appears in</nowiki> the menu. Weights are sorted in ascending order, each unique value is its own section. --> <nowiki><!-- section element must be in namespace</nowiki> http://jcp.org/jsr/198/extension-manifest. --> <nowiki><section xmlns="http://jcp.org/jsr/198/extension-manifest" id="MY_CUSTOM_MENU_SECTION_ONE" weight="1.0"></nowiki> <nowiki><!-- For menu items and submenus, weight determines the</nowiki> order within a menu section. Items are sorted in ascending order or in the order they are added if the weight is not unique. --> <nowiki><item action-ref="myTriggerActionId" weight="1.0" /></nowiki> <nowiki><item action-ref="myOtherTriggerActionId" weight="2.0" /></nowiki> <nowiki></section></nowiki> <nowiki></menu></nowiki> <nowiki></editor-menu-hook></nowiki> <nowiki></trigger></nowiki> <nowiki></trigger-hooks></nowiki> '''Availability:''' Available '''XSD:'''<nowiki> editor-menu-hook.xsd in ide. <insert-when> behaves the same as in <context-menu-hook> except that the rules are only evaluated when an editor is active.</nowiki> The currently available rules are: * '''context-has-view''' matches the node in the context to the node class. This rule expects a '''view-class''' parameter. * '''context-has-node''' matches the node in the context to the node class. This rule expects a '''node-class''' parameter. <nowiki><menu> behaves the same as in <context-menu-hook> except that the menu added to is always the editor-specific menu, e.g., Source.</nowiki> At least one positive '''context-has-view''' rule is required, to identify a specific editor whose menu is to be added to. More than one rule is allowed. <nowiki>(A rule not enclosed in a <not> element or enclosed within even numbers of <not> elements is a positive rule. In other words, you cannot say "Apply this to any editor view except X," but you can say "Apply this to editor view X unless if it is an instance of Y.")</nowiki> The use of any rules other than '''context-has-view''' or '''context-has-node''' in an editor menu is questionable. Unlike context menus, where (usually) only enabled menu items appear, menubar menus are expected to be relatively static, with disabled items when not applicable. Use the controller update-rules to specify enabling/disabling a menu item based on dynamic states. === Use as a standard (non-trigger) hook === '''editor-menu-hook''' may also be used as a non-trigger hook. '''Usage Example:''' <nowiki><extension ...></nowiki> ... <nowiki><trigger-hooks xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><triggers></nowiki> ... <nowiki><actions xmlns="http://xmlns.oracle.com/jdeveloper/1013/extension"></nowiki> <nowiki><action id="HProfileStartTimeCommand"></nowiki> <nowiki><properties></nowiki> <nowiki><property name="Name" rskey="PROFILE_START_TIME_MENUITEM"/></nowiki> <nowiki><property name="MnemonicKey" rskey="PROFILE_START_TIME_MENUITEM_MNEMONIC" /></nowiki> <nowiki><property name="SmallIcon">${OracleIcons.PROFILER_CPU_PROFILE}</property></nowiki> <nowiki></properties></nowiki> <nowiki></action></nowiki> <nowiki></actions></nowiki> <nowiki><controllers xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><controller class="oracle.jdevimpl.profiler.ProfilerController"></nowiki> <nowiki><update-rules></nowiki> <nowiki><update-rule rule="context-has-project"></nowiki> <nowiki><action id="HProfileStartTimeCommand"/></nowiki> <nowiki></update-rule></nowiki> <nowiki></update-rules></nowiki> <nowiki></controller></nowiki> <nowiki></controllers></nowiki> ... <nowiki></triggers></nowiki> <nowiki></trigger-hooks></nowiki> <nowiki><hooks></nowiki> <nowiki><editor-menu-hook xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><insert-when></nowiki> <nowiki><rule type="context-has-view" name="view-class" value="oracle.ide.ceditor.CodeEditor"/></nowiki> <nowiki></insert-when></nowiki> <nowiki><menu></nowiki> <nowiki><section xmlns="http://jcp.org/jsr/198/extension-manifest" id="oracle.jdeveloper.TB_RUN_DEBUG_SECTION" weight="5.0"></nowiki> <nowiki><item action-ref="HProfileStartTimeCommand"/></nowiki> <nowiki></section></nowiki> <nowiki></menu></nowiki> <nowiki></editor-menu-hook></nowiki> <nowiki></hooks></nowiki> <nowiki></extension></nowiki> An '''editor-menu-hook''' can be moved from '''trigger-hooks''' to '''hooks''' with no more change than adding xmlns="http://xmlns.oracle.com/ide/extension" (required). The hook can refer to actions defined in '''trigger-hooks'''. As a hook, the menu items will not be added until the extension is loaded. == Accelerators/Shortcut Keys == '''Name:''' accelerator-hook '''Description:''' Registers files that contain accelerator key definitions for actions registered by the extension '''Usage Example:''' <nowiki><extension xmlns="http://jcp.org/jsr/198/extension-manifest"></nowiki> ... <nowiki><trigger-hooks xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><triggers></nowiki> <nowiki><accelerator-hook></nowiki> <nowiki><file>oracle/jdevimpl/help/accelerators.xml</file></nowiki> <nowiki><file>oracle/jdevimpl/help/localaccelerators.xml</file></nowiki> <nowiki></accelerator-hook></nowiki> <nowiki></triggers></nowiki> <nowiki></trigger-hooks></nowiki> <nowiki></extension></nowiki> NOTE: If you switch from programmatic to declarative registration of accelerator files, delete your system directory before testing. If not, the IDE will use your programmatic one and not use your declarative one, leaving you wondering what's wrong. '''Availability:''' Available '''XSD:''' accelerator-hook.xsd == Gallery Items == '''Name:''' gallery '''Description:''' Registers gallery folders and gallery items. '''Usage Example:''' <nowiki><extension xmlns="http://jcp.org/jsr/198/extension-manifest" ...></nowiki> ... <nowiki><trigger-hooks xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><triggers></nowiki> <nowiki><gallery xmlns="http://xmlns.oracle.com/jdeveloper/1013/extension"></nowiki> <nowiki><folders></nowiki> <nowiki><!-- The 'label' attribute allows the folder name to be translated; the key</nowiki> must be in the extension manifest resource bundle. --> <nowiki><name label="${GALLERY_FOLDER_PROJECTS}">Projects</name></nowiki> <nowiki><category>General</category></nowiki> <nowiki></folders></nowiki> <nowiki><item rule="always-enabled"></nowiki> <nowiki><!-- name is the fully-qualified name of an oracle.ide.wizard.Invokable </nowiki> --> <nowiki><name>oracle.jdeveloper.template.wizard.TemplateWizard</name></nowiki> <nowiki><!-- id is optional, and if specified will be stored in the Context</nowiki> so it can be retrieved when the wizard is invoked. --> <nowiki><id>Application</id></nowiki> <nowiki><!-- description is the short label of the gallery item --></nowiki> <nowiki><description>${NEW_APPLICATION_TEMPLATE_GALLERY_ITEM}</description></nowiki> <nowiki><!-- help is the long label for the gallery item --></nowiki> <nowiki><help>${MANAGE_TEMPLATES_WIZARD_DESCRIPTION}</help></nowiki> <nowiki><folder>Applications</folder></nowiki> <nowiki><technologyKey>General</technologyKey></nowiki> <nowiki><icon>/oracle/javatools/icons/apptemplate.jpg</icon></nowiki> <nowiki></item></nowiki> <nowiki></gallery></nowiki> <nowiki></triggers></nowiki> <nowiki></trigger-hooks></nowiki> ... <nowiki></extension></nowiki> The above example shows the use of the new ''id'' element which is used to invoke a wizard by its id. The related Wizard.invoke(context) code looks like: String id = Wizard.getWizardId(context); if (oracle.ide.model.Workspace.DATA_KEY.equals(id) { ... } <nowiki>Each gallery <item> has a required attribute 'rule'. The value of the 'rule' attribute identifies what rule to evaluate to decide whether or not the gallery item should be enabled. </nowiki> '''Some Common Rules''' Most of our existing wizards are enabled in the gallery if the context has a project or has a workspace, and some items are always enabled. There are Rule implementations for each of these. To use in the extension.xml, use one of these IDs: <nowiki><item rule="always-enabled">...</item></nowiki> <nowiki><item rule="context-has-project">...</item></nowiki> <nowiki><item rule="context-has-workspace">...</item></nowiki> '''Availability:''' Available '''XSD:''' idehook.xsd == Technology Scopes == '''Name:''' technology-hook '''Description:''' Registers a technology that augments the base IDE Technology definitions. '''Usage Example:''' <nowiki><extension xmlns="http://jcp.org/jsr/198/extension-manifest" ...></nowiki> ... <nowiki><trigger-hooks xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><triggers></nowiki> <nowiki><technology-hook xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><technology></nowiki> <nowiki><key>Java</key></nowiki> <nowiki><name>${JAVA_TECH}</name></nowiki> <nowiki><description>${JAVA_TECH_DESC}</description></nowiki> <nowiki><wizard-pages></nowiki> <nowiki><page></nowiki> <nowiki><traversable-class>oracle.jdevimpl.wizard.project.JavaTechnologyPanel</traversable-class></nowiki> <nowiki></page></nowiki> <nowiki></wizard-pages></nowiki> <nowiki></technology></nowiki> <nowiki><technology></nowiki> <nowiki><key>Swing/AWT</key></nowiki> <nowiki><name>${SWING_AWT_TECH}</name></nowiki> <nowiki><description>${SWING_AWT_TECH_DESC}</description></nowiki> <nowiki><technology-dependencies></nowiki> <nowiki><key>Java</key></nowiki> <nowiki></technology-dependencies></nowiki> <nowiki><technology></nowiki> <nowiki></technology-hook></nowiki> <nowiki></triggers></nowiki> <nowiki></trigger-hooks></nowiki> ... <nowiki></extension></nowiki> '''Availability:''' Available '''XSD''': technology-hook.xsd == Editors == '''Name:''' editors '''Description:''' Register editors. '''Usage Example:''' <nowiki><extension xmlns="http://jcp.org/jsr/198/extension-manifest" ...></nowiki> ... <nowiki><trigger-hooks xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><triggers></nowiki> <nowiki><editors></nowiki> <nowiki><editor id="SwingDesigner"</nowiki> editor-class="oracle.jdevimpl.uieditor.UIEditorImpl" label="${EDITOR_LABEL}" default="false" duplicable="false"> <nowiki><node-type class="oracle.jdeveloper.model.JavaSourceNode"/></nowiki> <nowiki></editor></nowiki> <nowiki><dynamic-editor</nowiki> id="HistoryViewer" rule="context-has-local-history" editor-class="oracle.jdevimpl.history.HistoryViewer" weight="0.4" label="${EDITOR_LABEL}" default="false" duplicable="false" /> <nowiki></editors></nowiki> <nowiki></triggers></nowiki> <nowiki></trigger-hooks></nowiki> ... <nowiki></extension></nowiki> == NodeFactory Recognizers == '''Name:''' node-recognizers-hook '''Description:''' Register node recognizing rules. '''Usage Example:''' <nowiki><extension xmlns="http://jcp.org/jsr/198/extension-manifest" ...></nowiki> ... <nowiki><trigger-hooks xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><triggers></nowiki> <nowiki><node-recognizers-hook xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><node-conversions></nowiki> <nowiki><node-conversion></nowiki> <nowiki><old-type>oracle.jdeveloper.model.JspSourceNode</old-type></nowiki> <nowiki><new-type>oracle.jdevimpl.webapp.html.HtmlSourceNode</new-type></nowiki> <nowiki></node-conversion></nowiki> <nowiki></node-conversions></nowiki> <nowiki><url-recognizer></nowiki> <nowiki><protocol></nowiki> <nowiki><protocol>xss</protocol></nowiki> <nowiki><node-type>oracle.xss.XssSourceNode</node-type></nowiki> <nowiki></protocol></nowiki> <nowiki><file-extension></nowiki> <nowiki><extension>.java</extension></nowiki> <nowiki><node-type>oracle.jdeveloper.model.JavaSourceNode</node-type></nowiki> <nowiki></file-extension></nowiki> <nowiki><file-content-patterns></nowiki> <nowiki><pattern>/**ADFFaces_Skin_File / DO NOT REMOVE**/</pattern></nowiki> <nowiki><file-content-patterns></nowiki> <nowiki></url-recognizer></nowiki> <nowiki><xml-recognizer></nowiki> <nowiki><namespace></nowiki> <nowiki><uri>http://myfaces.apache.org/trinidad/skin</uri></nowiki> <nowiki><elem-name>skins</elem-name></nowiki> <nowiki><node-type>oracle.jdevimpl.webapp.jsp.taglibraries.trinidad.skins.TrinidadSkinsNode</node</nowiki>-type> <nowiki></namespace></nowiki> <nowiki><schema></nowiki> <nowiki><!-- location has to be a URI --></nowiki> <nowiki><location>http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd</location></nowiki> <nowiki><root-elem>persistence</root-elem></nowiki> <nowiki><node-type>oracle.toplink.workbench.addin.node.PersistenceNode</node-type></nowiki> <nowiki></schema></nowiki> <nowiki><doctype></nowiki> <nowiki><public-id>-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN</public-id></nowiki> <nowiki><system-id>http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd</system-id></nowiki> <nowiki><node-type>oracle.jdeveloper.xml.j2ee.tld.TagLibNode</node-type></nowiki> <nowiki></doctype></nowiki> <nowiki><root-elem></nowiki> <nowiki><elem-name>logging_configuration</elem-name></nowiki> <nowiki><node-type>ADFLoggingNode</node-type></nowiki> <nowiki></root-elem></nowiki> <nowiki></xml-recognizer></nowiki> <nowiki></node-recognizers-hook></nowiki> <nowiki></triggers></nowiki> <nowiki></trigger-hooks></nowiki> ... <nowiki></extension></nowiki> '''Availability:''' Available '''XSD:''' node-recognizer-hook.xsd == IDE Preferences/Settings == '''Name:''' settings-ui-hook '''Description:''' Register Settings UI panel '''Usage description''': <nowiki><extension xmlns="http://jcp.org/jsr/198/extension-manifest" ...></nowiki> ... <nowiki><trigger-hooks xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><triggers></nowiki> <nowiki><settings-ui-hook xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><page id="CoolFeaturePrefs" parent-idref="/preferences"></nowiki> <nowiki><label>${SOME_RES_KEY}</label></nowiki> <nowiki><tooltip>${SOME_RES_KEY}</tooltip></nowiki> <nowiki><traversable-class>oracle.killerapp.coolfeature.CoolFeaturePrefsPanel</traversable-class></nowiki> <nowiki></page></nowiki> <nowiki></settings-ui-hook></nowiki> <nowiki></triggers></nowiki> <nowiki></trigger-hooks></nowiki> ... <nowiki></extension></nowiki> '''Availability:''' Available. '''XSD''': settings-ui-hook.xsd == Application Preferences/Settings == Same as IDE Preferences/Settings. == Project Preferences/Settings == Same as IDE Preferences/Settings. Project Preferences relate to ContentSetProviders. Sample from adfmcoredt-ide <nowiki><trigger-hooks xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><triggers></nowiki> <nowiki><settings-ui-hook xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><page id="DbPanelSettings" parent-idref="/preferences"></nowiki> <nowiki><label>${DBPANELSETTINGS}</label></nowiki> <nowiki><tooltip>${DBPANELSETTINGS}</tooltip></nowiki> <nowiki><traversable-class>oracle.adfdtinternal.model.ide.dbpanel.settings.DbPanelSettingsPanel</traversable-class></nowiki> <nowiki></page></nowiki> <nowiki></settings-ui-hook></nowiki> <nowiki><settings-ui-hook xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><page id="ADFmSettings" parent-idref="/Project"></nowiki> <nowiki><label>${ADFMSETTINGS}</label></nowiki> <nowiki><tooltip>${ADFMSETTINGS}</tooltip></nowiki> <nowiki><traversable-class>oracle.adfdtinternal.model.ide.settings.ADFMSettingsPanel</traversable-class></nowiki> <nowiki></page></nowiki> <nowiki></settings-ui-hook></nowiki> <nowiki><settings-ui-hook xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><page id="ADFmRegisteredRules" parent-idref="/Project/ADFmSettings"></nowiki> <nowiki><label>${REGISTERED_RULES}</label></nowiki> <nowiki><tooltip>${REGISTERED_RULES}</tooltip></nowiki> <nowiki><traversable-class>oracle.jbo.dt.validation.RegisteredRulesPanel</traversable-class></nowiki> <nowiki></page></nowiki> <nowiki></settings-ui-hook></nowiki> == Content Set Providers == '''Name:''' content-set-providers-hook '''Description:''' Enables registration of lazily instantiated content set providers. '''Usage Example''': <nowiki><content-set-providers-hook xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><content-set-provider></nowiki> <nowiki><label>Application Sources</label></nowiki> <nowiki><navigable-label>Java Paths</navigable-label></nowiki> <nowiki><key>oracle.jdeveloper.model.PathsConfiguration/javaContentSet</key></nowiki> <nowiki><class>oracle.jdeveloper.model.JavaContentSetProvider</class></nowiki> <nowiki><display-folders-as-packages>true</display-folders-as-packages></nowiki> <nowiki><can-contain-java-sources>true</can-contain-java-sources></nowiki> <nowiki><flat-level-enabled>true</flat-level-enabled></nowiki> <nowiki><application-level-content>false</application-level-content></nowiki> <nowiki></content-set-provider></nowiki> <nowiki></content-set-providers-hook></nowiki> '''Availability:''' Available '''XSD''': content-set-providers.hook.xsd == Singleton Registration == '''Name:''' singleton-provider-hook '''Description:''' Enables registration of lazily instantiated singletons. '''Usage Example:''' <nowiki><?xml version = '1.0' encoding = 'UTF-8'?></nowiki> <nowiki><extension xmlns="http://jcp.org/jsr/198/extension-manifest"</nowiki> id="com.acme.myid" esdk-version="1.0" version="11.1.1"> <nowiki><trigger-hooks xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><triggers></nowiki> <nowiki><singleton-provider-hook></nowiki> <nowiki><singleton headless="false"</nowiki> base-class="com.acme.MyService" impl-class="com.acme.impl.MyServiceImpl" /> <nowiki></singleton-provider-hook></nowiki> <nowiki></triggers></nowiki> <nowiki></trigger-hooks></nowiki> <nowiki></extension></nowiki> '''Availability:''' Available '''XSD:''' [../../../../asengwiki/download/attachments/377192790/service-provider-hook.xsd%3Fversion=1 service-provider-hook.xsd][[Image:link_attachment_7.gif]] '''Use Case:''' The use of a registered singleton pattern is very common in several areas of the IDE, for example LogManager.getLogManager() or ExtensionRegistry.getExtensionRegistry(). Several extensions implement this pattern by using JNDI and a pair of static methods like this: On extension '''oracle.ide''' (let's call it '''A''') public abstract class LogManager { public static LogManager getLogManager() { LogManager logManager = (LogManager) Names.lookup(Names.newInitialContext(), LOG_MANAGER_NAME); if( logManager == null ) { logManager = new BasicLogManager(); } return logManager; } public static void setLogManager( LogManager logManager ) { Names.bind( Names.newInitialContext(), LOG_MANAGER_NAME, logManager ); } } On extension '''oracle.ideimpl''' (let's call it '''B''') which has a strict dependency on '''oracle.ide''': class LogManagerImpl { LogManagerImpl() { LogManager.setLogManager(this); } } The problem comes when a third extension like '''oracle.ide.feedbackmanager''' (let's call it '''C''') tries to use a LogManager (from '''oracle.ide''') but '''oracle.ideimpl''' has not been initialized yet for some reason. There can't be a hard dependency from '''B''' to '''A''' to have LogManagerImpl be initialized and set before '''C''' tries to access it. Another mechanism is needed and it has to be declarative too. This is the reason for the introduction of a new hook: the singleton-provider-hook. This hook will feed data to '''oracle.ide.SingletonProvider''' (package and class name subject to change) which will keep a record of all singletons by base-class/impl-class and extension id. SingletonProvider will expose a single method to extension writers to retrieve a singleton instance from the cache. The important thing to remember here is that the extension may have not been initialized yet (remember we're using declarative registration), which means this method will check with the ExtensionRegistry to determine if the extension needs to be initialized or not. Hence why this hook is also a trigger hook. The code now becomes: On extension '''oracle.ide''' public abstract class LogManager { public static LogManager getLogManager() { LogManager logManager = SingletonProvider.find(LogManager.class); if( logManager == null ) { logManager = new BasicLogManager(); } return logManager; } } On extension '''oracle.ideimpl''' class LogManagerImpl { LogManagerImpl() { } } On '''oracle.ideimpl''''s extension manifest <nowiki><?xml version = '1.0' encoding = 'UTF-8'?></nowiki> <nowiki><extension xmlns="http://jcp.org/jsr/198/extension-manifest"</nowiki> id="oracle.ideimpl" esdk-version="1.0" version="11.1.1"> <nowiki><trigger-hooks xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><triggers></nowiki> <nowiki><singleton-provider-hook></nowiki> <nowiki><singleton base-class="oracle.ide.log.LogManager"</nowiki> impl-class="oracle.ideimpl.log.LogManagerImpl" /> <nowiki></singleton-provider-hook></nowiki> <nowiki></triggers></nowiki> <nowiki></trigger-hooks></nowiki> <nowiki></extension></nowiki> '''Note:''' the '''headless''' attribute in the singleton-provider-hook is optional and if left out will be treated as '''true'''. This attribute is consulted when an instance of the singleton needs to be created. When running in headless mode, a call to SingletonProvider.find() will return null for a singleton registered with headless="false". == Application and Project Migrators == '''Name:''' migrator-trigger-hook '''Description:''' Register a Migrator. '''Usage Example:''' <nowiki><extension xmlns="http://jcp.org/jsr/198/extension-manifest" ...></nowiki> ... <nowiki><trigger-hooks xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><triggers></nowiki> <nowiki><node-migrator-hook></nowiki> <nowiki><application-migrators></nowiki> <nowiki><migrator></nowiki> <nowiki><key>OfflineTransferMigrator</key></nowiki> <nowiki><version>11.1.1.1.0</version></nowiki> <nowiki><class>oracle.jdevimpl.offlinedb.migration.OfflineTransferMigrator</class></nowiki> <nowiki></migrator></nowiki> <nowiki></application-migrators></nowiki> <nowiki><project-migrators></nowiki> <nowiki><migrator></nowiki> <nowiki><key>PageDefinitionParameterValueMigrator</key></nowiki> <nowiki><version>11.1.1.1.0.5</version></nowiki> <nowiki><class>oracle.adfdtinternal.model.ide.xmled.migration.PageDefinitionParameterValueMigrator</class></nowiki> <nowiki></migrator></nowiki> <nowiki></project-migrators></nowiki> <nowiki></node-migrator-hook></nowiki> <nowiki></triggers></nowiki> <nowiki></trigger-hooks></nowiki> ... <nowiki></extension></nowiki> '''Availability:''' Available '''XSD:''' migrator-trigger-hook.xsd '''Notes:''' version attribute can be omitted, if so the the default from NodeMigratorHelper will be used. This means that it will work exactly as programmatic registration of NodeMigrationHeper subclass which does NOT override the getNodeMigratorHelperVersion() method. For more information see the Javadoc for NodeMigratorHelper.getNodeMigratorHelperVersion() == URLFileSystem Hook == '''Name:''' urlfilesystem-hook '''Description:''' Register a <tt>URLFileSystemHelper</tt>, <tt>URLFileSystemHelperDectorator</tt>, or <tt>URLStreamHandlerFactory</tt> with the <tt>URLFileSystem</tt>. '''Usage Example:''' Here is an excerpt from the <tt>vfs</tt> module extension manifest, which registers a <tt>URLFileSystemHelperDecorator</tt> for the "file" protocol. <nowiki><urlfilesystem-hook xmlns="http://xmlns.oracle.com/jdeveloper/hooks/urlfilesystem"></nowiki> <nowiki><fsdecorator protocol="file" class="oracle.ide.net.VirtualFileSystemHelper" /></nowiki> <nowiki></urlfilesystem-hook></nowiki> '''Availability:''' Available. '''XSD:''' urlfilesystem-hook.xsd[[Image:linkext7.gif]] Extension initialization will be triggered when the helper, decorator, or stream handler factory is needed. For handlers and decorators, this is when the corresponding protocol is used. == ImportExport Hook == '''Name:''' importexport-hook '''Description:''' Registers an import or export wizard with the import/export framework '''Usage Example:''' Here is an excerpt from the <tt>vcs-dimensions</tt> module extension manifest <nowiki><importexport-hook xmlns="http://xmlns.oracle.com/ide/1013/ide-importexport"></nowiki> <nowiki><import class="oracle.jdevimpl.vcs.dimensions.DMImportExportWizard"</nowiki> name="${IMPORT_WZ_TITLE}" tooltip="${IMPORT_WZ_TOOLTIP}"> <nowiki></import></nowiki> <nowiki><export class="oracle.jdevimpl.vcs.dimensions.DMImportExportWizard"</nowiki> name="${EXPORT_WZ_TITLE}" tooltip="${EXPORT_WZ_TOOLTIP}"> <nowiki></export></nowiki> <nowiki></importexport-hook></nowiki> '''Availability: '''Available '''XSD: '''importexport-hook.xsd '''Note: '''The importexport-hook must NOT be used in a conditional section of the triggers-hook == Product hook == '''Name:''' product-hook '''Description:''' Registers product information used to brand the product including providing information to the about box '''Usage Example:''' Here is an excerpt from the <tt>jdeveloper-extras</tt> module extension manifest <nowiki><product-hook xmlns="http://xmlns.oracle.com/ide/extension"</nowiki> name="Oracle JDeveloper 11g Development Build" icon="res:${PRODUCT_ICON}" short-name="JDeveloper" edition-name="Java Edition" welcome-page="uri:../doc/welcome-java/welcome.html" bugdb-prod-id="807" bugdb-comp-id="JDEV" feedback-server="cdandoy-www.us.oracle.com" feedback-port="4656"> <nowiki><!-- Do Not translate the copyright message. It needs to be changed</nowiki> even when WPTG have locked down translations. --> <nowiki><about-box</nowiki> copyright="Copyright &#x00A9; 1997, 2010 Oracle and/or its affiliates. All rights reserved." image="${OracleIcons.HEADER_JDEVELOPER}" banner-image="res:${PRODUCT_ABOUT_BANNER_IMAGE}"/> <nowiki><file-association suffix=".jws" label="${JDEV_WORKSPACE}" regkey="JDeveloper.jwsFile"/></nowiki> <nowiki><file-association suffix=".jpr" label="${JDEV_PROJECT}" regkey="JDeveloper.jprFile"/></nowiki> <nowiki><file-association suffix=".java" label="${JAVA_SOURCE_FILE}" regkey="JDeveloper.javaFile"/></nowiki> <nowiki><file-association suffix=".jsp" label="${JAVA_SERVER_PAGE}" </nowiki>regkey="JDeveloper.jspFile"/> <nowiki><additional-icons></nowiki> <nowiki><icon>res:${PRODUCT_ICON_48}</icon></nowiki> <nowiki><icon>res:${PRODUCT_ICON_64}</icon></nowiki> <nowiki></additional-icons></nowiki> <nowiki></product-hook></nowiki> '''Availablilty:''' Available '''XSD:''' product-hook.xsd '''Note: '''The product-hook must NOT be used in a conditional section of the triggers-hook == Menu Customizations hook == '''Name:''' menu-customizations '''Description:''' Registers information about menus that are to be hidden '''Usage Example:''' <nowiki><hooks></nowiki> <nowiki><menu-customizations xmlns="http://xmlns.oracle.com/ide/customization"></nowiki> <nowiki><action idref="ObjectGalleryCommand" unavailable="true"></nowiki> <nowiki><hidden>false</hidden></nowiki> <nowiki></action></nowiki> <nowiki><action idref="Ide.OPEN_CMD_ID"></nowiki> <nowiki><hidden>true</hidden></nowiki> <nowiki><action></nowiki> <nowiki></menu-customizations></nowiki> <nowiki></hooks></nowiki> '''Availablilty:''' Available '''XSD:''' menu-customizations-hook.xsd '''Note:''' that if the action's hidden element is true, it will not show up in the menubar at all. Actions marked as unavailable are disabled and none of the controllers attached to the action are called from update() or handleEvent() methods. The menucustomizations-hook must NOT be used in a conditional section of the triggers-hook == Bridge Extensions == A "bridge" extension connects two related technologies. For example, the ADF View Databinding extension connects ADF View and ADF Model. A bridge extension needs to be loaded whenever the core extensions of both related technologies are loaded. In some cases, the bridge extensions don't have natural triggers. We've added support in the IDE framework for declaring an extension to be a bridge extension in extension.xml, and the ExtensionRegistry uses that information to automatically load the bridge extension at the appropriate time. Say you've got extensions A and B that represent two related technologies, and you've got extension C that is the bridge between those technologies. Extension C depends on both A and B. If (and only if!) there was no natural trigger for extension C, then you'd put this in the triggers section of C's extension.xml: <nowiki><bridge-extension-hook bridge-id="C-bridge"</nowiki> from-extension="A" to-extension="B" /> Both A and B have to agree to this relationship, so in both A and B's extension.xml you'd have to put this in the trigger section: <nowiki><bridge-endpoint-hook bridge-id="C-bridge" /></nowiki> Whenever A and B are both fully loaded, the ExtensionRegistry will automatically fully load C. '''Availablilty:''' Available '''XSDs:''' bridge-extension-hook.xsd, bridge-endpoint-hook.xsd == On Project Open hook == '''Name:''' on-project-open-hook '''Description:''' Allows an extension to inspect project data to determine what extensions need to be initialized when a project is opened. '''Usage Example:''' <nowiki><on-project-open-hook></nowiki> <nowiki><data-handler class="client.package.ClientDataHandler"/></nowiki> <nowiki><hash-structure key="oracle.ide.model.TechnologyScopeConfiguration"/></nowiki> <nowiki></on-project-open-hook></nowiki> <nowiki><data-handler> identifies a ProjectDataHandler subclass to be called if a project with a matching hash-structure key is opened.</nowiki> <nowiki><hash-structure> provides the key of a HashStructure that may appear in a project.jpr file.</nowiki> '''Availablilty:''' Available '''XSD:''' on-project-open-hook.xsd == Help Callbacks Hook == '''Name:''' help-callbacks-hook '''Description:''' Registers classes necessary for help callbacks to work. Help callbacks are used in the help content to allow the help system to include links that invoke dialogs, wizards, or actions. In order for this to work the actual classes used need to be registered so that the help system has the necessary information to create instances of the objects and use them. '''Usage Example:''' <nowiki><trigger-hooks xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><triggers></nowiki> <nowiki><help-callbacks-hook></nowiki> <nowiki><callback id="oracle.jdevimpl.wizard.project.NewApplicationWizard"</nowiki> class="oracle.jdevimpl.wizard.project.NewApplicationWizard" /> <nowiki></help-callbacks-hook></nowiki> <nowiki></triggers</nowiki> <nowiki></trigger-hooks></nowiki> '''Availability:''' Available '''XSD: '''help-callbacks-hook.xsd == Help Hook == '''Name:''' help '''Description:''' Registers help content with the help system '''Usage Example:''' <nowiki><trigger-hooks xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><triggers></nowiki> <nowiki><help xmlns="http://xmlns.oracle.com/jdeveloper/1013/extension"></nowiki> <nowiki><item></nowiki> <nowiki><helpName>ejb</helpName></nowiki> <nowiki><helpURL>../doc/$edition/ohj/ejb.jar!/ejb.hs</helpURL></nowiki> <nowiki><relativeTo>developing_with_tiles</relativeTo></nowiki> <nowiki><relativePosition>after</relativePosition></nowiki> <nowiki></item></nowiki> <nowiki></help></nowiki> <nowiki></triggers></nowiki> <nowiki></trigger-hooks></nowiki> '''Availability:''' Available '''XSD: '''help.xsd == Dockable Hook == '''Name:''' dockable-factory-hook/dockable-hook '''Description:''' Registers a dockable factory with the IDE windowing system. '''Usage Example:''' ===== Standard Dockable Factory ===== <nowiki>The dockable factory is defined in the trigger-hooks 'dockable-factory-hook'. This will cause the dockable factory to be installed when one of its dockables is requested e.g.: via View-><Dockable></nowiki> A separate dockable-hook can also be supplied to run the dockable factory install when the extension defining the hook is loaded by something other than its trigger hook. This is useful, for example, extensions that want to display a window as soon as the extension is loaded. It is usual to provide both a dockable-factory-hook and a dockable-hook. <nowiki><trigger-hooks xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><triggers></nowiki> <nowiki><dockable-factory-hook xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><factory id="ToDoAddin" class="oracle.jdevimpl.todo.ToDoDockableFactory"/></nowiki> <nowiki></dockable-factory-hook></nowiki> <nowiki></triggers></nowiki> <nowiki></trigger-hooks></nowiki> <nowiki><hooks></nowiki> <nowiki><dockable-hook </nowiki> xmlns="http://xmlns.oracle.com/ide/extension"> <nowiki><dockable id="ToDoAddin"/></nowiki> <nowiki></dockable-hook></nowiki> <nowiki></hooks></nowiki> ===== Drawer Dockable ===== A drawer dockable is a dockable hosted inside another, such as the 'Recently Opened Files' drawer in the 'Application Navigator'. It needs an extra regular 'hosted-dockable-hook' hook describing the relationship between the hosted and host dockables. <nowiki><trigger-hooks xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><triggers></nowiki> <nowiki><factory id="Applicationoracle_ideimpl_editor_RecentFiles_VIEW_TYPE"</nowiki> class="oracle.ideimpl.editor.RecentFilesDockableFactory"/> <nowiki></triggers></nowiki> <nowiki></trigger-hooks></nowiki> <nowiki><hooks></nowiki> <nowiki><dockable-hook </nowiki> xmlns="http://xmlns.oracle.com/ide/extension"> <nowiki><dockable id="Applicationoracle_ideimpl_editor_RecentFiles_VIEW_TYPE"/></nowiki> <nowiki></dockable-hook></nowiki> <nowiki><hosted-dockable-hook xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><hosted-dockable view-id="Applicationoracle_ideimpl_editor_RecentFiles_VIEW_TYPE.Applicationoracle_ideimpl_editor_RecentFiles_VIEW_NAME"</nowiki> host-id="ApplicationNavigatorWindow.ApplicationNavigatorName" weight="10"/> <nowiki></hosted-dockable-hook></nowiki> <nowiki><hooks></nowiki> '''Availability:''' Available '''XSD:''' dockable-hook.xsd '''&nbsp;Note:''' For the hosted element, the view ids of the dockables, rather than the id of dockable factories, are used. This is because a dockable factory can create many dockables. == Historian Hook == '''Name:''' historian-hook '''Description:''' Allows a Historian to be registered for local history. '''Usage Example:''' <nowiki><trigger-hooks xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><triggers></nowiki> <nowiki><historian-hook xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><historian-class>oracle.ide.model.TextNodeHistorian</historian-class></nowiki> <nowiki><node-class>oracle.ide.model.TextNode</node-class></nowiki> <nowiki></historian-hook></nowiki> <nowiki></triggers></nowiki> <nowiki></trigger-hooks></nowiki> This hook is equivalent to the HistoryManager.registerHistorian() API. This means that only the given node class will be associated with the Historian, and derivatives of the node class must be individually registered. Note that TextNodeHistorian registrations are implicit for registered TextNode types associated with file extensions through the Recognizer API. '''Availability:''' Available '''XSD:''' historian-hook.xsd == External Tools Hook == '''Name:''' externaltools '''Description:''' Allows External Tool scanner, external tool type, and external tool macros to be registered. '''Usage Example:''' <nowiki><trigger-hooks xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><triggers></nowiki> <nowiki><externaltools xmlns="http://xmlns.oracle.com/ide/extension"></nowiki> <nowiki><macro macro="env" name="${ENVIRONMENT_NAME}"</nowiki> description="${ENVIRONMENT_DESCRIPTION}" <nowiki>isDirectoryMacro="true">oracle.ideimpl.externaltools.macro.EnvironmentVariable</macro></nowiki> <nowiki><scanner id="windowsimpl" name="${WINDOWS_SCANNER_NAME}"</nowiki> <nowiki>rule="os-is-windows"> oracle.ideimpl.externaltools.WindowsToolScanner</scanner></nowiki> <nowiki><externalToolType id="oracle.ideimpl.externaltools.program.ExternalProgramType" name="${PROGRAM_TYPE}"</nowiki> description="${PROGRAM_TYPE_HINT}" externalToolClass="oracle.ideimpl.externaltools.program.ExternalProgramTool" <nowiki>>oracle.ideimpl.externaltools.program.ExternalProgramType</externalToolType></nowiki> <nowiki></externaltools></nowiki> <nowiki></triggers></nowiki> <nowiki></trigger-hooks</nowiki> '''Availability:''' Available '''XSD:''' externaltools-hook.xsd
 
 
Close
loading
Please Confirm
Close