IMemento[] views = fastViewsMem
.getChildren(IWorkbenchConstants.TAG_VIEW);
for (int x = 0; x < views.length; x++) {
// Get the view details.
IMemento childMem = views[x];
IViewReference ref = perspective.restoreFastView(childMem,
result);
if (ref != null)
refsList.add(ref);
}
}
// Load the Trim Stack info
IMemento barsMem = memento
.getChild(IWorkbenchConstants.TAG_FAST_VIEW_BARS);
// It's not there for old workspaces
if (barsMem == null)
return;
IMemento[] bars = barsMem
.getChildren(IWorkbenchConstants.TAG_FAST_VIEW_BAR);
for (int i = 0; i < bars.length; i++) {
final String id = bars[i].getString(IWorkbenchConstants.TAG_ID);
fastViewsMem = bars[i].getChild(IWorkbenchConstants.TAG_FAST_VIEWS);
// -Replace- the current list with the one from the store
refsList = new ArrayList();
idToFastViewsMap.put(id, refsList);
if (fastViewsMem != null) {
IMemento[] views = fastViewsMem
.getChildren(IWorkbenchConstants.TAG_VIEW);
result.merge(perspective.createReferences(views));
// Create the trim area for the trim stack
// Only create the TB if there are views in it
if (views.length > 0) {
final int side = bars[i].getInteger(
IWorkbenchConstants.TAG_FAST_VIEW_SIDE)
.intValue();
final int orientation = bars[i].getInteger(
IWorkbenchConstants.TAG_FAST_VIEW_ORIENTATION)
.intValue();
int boolVal = bars[i].getInteger(
IWorkbenchConstants.TAG_FAST_VIEW_STYLE).intValue();
final boolean restoreOnUnzoom = (boolVal > 0);
final String selId = bars[i].getString(IWorkbenchConstants.TAG_FAST_VIEW_SEL_ID);
// Create the stack
StartupThreading.runWithoutExceptions(new StartupRunnable() {
public void runWithException() throws Throwable {
ViewStackTrimToolBar vstb = getTrimForViewStack(id, side, orientation);
vstb.setRestoreOnUnzoom(restoreOnUnzoom);
if (selId != null)
vstb.setSelectedTabId(selId);
}
});
}
for (int x = 0; x < views.length; x++) {
// Get the view details.
IMemento childMem = views[x];
IViewReference ref = perspective.restoreFastView(childMem,
result);
if (ref != null)
refsList.add(ref);
}
}