I have added an option in ProjectPopUp menu , say SamplePopUp with popup =
true property set..
This pop-up menu has sub pop-up menus . I have added their entries in
I have a class SamplePopUpClass that extends the DefaultActionGroup and
overrides the update method.
When I right click on a file in project view, this update method gets called
three times, twice on right of the file and once when I go to the
SamplePopUp menu option.
I am doing the processing of enabling and disabling the sub-menu options of
SamplePopUp in the update method of SamplePopUpClass. Since this update is
getting called three times for every right click the overhead while
processing is more.
Our processing logic needs to create a file for the selected resource in the
project view. This file is referred by every sub-menu option in SamplePopUp.
Since update gets called three time, three files are getting created for
every right click.
I want to get rid of the first two duplicated files getting created when I
do right click. For this I need to hook when the third update gets called or
when the mouse/keyboard selection is on SamplePopUp option. I have tried all
the api's in Presentation, AnActionEvent, ActionManager but couldn't get an
handle to it.
There is an api getInputEvent in Presentation class, but this returns null.
Is there way to hook on the selection user makes on the right click menu?
Are there any listeners that I can implement to do this?
Any help in this regard would be really great.