Package com.intellij.util.ui
Class MenuItemLayoutHelper
java.lang.Object
com.intellij.util.ui.MenuItemLayoutHelper
- All Implemented Interfaces:
MenuItemLayoutHelper
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classNested classes/interfaces inherited from interface com.github.weisj.darklaf.compatibility.MenuItemLayoutHelper
MenuItemLayoutHelper.MILayoutResult, MenuItemLayoutHelper.MIRectSize -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringUIClientPropertyKeystatic final StringUIClientPropertyKeystatic final StringUIClientPropertyKeystatic final StringUIClientPropertyKeystatic final StringUIClientPropertyKeystatic final StringUIClientPropertyKey -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intcalcMaxValue(Object propertyName, int value) protected voidprotected voidprotected voidstatic voidstatic voidclearUsedParentClientProperties(JMenuItem menuItem) intgetFont()intgetGap()intintgetIcon()intintstatic JComponentgetMenuItemParent(JMenuItem menuItem) intprotected intgetParentIntProperty(Object propertyName) getText()intintbooleanstatic booleanisColumnLayout(boolean isLeftToRight, int horizontalAlignment, int horizontalTextPosition, int verticalTextPosition) booleanbooleanprotected voidstatic intmax(int... values) protected voidprotected voidreset(JMenuItem mi, Icon checkIcon, Icon arrowIcon, Rectangle viewRect, int gap, String accDelimiter, boolean isLeftToRight, Font font, Font accFont, boolean useCheckAndArrow, String propertyPrefix) protected voidsetAccFont(Font accFont) protected voidsetAccFontMetrics(FontMetrics accFm) protected voidsetAccSize(MenuItemLayoutHelper.RectSize accSize) protected voidsetAccText(String accText) protected voidsetAfterCheckIconGap(int afterCheckIconGap) protected voidsetArrowIcon(Icon arrowIcon) protected voidsetArrowSize(MenuItemLayoutHelper.RectSize arrowSize) protected voidsetCheckIcon(Icon checkIcon) protected voidsetCheckSize(MenuItemLayoutHelper.RectSize checkSize) protected voidsetColumnLayout(boolean columnLayout) protected voidprotected voidprotected voidsetGap(int gap) protected voidsetHorizontalAlignment(int horizontalAlignment) protected voidsetHorizontalTextPosition(int horizontalTextPosition) protected voidsetHtmlView(View htmlView) protected voidprotected voidsetIconSize(MenuItemLayoutHelper.RectSize iconSize) protected voidsetLabelSize(MenuItemLayoutHelper.RectSize labelSize) protected voidsetLeadingGap(int leadingGap) protected voidsetLeftToRight(boolean leftToRight) protected voidsetMenuItem(JMenuItem mi) protected voidsetMenuItemParent(JComponent miParent) protected voidsetMinTextOffset(int minTextOffset) protected voidprotected voidsetTextSize(MenuItemLayoutHelper.RectSize textSize) protected voidsetTopLevelMenu(boolean topLevelMenu) protected voidsetUseCheckAndArrow(boolean useCheckAndArrow) protected voidsetVerticalAlignment(int verticalAlignment) protected voidsetVerticalTextPosition(int verticalTextPosition) protected voidsetViewRect(Rectangle viewRect) booleanstatic booleanuseCheckAndArrow(JMenuItem menuItem)
-
Field Details
-
MAX_ARROW_WIDTH
-
MAX_CHECK_WIDTH
-
MAX_ICON_WIDTH
-
MAX_TEXT_WIDTH
-
MAX_ACC_WIDTH
-
MAX_LABEL_WIDTH
-
-
Constructor Details
-
MenuItemLayoutHelper
protected MenuItemLayoutHelper() -
MenuItemLayoutHelper
-
-
Method Details
-
reset
-
calcWidthsAndHeights
protected void calcWidthsAndHeights() -
calcMaxWidths
protected void calcMaxWidths() -
calcMaxWidth
-
calcMaxValue
-
getParentIntProperty
-
isColumnLayout
public static boolean isColumnLayout(boolean isLeftToRight, int horizontalAlignment, int horizontalTextPosition, int verticalTextPosition) -
layoutMenuItem
- Specified by:
layoutMenuItemin interfaceMenuItemLayoutHelper
-
getLTRColumnAlignment
-
getRTLColumnAlignment
-
prepareForLayout
-
layoutIconAndTextInLabelRect
-
getMenuItemParent
-
clearUsedParentClientProperties
-
clearUsedClientProperties
-
max
public static int max(int... values) -
getMenuItem
- Specified by:
getMenuItemin interfaceMenuItemLayoutHelper
-
getMenuItemParent
-
getFont
-
getAccFont
-
getFontMetrics
- Specified by:
getFontMetricsin interfaceMenuItemLayoutHelper
-
getAccFontMetrics
- Specified by:
getAccFontMetricsin interfaceMenuItemLayoutHelper
-
getIcon
- Specified by:
getIconin interfaceMenuItemLayoutHelper
-
getCheckIcon
- Specified by:
getCheckIconin interfaceMenuItemLayoutHelper
-
getArrowIcon
- Specified by:
getArrowIconin interfaceMenuItemLayoutHelper
-
getText
- Specified by:
getTextin interfaceMenuItemLayoutHelper
-
getAccText
- Specified by:
getAccTextin interfaceMenuItemLayoutHelper
-
isColumnLayout
public boolean isColumnLayout() -
useCheckAndArrow
public boolean useCheckAndArrow()- Specified by:
useCheckAndArrowin interfaceMenuItemLayoutHelper
-
isLeftToRight
public boolean isLeftToRight() -
isTopLevelMenu
public boolean isTopLevelMenu()- Specified by:
isTopLevelMenuin interfaceMenuItemLayoutHelper
-
getHtmlView
- Specified by:
getHtmlViewin interfaceMenuItemLayoutHelper
-
getVerticalAlignment
public int getVerticalAlignment() -
getHorizontalAlignment
public int getHorizontalAlignment() -
getVerticalTextPosition
public int getVerticalTextPosition() -
getHorizontalTextPosition
public int getHorizontalTextPosition() -
getGap
public int getGap()- Specified by:
getGapin interfaceMenuItemLayoutHelper
-
getLeadingGap
public int getLeadingGap()- Specified by:
getLeadingGapin interfaceMenuItemLayoutHelper
-
getAfterCheckIconGap
public int getAfterCheckIconGap()- Specified by:
getAfterCheckIconGapin interfaceMenuItemLayoutHelper
-
getMinTextOffset
public int getMinTextOffset()- Specified by:
getMinTextOffsetin interfaceMenuItemLayoutHelper
-
getViewRect
- Specified by:
getViewRectin interfaceMenuItemLayoutHelper
-
getIconSize
- Specified by:
getIconSizein interfaceMenuItemLayoutHelper
-
getTextSize
- Specified by:
getTextSizein interfaceMenuItemLayoutHelper
-
getAccSize
- Specified by:
getAccSizein interfaceMenuItemLayoutHelper
-
getCheckSize
- Specified by:
getCheckSizein interfaceMenuItemLayoutHelper
-
getArrowSize
- Specified by:
getArrowSizein interfaceMenuItemLayoutHelper
-
getLabelSize
- Specified by:
getLabelSizein interfaceMenuItemLayoutHelper
-
setMenuItem
-
setMenuItemParent
-
setFont
-
setAccFont
-
setFontMetrics
-
setAccFontMetrics
-
setIcon
-
setCheckIcon
-
setArrowIcon
-
setText
-
setAccText
-
setColumnLayout
protected void setColumnLayout(boolean columnLayout) -
setUseCheckAndArrow
protected void setUseCheckAndArrow(boolean useCheckAndArrow) -
setLeftToRight
protected void setLeftToRight(boolean leftToRight) -
setTopLevelMenu
protected void setTopLevelMenu(boolean topLevelMenu) -
setHtmlView
-
setVerticalAlignment
protected void setVerticalAlignment(int verticalAlignment) -
setHorizontalAlignment
protected void setHorizontalAlignment(int horizontalAlignment) -
setVerticalTextPosition
protected void setVerticalTextPosition(int verticalTextPosition) -
setHorizontalTextPosition
protected void setHorizontalTextPosition(int horizontalTextPosition) -
setGap
protected void setGap(int gap) -
setLeadingGap
protected void setLeadingGap(int leadingGap) -
setAfterCheckIconGap
protected void setAfterCheckIconGap(int afterCheckIconGap) -
setMinTextOffset
protected void setMinTextOffset(int minTextOffset) -
setViewRect
-
setIconSize
-
setTextSize
-
setAccSize
-
setCheckSize
-
setArrowSize
-
setLabelSize
-
getLeftTextExtraWidth
public int getLeftTextExtraWidth() -
useCheckAndArrow
-