} else {
workspaceId = Integer.parseInt(reader.getAttributeValue(null, "id"));
}
workspace = project.getLookup().lookup(WorkspaceProviderImpl.class).newWorkspace(workspaceId);
WorkspaceInformationImpl info = workspace.getLookup().lookup(WorkspaceInformationImpl.class);
//Name
info.setName(reader.getAttributeValue(null, "name"));
//Status
String workspaceStatus = reader.getAttributeValue(null, "status");
if (workspaceStatus.equals("open")) {
info.open();
} else if (workspaceStatus.equals("closed")) {
info.close();
} else {
info.invalid();
}
//Hack to set this workspace active, when readers need to use attributes for instance
ProjectControllerImpl pc = Lookup.getDefault().lookup(ProjectControllerImpl.class);
pc.setTemporaryOpeningWorkspace(workspace);
//WorkspacePersistent
readWorkspaceChildren(workspace, reader);
if (currentProvider != null) {
//One provider not correctly closed
throw new GephiFormatException("The '" + currentProvider.getIdentifier() + "' persistence provider is not ending read.");
}
pc.setTemporaryOpeningWorkspace(null);
//Current workspace
if (info.isOpen()) {
WorkspaceProviderImpl workspaces = project.getLookup().lookup(WorkspaceProviderImpl.class);
workspaces.setCurrentWorkspace(workspace);
}
}
} else if (eventType.equals(XMLStreamReader.END_ELEMENT)) {