@Override
protected SpeechProcessor getMenuEventProcessor() {
if (menuItem == null)
return new NullProcessor();
MenuItemProcessor proc = new MenuItemProcessor();
proc.setText(menuItem.getText());
proc.setEnabled(menuItem.isEnabled());
proc.setAccelerator(menuItem.getAccelerator());
proc.setMenu(menuItem.getParent() instanceof MenuBar); // is it a menu or a menu item?
proc.setMnemonic(menuItem.getMnemonic());
proc.setHasSubmenu(menuItem.getSubElements().length > 0);
// Is this item checked?
if (menuItem instanceof JCheckBoxMenuItem) {
JCheckBoxMenuItem jc = (JCheckBoxMenuItem)menuItem;
proc.setCheckable(true);
proc.setChecked(jc.isSelected());
}
return proc;
}