IMemento[] infos = memento.getChildren(IWorkbenchConstants.TAG_INFO);
final Map mapIDtoPart = new HashMap(infos.length);
for (int i = 0; i < infos.length; i++) {
// Get the info details.
IMemento childMem = infos[i];
final String partID = childMem.getString(IWorkbenchConstants.TAG_PART);
final String relativeID = childMem
.getString(IWorkbenchConstants.TAG_RELATIVE);
int relationship = 0;
int left = 0, right = 0;
float ratio = 0.5f;
if (relativeID != null) {
relationship = childMem.getInteger(
IWorkbenchConstants.TAG_RELATIONSHIP).intValue();
Float ratioFloat = childMem
.getFloat(IWorkbenchConstants.TAG_RATIO);
Integer leftInt = childMem
.getInteger(IWorkbenchConstants.TAG_RATIO_LEFT);
Integer rightInt = childMem
.getInteger(IWorkbenchConstants.TAG_RATIO_RIGHT);
if (leftInt != null && rightInt != null) {
left = leftInt.intValue();
right = rightInt.intValue();
} else if (ratioFloat != null) {
ratio = ratioFloat.floatValue();
}
}
final EditorStack workbook [] = new EditorStack[1];
StartupThreading.runWithoutExceptions(new StartupRunnable() {
public void runWithException() throws Throwable {
// Create the part.
workbook[0] = EditorStack.newEditorWorkbook(EditorSashContainer.this, page);
workbook[0].setID(partID);
// 1FUN70C: ITPUI:WIN - Shouldn't set Container when not active
workbook[0].setContainer(EditorSashContainer.this);
}});
IMemento workbookMemento = childMem
.getChild(IWorkbenchConstants.TAG_FOLDER);
if (workbookMemento != null) {
result.add(workbook[0].restoreState(workbookMemento));
}