当前位置: 首页>>代码示例>>Java>>正文


Java SystemInfo.isMacSystemMenu方法代码示例

本文整理汇总了Java中com.intellij.openapi.util.SystemInfo.isMacSystemMenu方法的典型用法代码示例。如果您正苦于以下问题:Java SystemInfo.isMacSystemMenu方法的具体用法?Java SystemInfo.isMacSystemMenu怎么用?Java SystemInfo.isMacSystemMenu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.util.SystemInfo的用法示例。


在下文中一共展示了SystemInfo.isMacSystemMenu方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: clearItems

import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
private void clearItems() {
  if (SystemInfo.isMacSystemMenu && myPlace == ActionPlaces.MAIN_MENU) {
    for (Component menuComponent : getMenuComponents()) {
      if (menuComponent instanceof ActionMenu) {
        ((ActionMenu)menuComponent).clearItems();
        if (SystemInfo.isMacSystemMenu) {
          // hideNotify is not called on Macs
          ((ActionMenu)menuComponent).uninstallSynchronizer();
        }
      }
      else if (menuComponent instanceof ActionMenuItem) {
        // Looks like an old-fashioned ugly workaround
        // JDK 1.7 on Mac works wrong with such functional keys
        if (!(SystemInfo.isJavaVersionAtLeast("1.7") && SystemInfo.isMac)) {
          ((ActionMenuItem)menuComponent).setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F24, 0));
        }
      }
    }
  }

  removeAll();
  validate();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ActionMenu.java

示例2: propertyChange

import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
public void propertyChange(PropertyChangeEvent e) {
  String name = e.getPropertyName();
  if (Presentation.PROP_VISIBLE.equals(name)) {
    setVisible(myPresentation.isVisible());
    if (SystemInfo.isMacSystemMenu && myPlace.equals(ActionPlaces.MAIN_MENU)) {
      validateTree();
    }
  }
  else if (Presentation.PROP_ENABLED.equals(name)) {
    setEnabled(myPresentation.isEnabled());
  }
  else if (Presentation.PROP_MNEMONIC_KEY.equals(name)) {
    setMnemonic(myPresentation.getMnemonic());
  }
  else if (Presentation.PROP_MNEMONIC_INDEX.equals(name)) {
    setDisplayedMnemonicIndex(myPresentation.getDisplayedMnemonicIndex());
  }
  else if (Presentation.PROP_TEXT.equals(name)) {
    setText(myPresentation.getText());
  }
  else if (Presentation.PROP_ICON.equals(name) || Presentation.PROP_DISABLED_ICON.equals(name)) {
    updateIcon();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:ActionMenu.java

示例3: ActionMenu

import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
public ActionMenu(final DataContext context,
                  @NotNull final String place,
                  final ActionGroup group,
                  final PresentationFactory presentationFactory,
                  final boolean enableMnemonics,
                  final boolean topLevel) {
  myContext = context;
  myPlace = place;
  myGroup = ActionRef.fromAction(group);
  myPresentationFactory = presentationFactory;
  myPresentation = myPresentationFactory.getPresentation(group);
  myMnemonicEnabled = enableMnemonics;
  myTopLevel = topLevel;

  updateUI();

  init();

  // addNotify won't be called for menus in MacOS system menu
  if (SystemInfo.isMacSystemMenu) {
    installSynchronizer();
  }
  if (UIUtil.isUnderIntelliJLaF()) {
    setOpaque(true);
  }
  myDisposable = new Disposable() {
    @Override
    public void dispose() {
    }
  };

  // Triggering initialization of private field "popupMenu" from JMenu with our own JBPopupMenu
  getPopupMenu();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:ActionMenu.java

示例4: init

import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
private void init() {
  boolean macSystemMenu = SystemInfo.isMacSystemMenu && myPlace == ActionPlaces.MAIN_MENU;

  myStubItem = macSystemMenu ? null : new StubItem();
  addStubItem();
  addMenuListener(new MenuListenerImpl());
  setBorderPainted(false);

  setVisible(myPresentation.isVisible());
  setEnabled(myPresentation.isEnabled());
  setText(myPresentation.getText());
  updateIcon();

  setMnemonicEnabled(myMnemonicEnabled);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:ActionMenu.java


注:本文中的com.intellij.openapi.util.SystemInfo.isMacSystemMenu方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。