if (UIStats.isDebugging(UIStats.CREATE_PART_INPUT)) {
label = getName() != null ? getName() : factoryID;
}
try {
UIStats.start(UIStats.CREATE_PART_INPUT, label);
IElementFactory factory = PlatformUI.getWorkbench()
.getElementFactory(factoryID);
if (factory == null) {
throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_bad_element_factory, new Object[] { factoryID, getId(), getName() }));
}
// Get the input element.
input = factory.createElement(inputMem);
if (input == null) {
throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_create_element_returned_null, new Object[] { factoryID, getId(), getName() }));
}
} finally {
UIStats.end(UIStats.CREATE_PART_INPUT, input, label);