| 922 | } |
| 923 | |
| 924 | bool 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)); |
no test coverage detected