void (Consumer<List<JreComboBoxItem>> consumer) { boolean editable = getComponent().isEditable(); ApplicationManager.getApplication().executeOnPooledThread(() -> { List<JreComboBoxItem> items = buildModel(editable); ApplicationManager.getApplication().invokeLater(() -> { if (getComponent().isVisible()) { consumer.accept(items); } }, ModalityState.any()); }); }