DDLFileNameProvider fileNameProvider = new DDLFileNameProvider(object, ddlFileType, extension);
fileNameProviders.add(fileNameProvider);
}
}
SelectFromListDialog fileTypeDialog = new SelectFromListDialog(
object.getProject(), fileNameProviders.toArray(),
ListUtil.BASIC_TO_STRING_ASPECT,
"Select DDL file type",
ListSelectionModel.SINGLE_SELECTION);
JList list = (JList) fileTypeDialog.getPreferredFocusedComponent();
list.setCellRenderer(new DDLFileNameListCellRenderer());
fileTypeDialog.show();
Object[] selectedFileTypes = fileTypeDialog.getSelection();
if (selectedFileTypes != null) {
return (DDLFileNameProvider) selectedFileTypes[0];
}
}
return null;