I want to to get the Mpart from which the handle tool item belongs when user clicks on handled toolitem of the toolbar (Here the command which will be executed on clicking is common across these toolitems).I tried using activepart but it seems if any other part is active in other partstack this will return wrong value .Any pointer on this will be helpful.Thanks in advance.
Use @Named(IServiceConstants.ACTIVE_PART)
to get the correct active part in your handler @Execute
or @CanExecute
methods:
@Execute
public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart)