writer.writeEndElement();
}
private void readDataTablesModel(XMLStreamReader reader, Workspace workspace) throws XMLStreamException {
AttributeModel attributeModel = workspace.getLookup().lookup(AttributeModel.class);
AttributeTable nodesTable = attributeModel.getNodeTable();
AttributeTable edgesTable = attributeModel.getEdgeTable();
DataTablesModel dataTablesModel = workspace.getLookup().lookup(DataTablesModel.class);
if (dataTablesModel == null) {
workspace.add(dataTablesModel = new DataTablesModel());
}
AvailableColumnsModel nodeColumns = dataTablesModel.getNodeAvailableColumnsModel();
nodeColumns.removeAllColumns();
AvailableColumnsModel edgeColumns = dataTablesModel.getEdgeAvailableColumnsModel();
edgeColumns.removeAllColumns();
boolean end = false;
while (reader.hasNext() && !end) {
Integer eventType = reader.next();
if (eventType.equals(XMLEvent.START_ELEMENT)) {
String name = reader.getLocalName();
if (NODE_COLUMN.equalsIgnoreCase(name)) {
Integer id = Integer.parseInt(reader.getAttributeValue(null, "id"));
AttributeColumn column = nodesTable.getColumn(id);
if (column != null) {
nodeColumns.addAvailableColumn(column);
}
} else if (EDGE_COLUMN.equalsIgnoreCase(name)) {
String id = reader.getAttributeValue(null, "id");
AttributeColumn column = edgesTable.getColumn(id);
if (column != null) {
edgeColumns.addAvailableColumn(column);
}
}
} else if (eventType.equals(XMLStreamReader.END_ELEMENT)) {