title: custom submenu won't react on click
body: <p>I am trying to implement an extension in JDeveloper. It creats a submenu when you click on a DB package.
  THe issue comes when I click on an element of my custom submenu, it returns a null pointer Exception.
  I can't figure out where I did wrong.</p>
  
  <p>Would you please help me?</p>
  
  <p>Here is how a I created the submenu:</p>
  
  <p>submenu.xml File:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="windows-1252" ?&gt;
  &lt;!-- usage of a name space?--&gt;
  &lt;items id="my.contextMenu"&gt;
  
   &lt;folder type="PACKAGE"&gt;
    &lt;name&gt;User Defined Context Menu&lt;/name&gt;
    &lt;item reloadparent="true"
          action-ref="utilitytools.customSave"&gt;
     &lt;title&gt;saveThisPackage&lt;/title&gt;
   &lt;/folder&gt;
  &lt;/items&gt;
  </code></pre>
  
  <p>extension.xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;extension id="utilitytools" version="1.0" esdk-version="1.0"
             rsbundle-class="utilitytools.Res"
             xmlns="http://jcp.org/jsr/198/extension-manifest"&gt;
    &lt;name&gt;Utility Tools&lt;/name&gt;
    &lt;owner&gt;A name&lt;/owner&gt;
    &lt;dependencies&gt;
      &lt;import&gt;oracle.sqldeveloper&lt;/import&gt;
      &lt;import&gt;oracle.ide&lt;/import&gt;
    &lt;/dependencies&gt;
    &lt;hooks&gt;
      &lt;jdeveloper-hook xmlns="http://xmlns.oracle.com/jdeveloper/1013/extension"&gt;
        &lt;addins&gt;
          &lt;addin&gt;utilitytools.UtilityToolsAddin&lt;/addin&gt;
        &lt;/addins&gt;
        &lt;actions xmlns="http://xmlns.oracle.com/jdeveloper/1013/extension"&gt;
          &lt;action id="utilitytools.customSave"&gt;
            &lt;properties&gt;
              &lt;property name="Name"&gt;saveThisPackage&lt;/property&gt;
              &lt;property name="SmallIcon"&gt;&lt;/property&gt;
              &lt;property name="LongDescription"&gt;&lt;/property&gt;
            &lt;/properties&gt;
            &lt;controller-class&gt;utilitytools.savePackageController&lt;/controller-class&gt;
            &lt;command-class&gt;utilitytools.savePackageCommand&lt;/command-class&gt;
          &lt;/action&gt;
        &lt;/actions&gt;
      &lt;/jdeveloper-hook&gt;
      &lt;sqldev-navigator-hook xmlns="http://xmlns.oracle.com/sqldeveloper/sqldev-navigator"&gt;
          &lt;descriptor&gt;submenu.xml&lt;/descriptor&gt;
      &lt;/sqldev-navigator-hook&gt;
    &lt;/hooks&gt;
  &lt;/extension&gt;
  </code></pre>
  
  <p>SubmenuListener file:</p>
  
  <pre><code>public final class SubMenuListener implements ContextMenuListener {
      public SubMenuListener() {
          super();
      }
  
      public void menuWillShow(ContextMenu contextMenu) {
          contextMenu.add( contextMenu.createMenuItem( 
              IdeAction.find( savePackageCommand.actionId() )
          ));
      }
  
      public void menuWillHide(ContextMenu contextMenu) {
          //Nothing
      }
  
      public boolean handleDefaultAction(Context context) {
          return false;
      }
  }
  </code></pre>
  
  <p>And the command file:</p>
  
  <pre><code>/**
   * Command handler for utilitytools.customSave.
   */
  @RegisteredByExtension("utilitytools")
  public final class sauvegardePackageCommand extends Command {
      public savePackageCommand() {
          super(actionId());
      }
  
      public int doit() {
  
          SwingUtilities.invokeLater(new Runnable(){
              public void run(){
                  showSaveWindow();
              }
          });
          return OK;
      }
  
      /**
       * Returns the id of the action this command is associated with.
       *
       * @return the id of the action this command is associated with.
       * @throws IllegalStateException if the action this command is associated
       *    with is not registered.
       */
      public static int actionId() {
          final Integer cmdId = Ide.findCmdID(".utilitytools.customSave");
          if (cmdId == null)
              throw new IllegalStateException("Action esdksample.showElementClass not found.");
          return cmdId;
      }
      private static void showSaveWindow(){
          JFrame frame = new JFrame("SAVE");
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
          frame.add(new JPanelSavePackage());//Or any window you want to popup
  
  
          frame.pack();
          frame.setVisible(true);
      }
  }
  </code></pre>