return document.createElement(PersistenceConstants.SPLIT_NODE_ELEMENT_NAME);
}
public Object deserialize(Element element) {
SplitNode splitNode = (SplitNode) super.deserialize(element);
String siblingId = element.getAttribute(PersistenceConstants.SPLIT_NODE_ATTRIBUTE_SIBLING_ID);
String orientationString = element.getAttribute(PersistenceConstants.SPLIT_NODE_ATTRIBUTE_ORIENTATION);
String regionString = element.getAttribute(PersistenceConstants.SPLIT_NODE_ATTRIBUTE_REGION);
String percentage = element.getAttribute(PersistenceConstants.SPLIT_NODE_ATTRIBUTE_PERCENTAGE);
String dockingRegion = element.getAttribute(PersistenceConstants.SPLIT_NODE_ATTRIBUTE_DOCKING_REGION);
int orientation = DockingConstants.UNINITIALIZED;
if (orientationString.equals("vertical")) {
orientation = DockingConstants.VERTICAL;
} else if (orientationString.equals("horizontal")) {
orientation = DockingConstants.HORIZONTAL;
}
int region = DockingConstants.UNINITIALIZED;
if (regionString.equals("top")) {
region = DockingConstants.TOP;
} else if (regionString.equals("bottom")) {
region = DockingConstants.BOTTOM;
} else if (regionString.equals("left")) {
region = DockingConstants.LEFT;
} else if (regionString.equals("right")) {
region = DockingConstants.RIGHT;
}
splitNode.setOrientation(orientation);
splitNode.setRegion(region);
splitNode.setPercentage(Float.parseFloat(percentage));
if (siblingId != null && !"".equals(siblingId)) {
splitNode.setSiblingId(siblingId);
}
if (dockingRegion != null && !dockingRegion.equals("")) {
splitNode.setDockingRegion(dockingRegion.toUpperCase());
}
return splitNode;
}