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