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

Method RestoreState

Plugins/org.blueberry.ui.qt/src/internal/berryPartStack.cpp:924–1009  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

922}
923
924bool PartStack::RestoreState(IMemento::Pointer memento)
925{
926 // Read the active tab.
927 QString activeTabID; memento->GetString(WorkbenchConstants::TAG_ACTIVE_PAGE_ID, activeTabID);
928
929 // Read the page elements.
930 QList<IMemento::Pointer> children = memento->GetChildren(WorkbenchConstants::TAG_PAGE);
931
932 // Loop through the page elements.
933 for (int i = 0; i < children.size(); i++)
934 {
935 // Get the info details.
936 IMemento::Pointer childMem = children[i];
937 QString partID; childMem->GetString(WorkbenchConstants::TAG_CONTENT, partID);
938
939 // Create the part.
940 LayoutPart::Pointer part(new PartPlaceholder(partID));
941 part->SetContainer(ILayoutContainer::Pointer(this));
942 this->Add(part);
943 //1FUN70C: ITPUI:WIN - Shouldn't set Container when not active
944 //part.setContainer(this);
945 if (partID == activeTabID)
946 {
947 this->SetSelection(part);
948 // Mark this as the active part.
949 //current = part;
950 }
951 }
952
953 //IPreferenceStore preferenceStore = PrefUtil.getAPIPreferenceStore();
954 //boolean useNewMinMax = preferenceStore.getBoolean(IWorkbenchPreferenceConstants.ENABLE_NEW_MIN_MAX);
955 int expanded;
956 if (memento->GetInteger(WorkbenchConstants::TAG_EXPANDED, expanded))
957 {
958 //StartupThreading.runWithoutExceptions(new StartupRunnable()
959 // {
960 // void runWithException() throws Throwable
961 // {
962 SetState(expanded != IStackPresentationSite::STATE_MINIMIZED ? IStackPresentationSite::STATE_RESTORED
963 : IStackPresentationSite::STATE_MINIMIZED);
964 // }
965 // });
966 }
967 else
968 {
969 SetState(IStackPresentationSite::STATE_RESTORED);
970 }
971
972 int appearance;
973 if (memento->GetInteger(WorkbenchConstants::TAG_APPEARANCE, appearance))
974 {
975 this->appearance = appearance;
976 }
977
978 // Determine if the presentation has saved any info here
979 savedPresentationState = nullptr;
980 QList<IMemento::Pointer> presentationMementos(memento
981 ->GetChildren(WorkbenchConstants::TAG_PRESENTATION));

Callers 1

CreateControlMethod · 0.45

Calls 11

AddMethod · 0.95
SetSelectionMethod · 0.95
GetIntegerMethod · 0.80
GetTextDataMethod · 0.80
GetStringMethod · 0.45
GetChildrenMethod · 0.45
sizeMethod · 0.45
SetContainerMethod · 0.45
GetIdMethod · 0.45
GetChildMethod · 0.45
GetIDMethod · 0.45

Tested by

no test coverage detected