use of teamdash.wbs.CsvNodeDataImporter.ParseException in project processdash by dtuma.
the class CsvNodeDataImporterUI method run.
public void run(WBSJTable table, DataTableModel data, TeamMemberList team) {
File f = selectFile(table);
if (f == null)
return;
List newNodes = null;
try {
CsvNodeDataImporter importer = new CsvNodeDataImporter();
newNodes = importer.getNodesFromCsvFile(f, team);
} catch (IOException e) {
showError("Could not open and read from the file '" + f + "'");
} catch (ParseException e) {
showError(e.getMessage());
}
if (newNodes == null)
return;
WBSModel model = (WBSModel) table.getModel();
newNodes = WBSNode.cloneNodeList(newNodes, model);
int[] newRows = model.insertNodes(newNodes, model.getRowCount());
if (newRows == null || newRows.length == 0)
return;
storeExtraNodeAttributes(model, data, newRows);
table.selectRows(newRows);
table.scrollRectToVisible(table.getCellRect(newRows[0], 0, true));
UndoList.madeChange(table, "Import from CSV File");
}
Aggregations