Rectangle (@NotNull MouseEvent event) { myEditButton.setVisible(myControl.getSelectedModelRows().size() <= 1); Rectangle bounds = getButtonScreenBounds(); if (!myBeingEdited && bounds != null) { boolean selected = bounds.contains(event.getLocationOnScreen()); boolean wasSelected = Toggleable.isSelected(myEditButton.getPresentation()); Toggleable.setSelected(myEditButton.getPresentation(), selected); if (selected ^ wasSelected) { return myScreenBounds; } } return myDelegate.onMouseMove(event); }