IMemento stateMem = null;
if (memento != null) {
stateMem = memento.getChild(IWorkbenchConstants.TAG_VIEW_STATE);
}
IViewDescriptor desc = factory.viewReg.find(getId());
if (desc == null) {
throw new PartInitException(
WorkbenchMessages.ViewFactory_couldNotCreate);
}
// Create the part pane
PartPane pane = getPane();
// Create the pane's top-level control
pane.createControl(factory.page.getClientComposite());
String label = desc.getLabel(); // debugging only
// Things that will need to be disposed if an exception occurs (they are
// listed here
// in the order they should be disposed)
Composite content = null;
IViewPart initializedView = null;
ViewSite site = null;
ViewActionBars actionBars = null;
// End of things that need to be explicitly disposed from the try block
try {
IViewPart view = null;
try {
UIStats.start(UIStats.CREATE_PART, label);
view = desc.createView();
} finally {
UIStats.end(UIStats.CREATE_PART, view, label);
}
if (view instanceof IWorkbenchPart3) {