From 83ed89635edb575276203c8af9eb967fcfc2584b Mon Sep 17 00:00:00 2001 From: Vladimir Lagunov Date: Tue, 29 Sep 2020 13:52:39 +0700 Subject: [PATCH] IJ-CR-3190 Mark com.intellij.openapi.actionSystem.impl.ActionButton.click(boolean) with `@TestOnly`. GitOrigin-RevId: 5c5680e8eb3d9ef63bbbb35d04ba616b704f3aea --- .../openapi/actionSystem/impl/ActionButton.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionButton.java b/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionButton.java index 2e3b8940a450..a12f2a231e40 100644 --- a/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionButton.java +++ b/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionButton.java @@ -28,6 +28,7 @@ import com.intellij.util.ui.accessibility.ScreenReader; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.TestOnly; import javax.accessibility.*; import javax.swing.*; @@ -138,14 +139,20 @@ public class ActionButton extends JComponent implements ActionButtonComponent, A } public void click() { - click(true); + performAction(makeClickMouseEvent()); } /** * @param checkIsShowing If true, prevent action to be performed if the button is not showed. */ + @TestOnly public void click(boolean checkIsShowing) { - performAction(new MouseEvent(this, MouseEvent.MOUSE_CLICKED, System.currentTimeMillis(), 0, 0, 0, 1, false), checkIsShowing); + performAction(makeClickMouseEvent(), checkIsShowing); + } + + @NotNull + private MouseEvent makeClickMouseEvent() { + return new MouseEvent(this, MouseEvent.MOUSE_CLICKED, System.currentTimeMillis(), 0, 0, 0, 1, false); } private void performAction(MouseEvent e) {