Component component = null;
Map<Integer, FilterCriterionImpl> criteriaMap = filterDialog.getFilterContext().getFilterCriteriaMap();
for (int i = 0; i < criteriaMap.size(); i++) {
tableModel.addRow(filterDialog.getRowForTable());
filterDialog.getFilterTable().revalidate();
FilterCriterionImpl filterCriteria = criteriaMap.get(i);
JComboBox metaDataComboBox = (JComboBox) tableModel.getValueAt(i, 0);
JComboBox optionComboBox = (JComboBox) tableModel.getValueAt(i, 1);
CriterionFieldEnum metadaName = filterCriteria.getField();
GenericMetadata metadata = filterDialog.getFilterDomain().getMetaDataFromFieldType(metadaName);
metaDataComboBox.getModel().setSelectedItem(metadata.getField());
DefaultComboBoxModel secondComboBox = (DefaultComboBoxModel) optionComboBox.getModel();
secondComboBox.removeAllElements();
for (CriterionOperator metaDataItem : metadata.getOperationList()) {
secondComboBox.addElement(metaDataItem);
}
secondComboBox.setSelectedItem(filterCriteria.getOperator());
if (metadata instanceof LastModifiedDateMetadata) {
component = new DatePicker();
((DatePicker) component).setDateCombos(filterCriteria.getValueFreeText());
} else {
if (metadata instanceof ExtensionMismatchMetadata) {
component = configureComboBox(filterCriteria, metadata);
} else {
component = configureTextBoxAndButton(filterDialog, i, filterCriteria, metadata);