void () { ClickListener clickListener = new ClickListener() { @Override public boolean onClick(@NotNull MouseEvent event, int clickCount) { if (UIUtil.isCloseClick(event, MouseEvent.MOUSE_RELEASED)) { resetFilter(); } else { showPopup(); } return true; } }; clickListener.installOn(this); clickListener.installOn(myValueLabel); if (myNameLabel != null) clickListener.installOn(myNameLabel); }