I agree with Larry. See if you can split your code into two plug-ins. Your plug-ins can share the common classes they need in your library JAR.
The Sunburned Surveyor On Tue, Jun 1, 2010 at 8:36 AM, Larry Becker <becker.la...@gmail.com> wrote: > Hi, > > You might try to install an ActionListener for each menu item within your > initialize method that sets a class variable that remembers the menu item. > This is difficult. > > Usually though, it just best to have a class that does the work and two > plugins, each with their own menu item. > > regards, > Larry > > > > On Tue, Jun 1, 2010 at 9:51 AM, Hernan Arellano <her...@hotmail.com> wrote: >> >> Hi all! >> >> I got only one plugin with diferents menu items, each of them call a >> diferent method. Therefore inside the method execute(PlugInContext context) >> ¿how can i know which button is pressed? so i can call the correct method. >> >> ******** >> public void initialize(PlugInContext context) throws Exception { >> FeatureInstaller featureInstaller = new >> FeatureInstaller(context.getWorkbenchContext()); >> featureInstaller.addMainMenuItem( >> this, >> new String[] {"My Plugin"}, >> "nameFunction1", >> false, >> null, >> createEnableCheck(context.getWorkbenchContext())); >> featureInstaller.addMainMenuItem( >> this, >> new String[] {"My Plugin"}, >> "nameFunction2", >> false, >> null, >> createEnableCheck(context.getWorkbenchContext())); >> } >> >> public boolean execute(PlugInContext context) throws Exception { >> ¿which command has the user pressed? nameFunction1 or nameFunction2 >> ? >> } >> ******** >> >> Thanks! >> >> ________________________________ >> >> ------------------------------------------------------------------------------ >> >> >> _______________________________________________ >> Jump-pilot-devel mailing list >> Jump-pilot-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel >> > > > ------------------------------------------------------------------------------ > > > _______________________________________________ > Jump-pilot-devel mailing list > Jump-pilot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > > ------------------------------------------------------------------------------ _______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel