IPlaceholderFolderLayout stickyFolderRight = null, stickyFolderLeft = null, stickyFolderTop = null, stickyFolderBottom = null;
IStickyViewDescriptor[] descs = WorkbenchPlugin.getDefault()
.getViewRegistry().getStickyViews();
for (int i = 0; i < descs.length; i++) {
IStickyViewDescriptor stickyViewDescriptor = descs[i];
String id = stickyViewDescriptor.getId();
switch (stickyViewDescriptor.getLocation()) {
case IPageLayout.RIGHT:
if (stickyFolderRight == null) {
stickyFolderRight = layout
.createPlaceholderFolder(
StickyViewDescriptor.STICKY_FOLDER_RIGHT,
IPageLayout.RIGHT, .75f,
IPageLayout.ID_EDITOR_AREA);
}
stickyFolderRight.addPlaceholder(id);
break;
case IPageLayout.LEFT:
if (stickyFolderLeft == null) {
stickyFolderLeft = layout.createPlaceholderFolder(
StickyViewDescriptor.STICKY_FOLDER_LEFT,
IPageLayout.LEFT, .25f, IPageLayout.ID_EDITOR_AREA);
}
stickyFolderLeft.addPlaceholder(id);
break;
case IPageLayout.TOP:
if (stickyFolderTop == null) {
stickyFolderTop = layout.createPlaceholderFolder(
StickyViewDescriptor.STICKY_FOLDER_TOP,
IPageLayout.TOP, .25f, IPageLayout.ID_EDITOR_AREA);
}
stickyFolderTop.addPlaceholder(id);
break;
case IPageLayout.BOTTOM:
if (stickyFolderBottom == null) {
stickyFolderBottom = layout.createPlaceholderFolder(
StickyViewDescriptor.STICKY_FOLDER_BOTTOM,
IPageLayout.BOTTOM, .75f,
IPageLayout.ID_EDITOR_AREA);
}
stickyFolderBottom.addPlaceholder(id);
break;
}
//should never be null as we've just added the view above
IViewLayout viewLayout = layout.getViewLayout(id);
viewLayout.setCloseable(stickyViewDescriptor.isCloseable());
viewLayout.setMoveable(stickyViewDescriptor.isMoveable());
}
// Run layout engine.
factory.createInitialLayout(layout);
PerspectiveExtensionReader extender = new PerspectiveExtensionReader();