return layoutElement;
}
public Object deserialize(Element element) {
Layout layout = new Layout();
ISerializer dockingStateSerializer = SerializerRegistry.getSerializer(DockingState.class);
NodeList dockingStateNodeList = element.getElementsByTagName(PersistenceConstants.DOCKING_STATE_ELEMENT_NAME);
for (int i = 0; i < dockingStateNodeList.getLength(); i++) {
Node node = dockingStateNodeList.item(i);
if (node instanceof Element) {
Element dockingStateElement = (Element) node;
DockingState dockingState = (DockingState) dockingStateSerializer.deserialize(dockingStateElement);
String dockableId = dockingState.getDockableId();
layout.setDockingState(dockableId, dockingState);
}
}
ISerializer floatingGroupsSerializer = SerializerRegistry.getSerializer(FloatingGroup.class);
NodeList floatingGroupsNodeList = element.getElementsByTagName(PersistenceConstants.FLOATING_GROUP_ELEMENT_NAME);
for (int i=0; i<floatingGroupsNodeList.getLength(); i++) {
Node floatingGroupNode = floatingGroupsNodeList.item(i);
if (floatingGroupNode instanceof Element) {
Element floatingGroupElement = (Element) floatingGroupNode;
FloatingGroup floatingGroup = (FloatingGroup) floatingGroupsSerializer.deserialize(floatingGroupElement);
layout.addFloatingGroup(floatingGroup);
}
}
ISerializer layoutNodeSerializer = SerializerRegistry.getSerializer(LayoutNode.class);
NodeList dockingPortNodeList = element.getElementsByTagName(PersistenceConstants.DOCKING_PORT_NODE_ELEMENT_NAME);
if (dockingPortNodeList.getLength() > 0 && dockingPortNodeList.item(0) instanceof Element) {
Element layoutNodeElement = (Element) dockingPortNodeList.item(0);
LayoutNode restorationLayout = (LayoutNode) layoutNodeSerializer.deserialize(layoutNodeElement);
layout.setRestorationLayout(restorationLayout);
}
return layout;
}