MCPcopy Create free account
hub / github.com/MITK/MITK / GetEmptyEditor

Method GetEmptyEditor

Plugins/org.blueberry.ui.qt/src/internal/berryEditorReference.cpp:513–566  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

511}
512
513IEditorPart::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}

Callers 2

CreatePartMethod · 0.95
OpenEmptyTabMethod · 0.80

Calls 14

GetEditorInputMethod · 0.95
GetPageMethod · 0.95
CreateErrorEditorPartMethod · 0.80
GetLayoutPartMethod · 0.80
GetEditorPresentationMethod · 0.80
whatMethod · 0.80
RefreshFromPartMethod · 0.80
GetFunction · 0.70
GetPaneMethod · 0.45
CreateControlMethod · 0.45
GetControlMethod · 0.45
InitMethod · 0.45

Tested by

no test coverage detected