add missing nullability annotations

GitOrigin-RevId: bd77e275a3272f03b4a019fb49dcb7c7f1678035
This commit is contained in:
Gregory.Shrago
2024-05-14 03:33:32 +04:00
committed by intellij-monorepo-bot
parent d19a998d6e
commit 6d0013c231
6 changed files with 12 additions and 11 deletions

View File

@@ -285,7 +285,7 @@ public final class Presentation implements Cloneable {
fireObjectPropertyChange(PROP_DESCRIPTION, oldDescriptionSupplier.get(), description);
}
public Icon getIcon() {
public @Nullable Icon getIcon() {
Supplier<? extends Icon> icon = this.icon;
return icon == null ? null : icon.get();
}
@@ -331,7 +331,7 @@ public final class Presentation implements Cloneable {
fireObjectPropertyChange(PROP_ICON, oldIcon, newIcon);
}
public Icon getDisabledIcon() {
public @Nullable Icon getDisabledIcon() {
return disabledIcon;
}
@@ -341,7 +341,7 @@ public final class Presentation implements Cloneable {
fireObjectPropertyChange(PROP_DISABLED_ICON, oldDisabledIcon, disabledIcon);
}
public Icon getHoveredIcon() {
public @Nullable Icon getHoveredIcon() {
return hoveredIcon;
}
@@ -351,7 +351,7 @@ public final class Presentation implements Cloneable {
fireObjectPropertyChange(PROP_HOVERED_ICON, old, this.hoveredIcon);
}
public Icon getSelectedIcon() {
public @Nullable Icon getSelectedIcon() {
return selectedIcon;
}

View File

@@ -54,7 +54,8 @@ abstract class LanguageServiceWidgetItem {
fun createWidgetAction(): AnAction {
val mainAction = createWidgetMainAction()
if (isError) {
mainAction.templatePresentation.icon = layeredIcon(arrayOf(mainAction.templatePresentation.icon, AllIcons.Nodes.ErrorMark))
mainAction.templatePresentation.icon = mainAction.templatePresentation.icon?.let {
layeredIcon(arrayOf(it, AllIcons.Nodes.ErrorMark)) }
}
if (ExperimentalUI.isNewUI()) {

View File

@@ -207,7 +207,7 @@ class ActionMenuItem internal constructor(action: AnAction,
}
else if (UISettings.getInstance().showIconsInMenus) {
var icon = presentation.icon
if (isToggleable && isToggled) {
if (isToggleable && isToggled && icon != null) {
icon = PoppedIcon(icon, 16, 16)
}
var disabled = presentation.disabledIcon

View File

@@ -55,8 +55,8 @@ abstract class ExpandableComboAction : AnAction(), CustomComponentAction {
val pRightIcons = presentation.getClientProperty(RIGHT_ICONS_KEY)
it.leftIcons = when {
pLeftIcons != null -> pLeftIcons
!presentation.isEnabled && presentation.disabledIcon != null -> listOf(presentation.disabledIcon)
presentation.icon != null -> listOf(presentation.icon)
!presentation.isEnabled && presentation.disabledIcon != null -> listOf(presentation.disabledIcon!!)
presentation.icon != null -> listOf(presentation.icon!!)
else -> emptyList()
}
if (pRightIcons != null) it.rightIcons = pRightIcons

View File

@@ -46,8 +46,8 @@ abstract class SplitButtonAction : AnAction(), CustomComponentAction {
val pRightIcons = presentation.getClientProperty(ExpandableComboAction.RIGHT_ICONS_KEY)
it.leftIcons = when {
pLeftIcons != null -> pLeftIcons
!presentation.isEnabled && presentation.disabledIcon != null -> listOf(presentation.disabledIcon)
presentation.icon != null -> listOf(presentation.icon)
!presentation.isEnabled && presentation.disabledIcon != null -> listOf(presentation.disabledIcon!!)
presentation.icon != null -> listOf(presentation.icon!!)
else -> emptyList()
}
if (pRightIcons != null) it.rightIcons = pRightIcons

View File

@@ -127,7 +127,7 @@ class FilenameToolbarWidgetAction : ExpandableComboAction(), DumbAware, ActionRe
fun update(presentation: Presentation) {
val path = presentation.getClientProperty(FILE_FULL_PATH)
isOpaque = false
leftIcons = listOf(presentation.icon)
leftIcons = listOf(presentation.icon!!)
foreground = presentation.getClientProperty(FILE_COLOR)
text = presentation.textWithMnemonic
toolTipText = presentation.description