}
@Override
public void done() {
JList list = null;
NXDefaultListModel listModel = new NXDefaultListModel();
;
NXTable table = null;
NXTableModel tableModel = null;
NXSortedListModel sortedModel = null;
if (localPanel.listing) {
table = localPanel.table;
tableModel = new NXTableModel();
} else {
list = localPanel.getListBoxes(-1);
}
String drivePath;
drives = new NXObjectIndex('z', "");
for (Object obj : roots) {
File drive = (File) obj;
drivePath = drive.getPath();
if (drivePath.length() >= 3) {
drivePath = drivePath.substring(0, 2);
}
NXObjectIndex driveIndex = new NXObjectIndex('z', drivePath);
if (localPanel.listing) {
tableModel.addRow(driveIndex);
} else {
listModel.addElement(driveIndex);
}
drives.objects.put(drivePath, driveIndex);
}
NXObjectIndex homeItem = new NXObjectIndex('h', "Home");
if (localPanel.listing) {
tableModel.addRow(homeItem);
table.setModel(tableModel);
} else {
listModel.addElement(homeItem);
sortedModel = new NXSortedListModel(listModel, NXSortedListModel.SortOrder.DESCENDING, new NXObjectComparator());
list.setModel(sortedModel);
}
drives.objects.put("Home", homeItem);
}