From d854be65a18b908a0581feb83c8e74896dbe8375 Mon Sep 17 00:00:00 2001 From: "Gregory.Shrago" Date: Mon, 20 Dec 2021 11:52:37 +0300 Subject: [PATCH] restore enabled/visible prop events in copy Fixes IDEA-285264 GitOrigin-RevId: 5d27f10529e18fa3048270e59a0890947cf1cb54 --- .../com/intellij/openapi/actionSystem/Presentation.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/Presentation.java b/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/Presentation.java index 14820d686a62..6c00fb1470d2 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/Presentation.java +++ b/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/Presentation.java @@ -383,9 +383,9 @@ public final class Presentation implements Cloneable { */ public void setEnabled(boolean enabled) { assertNotTemplatePresentation(); - boolean oldVisible = BitUtil.isSet(myFlags, IS_ENABLED); + boolean oldEnabled = BitUtil.isSet(myFlags, IS_ENABLED); myFlags = BitUtil.set(myFlags, IS_ENABLED, enabled); - fireBooleanPropertyChange(PROP_ENABLED, oldVisible, enabled); + fireBooleanPropertyChange(PROP_ENABLED, oldEnabled, enabled); } public void setEnabledAndVisible(boolean enabled) { @@ -443,6 +443,7 @@ public final class Presentation implements Cloneable { boolean forceNullComponent, boolean allFlags) { if (presentation == this) return; + boolean oldEnabled = isEnabled(), oldVisible = isVisible(); if (allFlags) { myFlags = BitUtil.set(presentation.myFlags, IS_TEMPLATE, isTemplate()); } @@ -450,6 +451,9 @@ public final class Presentation implements Cloneable { myFlags = BitUtil.set(myFlags, IS_ENABLED, BitUtil.isSet(presentation.myFlags, IS_ENABLED)); myFlags = BitUtil.set(myFlags, IS_VISIBLE, BitUtil.isSet(presentation.myFlags, IS_VISIBLE)); } + fireBooleanPropertyChange(PROP_ENABLED, oldEnabled, isEnabled()); + fireBooleanPropertyChange(PROP_VISIBLE, oldVisible, isVisible()); + setTextWithMnemonic(presentation.getTextWithPossibleMnemonic()); setDescription(presentation.myDescriptionSupplier); setIcon(presentation.getIcon());