Java 类com.intellij.ui.components.JBOptionButton 实例源码

项目:intellij-ce-playground    文件:IdeKeyEventDispatcher.java   
private static boolean hasMnemonic(final Container container, final int keyCode) {
  if (container == null) return false;

  final Component[] components = container.getComponents();
  for (Component component : components) {
    if (component instanceof AbstractButton) {
      final AbstractButton button = (AbstractButton)component;
      if (button instanceof JBOptionButton) {
        if (((JBOptionButton)button).isOkToProcessDefaultMnemonics()) return true;
      } else {
        if (button.getMnemonic() == keyCode) return true;
      }
    }
    if (component instanceof JLabel) {
      final JLabel label = (JLabel)component;
      if (label.getDisplayedMnemonic() == keyCode) return true;
    }
    if (component instanceof Container) {
      if (hasMnemonic((Container)component, keyCode)) return true;
    }
  }
  return false;
}
项目:tools-idea    文件:IdeKeyEventDispatcher.java   
private static boolean hasMnemonic(final Container container, final int keyCode) {
  if (container == null) return false;

  final Component[] components = container.getComponents();
  for (Component component : components) {
    if (component instanceof AbstractButton) {
      final AbstractButton button = (AbstractButton)component;
      if (button instanceof JBOptionButton) {
        if (((JBOptionButton)button).isOkToProcessDefaultMnemonics()) return true;
      } else {
        if (button.getMnemonic() == keyCode) return true;
      }
    }
    if (component instanceof JLabel) {
      final JLabel label = (JLabel)component;
      if (label.getDisplayedMnemonic() == keyCode) return true;
    }
    if (component instanceof Container) {
      if (hasMnemonic((Container)component, keyCode)) return true;
    }
  }
  return false;
}
项目:consulo    文件:IdeKeyEventDispatcher.java   
private static boolean hasMnemonic(final Container container, final int keyCode) {
  if (container == null) return false;

  final Component[] components = container.getComponents();
  for (Component component : components) {
    if (component instanceof AbstractButton) {
      final AbstractButton button = (AbstractButton)component;
      if (button instanceof JBOptionButton) {
        if (((JBOptionButton)button).isOkToProcessDefaultMnemonics()) return true;
      }
      else {
        if (button.getMnemonic() == keyCode) return true;
      }
    }
    if (component instanceof JLabel) {
      final JLabel label = (JLabel)component;
      if (label.getDisplayedMnemonic() == keyCode) return true;
    }
    if (component instanceof Container) {
      if (hasMnemonic((Container)component, keyCode)) return true;
    }
  }
  return false;
}