0 Replies Latest reply: May 28, 2014 7:59 PM by rp0428 RSS

    Sql Developer extension - how to link an XML context menu to the action class code

    rp0428

      How do you link the XML context menu items to the Java action class? I have created a sample XML-based context menu extension based on what Kris Rice posted in this recent thread: https://community.oracle.com/thread/3562912 (the below code is public domain so can be used by anyone for any purpose)

       

      Using the process described in that thread I can add the XML file as an extension using 'Tools => Preferences => Database => User Defined Extension

       

      After relaunching Sql Developer the new context menu items show up in the proper place - on the context menu for any table in the connection tree.

       

      The sql dev log pane shows that it can't find a controller. This is the XML file:

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

      <items xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

      xsi:noNamespaceSchemaLocation="dialogs.xsd">

      <folder type="TABLE">

         <name>Custom Menu</name>

         <item type="TABLE" className="menuaction.TestMenuAction"

                            controllerClassName="menuaction.TestMenuController">

           <title>Submenu Choice1</title>

         </item>

         <item type="TABLE" className="menuaction.TestMenuAction"

                            controllerClassName="menuaction.TestMenuController">

           <title>Submenu Choice2</title>

         </item>

      </folder>

         <item type="TABLE" className="menuaction.TestMenuAction"

                            controllerClassName="menuaction.TestMenuController">

         <title>Custom Choice1</title>

      </item>

         <item type="TABLE" className="menuaction.TestMenuAction"

                            controllerClassName="menuaction.TestMenuController">

         <title>Custom Choice2</title>

      </item>

      </item

      Both 'className' for the action and 'controllerClassName' for the controller are specified. The classes are in an extension built and deployed as a jar file using JDeveloper 12.1.2 and then I drop the jar in the sqldeveloper\dropins folder.

       

      The menu items display properly but the code/classes are not found.

       

      ----------------------------

      Updated 5;59pm to add cross-link to JDeveloper forum post

      https://community.oracle.com/thread/3565768