本文整理汇总了Java中com.intellij.ui.plaf.beg.IdeaMenuUI类的典型用法代码示例。如果您正苦于以下问题:Java IdeaMenuUI类的具体用法?Java IdeaMenuUI怎么用?Java IdeaMenuUI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IdeaMenuUI类属于com.intellij.ui.plaf.beg包,在下文中一共展示了IdeaMenuUI类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateUI
import com.intellij.ui.plaf.beg.IdeaMenuUI; //导入依赖的package包/类
@Override
public void updateUI() {
boolean isAmbiance = UIUtil.isUnderGTKLookAndFeel() && "Ambiance".equalsIgnoreCase(UIUtil.getGtkThemeName());
if (myTopLevel && !isAmbiance && UIUtil.GTK_AMBIANCE_TEXT_COLOR.equals(getForeground())) {
setForeground(null);
}
if (UIUtil.isStandardMenuLAF()) {
super.updateUI();
}
else {
setUI(IdeaMenuUI.createUI(this));
setFont(UIUtil.getMenuFont());
JPopupMenu popupMenu = getPopupMenu();
if (popupMenu != null) {
popupMenu.updateUI();
}
}
if (myTopLevel && isAmbiance) {
setForeground(UIUtil.GTK_AMBIANCE_TEXT_COLOR);
}
if (myTopLevel && UIUtil.isUnderGTKLookAndFeel()) {
Insets insets = getInsets();
Insets newInsets = new Insets(insets.top, insets.left, insets.bottom, insets.right);
if (insets.top + insets.bottom < 6) {
newInsets.top = newInsets.bottom = 3;
}
if (insets.left + insets.right < 12) {
newInsets.left = newInsets.right = 6;
}
if (!newInsets.equals(insets)) {
setBorder(BorderFactory.createEmptyBorder(newInsets.top, newInsets.left, newInsets.bottom, newInsets.right));
}
}
}