super(true);
myProject = project;
myName.setName(elementsTitle);
myTable = new TableView(new ListTableModel(new ColumnInfo[]{myIsSelected, myName}));
final TableViewModel model = myTable.getTableViewModel();
final ArrayList<PsiElement> arrayList = new ArrayList<PsiElement>(elements);
Collections.sort(arrayList, new Comparator<PsiElement>() {
public int compare(final PsiElement o1, final PsiElement o2) {
final int filesResult = Comparing.compare(o1.getContainingFile().getName(), o2.getContainingFile().getName());
if (filesResult != 0) return filesResult;
return getPresentableText(o1).compareTo(getPresentableText(o2));
}
});
model.setItems(arrayList);
model.setSortable(false);
setTitle(title);
init();
onSelectionChanged();
}