Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
berryViewPart.cpp
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #include "berryViewPart.h"
14 
15 #include <Poco/Exception.h>
16 
17 namespace berry
18 {
19 
21 {
22 
23 }
24 
26 {
27  /*
28  * Initializes this view with the given view site. A memento is passed to
29  * the view which contains a snapshot of the views state from a previous
30  * session. Where possible, the view should try to recreate that state
31  * within the part controls.
32  * <p>
33  * This implementation will ignore the memento and initialize the view in
34  * a fresh state. Subclasses may override the implementation to perform any
35  * state restoration as needed.
36  */
37  this->SetSite(site);
38 }
39 
41 {
42  // do nothing
43 }
44 
46 {
48  if (site.Cast<IViewSite>().IsNull())
49  throw Poco::AssertionViolationException("The site for a view must be an IViewSite"); //$NON-NLS-1$
50 }
51 
53 {
54  return this->GetSite().Cast<IViewSite>();
55 }
56 
57 } // namespace berry
58 
void SaveState(IMemento::Pointer memento) override
SmartPointer< Other > Cast() const
void SetSite(IWorkbenchPartSite::Pointer site)
virtual void CheckSite(IWorkbenchPartSite::Pointer site)
void Init(IViewSite::Pointer site, IMemento::Pointer memento=IMemento::Pointer(nullptr)) override
void CheckSite(IWorkbenchPartSite::Pointer site) override
IViewSite::Pointer GetViewSite() override
IWorkbenchPartSite::Pointer GetSite() const override