in src/main/java/com/intellij/util/ui/MenuItemLayoutHelper.java [111:155]
protected void reset(JMenuItem mi, Icon checkIcon, Icon arrowIcon,
Rectangle viewRect, int gap, String accDelimiter,
boolean isLeftToRight, Font font, Font accFont,
boolean useCheckAndArrow, String propertyPrefix) {
this.mi = mi;
this.miParent = getMenuItemParent(mi);
this.accText = getAccText(accDelimiter);
this.verticalAlignment = mi.getVerticalAlignment();
this.horizontalAlignment = mi.getHorizontalAlignment();
this.verticalTextPosition = mi.getVerticalTextPosition();
this.horizontalTextPosition = mi.getHorizontalTextPosition();
this.useCheckAndArrow = useCheckAndArrow;
this.font = font;
this.accFont = accFont;
this.fm = mi.getFontMetrics(font);
this.accFm = mi.getFontMetrics(accFont);
this.isLeftToRight = isLeftToRight;
this.isColumnLayout = isColumnLayout(isLeftToRight,
horizontalAlignment, horizontalTextPosition,
verticalTextPosition);
this.isTopLevelMenu = (this.miParent == null) ? true : false;
this.checkIcon = checkIcon;
this.icon = getIcon(propertyPrefix);
this.arrowIcon = arrowIcon;
this.text = mi.getText();
this.gap = gap;
this.afterCheckIconGap = getAfterCheckIconGap(propertyPrefix);
this.minTextOffset = getMinTextOffset(propertyPrefix);
this.htmlView = (View) mi.getClientProperty(BasicHTML.propertyKey);
this.viewRect = viewRect;
this.iconSize = new RectSize();
this.textSize = new RectSize();
this.accSize = new RectSize();
this.checkSize = new RectSize();
this.arrowSize = new RectSize();
this.labelSize = new RectSize();
calcExtraWidths();
calcWidthsAndHeights();
setOriginalWidths();
calcMaxWidths();
this.leadingGap = getLeadingGap(propertyPrefix);
calcMaxTextOffset(viewRect);
}