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

Method SaveState

Plugins/org.blueberry.ui.qt/src/internal/berryWorkbenchWindow.cpp:1435–1615  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1433}
1434
1435bool WorkbenchWindow::SaveState(IMemento::Pointer memento)
1436{
1437 // MultiStatus result = new MultiStatus(PlatformUI.PLUGIN_ID, IStatus.OK,
1438 // WorkbenchMessages.WorkbenchWindow_problemsSavingWindow, null);
1439 bool result = true;
1440
1441 // Save the window's state and bounds. A frameless / full-screen shell has no
1442 // restorable state, so it must not persist a maximized flag or bounds.
1443 const bool hasNoRestorableState = HasNoRestorableState(GetShell()->GetControl());
1444 if (!hasNoRestorableState && (GetShell()->GetMaximized() || asMaximizedState))
1445 {
1446 memento->PutString(WorkbenchConstants::TAG_MAXIMIZED, "true");
1447 }
1448 if (GetShell()->GetMinimized())
1449 {
1450 memento->PutString(WorkbenchConstants::TAG_MINIMIZED, "true");
1451 }
1452 if (normalBounds.isEmpty() && !hasNoRestorableState)
1453 {
1454 normalBounds = GetShell()->GetBounds();
1455 }
1456
1457 // IMemento fastViewBarMem = memento
1458 // .createChild(IWorkbenchConstants.TAG_FAST_VIEW_DATA);
1459 // if (fastViewBar != null) {
1460 // fastViewBar.saveState(fastViewBarMem);
1461 // }
1462
1463 memento->PutInteger(WorkbenchConstants::TAG_X, normalBounds.x());
1464 memento->PutInteger(WorkbenchConstants::TAG_Y, normalBounds.y());
1465 memento->PutInteger(WorkbenchConstants::TAG_WIDTH, normalBounds.width());
1466 memento->PutInteger(WorkbenchConstants::TAG_HEIGHT, normalBounds.height());
1467
1468 IWorkbenchPage::Pointer activePage = GetActivePage();
1469 if (activePage
1470 && activePage->FindView(IntroConstants::INTRO_VIEW_ID))
1471 {
1472 IMemento::Pointer introMem = memento
1473 ->CreateChild(WorkbenchConstants::TAG_INTRO);
1474 bool isStandby = GetWorkbench()->GetIntroManager()
1475 ->IsIntroStandby(GetWorkbench()->GetIntroManager()->GetIntro());
1476 introMem->PutBoolean(WorkbenchConstants::TAG_STANDBY, isStandby);
1477 }
1478
1479 // // save the width of the perspective bar
1480 // IMemento persBarMem = memento
1481 // .createChild(IWorkbenchConstants.TAG_PERSPECTIVE_BAR);
1482 // if (perspectiveSwitcher != null) {
1483 // perspectiveSwitcher.saveState(persBarMem);
1484 // }
1485
1486 // // / Save the order of the cool bar contribution items
1487 // ICoolBarManager2 coolBarMgr = (ICoolBarManager2) getCoolBarManager2();
1488 // if (coolBarMgr != null) {
1489 // coolBarMgr.refresh();
1490 // IMemento coolBarMem = memento
1491 // .createChild(IWorkbenchConstants.TAG_COOLBAR_LAYOUT);
1492 // if (coolBarMgr.getLockLayout() == true) {

Callers

nothing calls this directly

Calls 15

HasNoRestorableStateFunction · 0.85
GetMaximizedMethod · 0.80
PutStringMethod · 0.80
GetMinimizedMethod · 0.80
PutIntegerMethod · 0.80
CreateChildMethod · 0.80
IsIntroStandbyMethod · 0.80
GetIntroManagerMethod · 0.80
PutBooleanMethod · 0.80
GetControlMethod · 0.45
GetBoundsMethod · 0.45
FindViewMethod · 0.45

Tested by

no test coverage detected