Have a look at the FeatureInstaller.addMainMenuItemWithJava14Fix method

featureInstaller.addMainMenuItemWithJava14Fix(plugin, new String[] {
      MenuNames.FILE
    }, name, false, icon, enableCheck);


Sunburned Surveyor wrote:
> I'm trying to figure out how to add a menu item for my Super Select
> tool via the configureMainMenuItem method of the ToolBoxPlugIn class.
> I keep getting a ShouldNeverReachHere exception from the
> abstractActionListener method of the FeatureInstaller class.
>
> I think my exception has to do with properly accessing the top-level
> menu using internationalization.
>
> I've read the section on the wiki about internationalizing plug-ins,
> read through messages on this mailing list, downloaded the sample
> internationalized plug-in, and looked at the javadoc comments in the
> I18N class in OpenJUMP. I'm still missing something.
>
> Here is the code in my extension that attempts to install the menu
> item. Maybe you guys can tell me what I am missing:
>
> /* Set up menu path. */
> String[] menuPath = new String[2];
> menuPath[0] = MenuNames.EDIT;
> menuPath[1] = "super_select";
>               
>               
> WorkbenchContext workbenchContext = argContext.getWorkbenchContext();
>               
> plugIn.createMainMenuItem(menuPath, null, workbenchContext);
>
> I also tried replacing the line "menuPath[0] = MenuNames.EDIT;" with
> the line "I18N.getString("MenuNames.EDIT");". I still got the same
> error message.
>
> Can you see what I am doing wrong? (I18N is not at all a strong point of 
> mine.)
>
> Thanks for any help or suggestions.
>
> The Sunburned Surveyor (A.K.A. - The Monolingual Programmer)
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to