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

Method StackPart

Plugins/org.blueberry.ui.qt/src/internal/berryPageLayout.cpp:466–505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

464}
465
466void PageLayout::StackPart(LayoutPart::Pointer newPart,
467 const QString& viewId, const QString& refId)
468{
469 this->SetRefPart(viewId, newPart);
470 // force creation of the view layout rec
471 this->GetViewLayoutRec(viewId, true);
472
473 // If ref part is in a folder than just add the
474 // new view to that folder.
475 PartStack::Pointer folder = this->GetFolderPart(refId).Cast<PartStack>();
476 if (folder != 0)
477 {
478 folder->Add(newPart);
479 this->SetFolderPart(viewId, folder);
480 return;
481 }
482
483// parts are now always contained in folders
484
485// // If the ref part is in the page layout then create
486// // a new folder and add the new view.
487// LayoutPart::Pointer refPart = this->GetRefPart(refId);
488// if (refPart != 0) // && (refPart instanceof PartPane || refPart instanceof PartPlaceholder))
489// {
490// PartStack::Pointer newFolder(new PartStack(rootLayoutContainer->page));
491// rootLayoutContainer->Replace(refPart, newFolder);
492// newFolder->Add(refPart);
493// newFolder->Add(newPart);
494// this->SetFolderPart(refId, newFolder);
495// this->SetFolderPart(viewId, newFolder);
496// return;
497// }
498
499 // If ref part is not found then just do add.
500 WorkbenchPlugin::Log("Referenced part does not exist yet: " + refId);
501 PartStack::Pointer newFolder(new PartStack(rootLayoutContainer->page));
502 newFolder->Add(newPart);
503 this->SetFolderPart(viewId, newFolder);
504 rootLayoutContainer->Add(newFolder);
505}
506
507void PageLayout::StackPlaceholder(const QString& viewId,
508 const QString& refId)

Callers 2

StackPlaceholderMethod · 0.95
StackViewMethod · 0.95

Calls 5

SetRefPartMethod · 0.95
GetViewLayoutRecMethod · 0.95
GetFolderPartMethod · 0.95
SetFolderPartMethod · 0.95
AddMethod · 0.45

Tested by

no test coverage detected