jTracer  1.03
Stack trace visualization tool
JMenuItem org.libcsdbg.jtracer.MenuBar.createToggle ( String  text,
int  index,
int  mnemonic 
)
private

Create a toggle menu item.

Parameters
[in]textthe item caption
[in]indexthe item corresponding index in this.toggleStates
[in]mnemonicthe item shortcut key
Returns
the created item

Definition at line 271 of file MenuBar.java.

References org.libcsdbg.jtracer.Registry.get(), org.libcsdbg.jtracer.MenuBar.handler, and org.libcsdbg.jtracer.MenuBar.toggleStates.

272  {
273  JMenuItem retval = new JMenuItem(text);
274  retval.setMnemonic(mnemonic);
275 
276  Registry conf = Registry.getCurrent();
277  retval.setFont((Font) conf.get("component", "font"));
278  retval.setForeground((Color) conf.get("component", "fgcolor"));
279 
280  Integer delay = (Integer) conf.get("component", "click-delay");
281  if (delay != null)
282  retval.setMultiClickThreshhold(delay);
283 
284  retval.setActionCommand(text);
285  retval.addActionListener(handler);
286  retval.addActionListener(this);
287 
288  String nm = ((toggleStates[index]) ? "on" : "off") + "16.png";
289  retval.setIcon(conf.loadIcon(nm));
290  return retval;
291  }
boolean toggleStates[]
State of the toggle menu items.
Definition: MenuBar.java:43
ActionListener handler
Event handler.
Definition: MenuBar.java:46

+ Here is the call graph for this function: