| 511 | } |
| 512 | |
| 513 | IEditorPart::Pointer EditorReference::GetEmptyEditor( |
| 514 | EditorDescriptor::Pointer descr) |
| 515 | { |
| 516 | IEditorPart::Pointer part = |
| 517 | Tweaklets::Get(WorkbenchPageTweaklet::KEY)->CreateErrorEditorPart("(Empty)", ""); |
| 518 | |
| 519 | IEditorInput::Pointer input; |
| 520 | try |
| 521 | { |
| 522 | input = this->GetEditorInput(); |
| 523 | } catch (const PartInitException&) |
| 524 | { |
| 525 | input = new NullEditorInput(EditorReference::Pointer(this)); |
| 526 | } |
| 527 | |
| 528 | PartPane::Pointer pane = this->GetPane(); |
| 529 | |
| 530 | pane->CreateControl( |
| 531 | manager->page->GetEditorPresentation()->GetLayoutPart()->GetControl()); |
| 532 | |
| 533 | EditorSite::Pointer site(new EditorSite(IEditorReference::Pointer(this), |
| 534 | part, manager->page, descr)); |
| 535 | |
| 536 | //site.setActionBars(new EditorActionBars(manager.page, site.getWorkbenchWindow(), getId())); |
| 537 | |
| 538 | part->Init(site, input); |
| 539 | |
| 540 | try |
| 541 | { |
| 542 | part->CreatePartControl(pane->GetControl()); |
| 543 | } catch (const std::exception &e) |
| 544 | { |
| 545 | //StatusManager.getManager().handle( |
| 546 | // StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, e)); |
| 547 | BERRY_ERROR << e.what() << std::endl; |
| 548 | return IEditorPart::Pointer(nullptr); |
| 549 | } |
| 550 | |
| 551 | this->part = part.Cast<IWorkbenchPart> (); |
| 552 | // Add a dispose listener to the part. This dispose listener does nothing but log an exception |
| 553 | // if the part's widgets get disposed unexpectedly. The workbench part reference is the only |
| 554 | // object that should dispose this control, and it will remove the listener before it does so. |
| 555 | |
| 556 | this->RefreshFromPart(); |
| 557 | //this->ReleaseReferences(); |
| 558 | |
| 559 | if (this->GetPage().Cast<WorkbenchPage> ()->GetActiveEditorReference() |
| 560 | != this) |
| 561 | { |
| 562 | //fireInternalPropertyChange(INTERNAL_PROPERTY_OPENED); |
| 563 | } |
| 564 | |
| 565 | return part; |
| 566 | } |
| 567 | |
| 568 | } |
no test coverage detected