void (JBTable table) { int index = table.getSelectionModel().getLeadSelectionIndex(); if (index != -1 && index < myKeyValuePairs.size()) { myUsagePreviewPanel.updateLayout(myUsagePreviewProvider.apply(myKeyValuePairs.get(index).contextData())); } else { myUsagePreviewPanel.updateLayout(null); } }