void () { // triggers resizing of balloon when necessary myRootPanel.revalidate(); Balloon balloon = JBPopupFactory.getInstance().getParentBalloonFor(myRootPanel); if (balloon != null && !balloon.isDisposed()) balloon.revalidate(); updater.cancelAllRequests(); if (!updater.isDisposed()) { updater.addRequest(() -> { final RegExpMatchResult result = isMatchingText(regExpFile, myRegExp.getText(), mySampleText.getText()); regExpFile.putUserData(RESULT, result); if (result != RegExpMatchResult.MATCHES && result != RegExpMatchResult.FOUND) { setMatches(regExpFile, null); } ApplicationManager.getApplication() .invokeLater(() -> reportResult(result, regExpFile), ModalityState.any(), __ -> updater.isDisposed()); }, 0); } }