User Tools

Site Tools


faq:technical:how_to_find_the_code_behind_a_given_menu_command

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

faq:technical:how_to_find_the_code_behind_a_given_menu_command [2019/04/12 13:13] (current)
Line 1: Line 1:
 +====== FAQ: How to find the code behind a given menu command? ======
 +
 +You can look in the IJ_Props.txt file the exact plugin called by a given menu command.
 +
 +For example for the 'Make Binary'​ menu entry, the IJ_Props.txt file reads
 +
 +  binary01="​Make Binary",​ij.plugin.Thresholder
 +
 +You'll find a copy of the IJ_Props.txt file in your ''​ij.jar''​ file or at http://​rsb.info.nih.gov/​ij/​download/​IJ_Props.txt
 +
 +Then visit the source code page at http://​rsb.info.nih.gov/​ij/​developer/​source/​index.html
 +
 +and go to the correct class, in our example the ''​ij.plugin.Thresholder''​ class.
 +
 +Another option to discover which class is called by a given menu item, is to enable the debug mode by checking the 'debug mode' checkbox under ''​Edit/​Options/​Misc...''​ dialog, run the investigated function from the menus and read the log output.
 +
 +For our example, the debug log reads :
 +
 +  actionPerformed:​ time=1228576256194,​ java.awt.event.ActionEvent[ACTION_PERFORMED,​
 +  cmd=Make Binary,​when=1228576256194,​modifiers=] on menuitem1
 +  runPlugin: ij.plugin.Thresholder ​
 +
 +===== "​Fiji"​ case =====
 +
 +With "​Fiji"​ ImageJ version, the IJ_Props.txt file don't contain all menu descriptions.
 +
 +For example, the menu "​Analyze / Directionality"​ isn't in "​IJ_Props.txt"​ file and the "Debug mode" solution log :
 +
 +  actionPerformed:​ time=12512156,​ java.awt.event.ActionEvent[ACTION_PERFORMED,​
 +  cmd=Directionality,​when=1339586662984,​modifiers=] on menuitem0
 +  runPlugin: fiji.analyze.directionality.Directionality_  ​
 +  ​
 +This plugin is stored in the following file : "​Fiji.app\plugins\Directionality_.jar"​
 +
 +You can see the link between the plugin and the menu in the text file "​Fiji.app\plugins\Directionality_.jar\plugins.config"​ :
 +
 +  # Directionality,​ builder Jean-Yves Tinevez ​  
 +  Analyze, "​Directionality",​ fiji.analyze.directionality.Directionality_
  
faq/technical/how_to_find_the_code_behind_a_given_menu_command.txt ยท Last modified: 2019/04/12 13:13 (external edit)