How can I close popuped content programmatically, NOT by click outside ?

How can I close popuped content programmatically, NOT by click outside ?

popupButton.setPopupVisible(false); should hide the popup.