本文整理汇总了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();
}
示例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();
}
}
示例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();
}
示例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);
}