Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berrySaveable.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 BlueBerry Platform
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #include "berrySaveable.h"
18 
19 #include "berryIWorkbenchPage.h"
20 #include "berryIWorkbenchPart.h"
21 
22 namespace berry
23 {
24 
26 {
27  return false;
28 }
29 
30 /*IJobRunnable*/void Saveable::DoSave(/*IProgressMonitor monitor,
31  IShellProvider shellProvider*/)
32 {
33  this->DoSave(/*monitor*/);
34  //return 0;
35 }
36 
37 void Saveable::DisableUI(const QList<IWorkbenchPart::Pointer>& /*parts*/,
38  bool /*closing*/)
39 {
40  //TODO Saveable DisableUI
41  // for (int i = 0; i < parts.length; i++) {
42  // IWorkbenchPart workbenchPart = parts[i];
43  // Composite paneComposite = (Composite) ((PartSite) workbenchPart
44  // .getSite()).getPane().getControl();
45  // Control[] paneChildren = paneComposite.getChildren();
46  // Composite toDisable = ((Composite) paneChildren[0]);
47  // toDisable.setEnabled(false);
48  // if (waitCursor == null) {
49  // waitCursor = new Cursor(workbenchPart.getSite().getWorkbenchWindow().getShell().getDisplay(), SWT.CURSOR_WAIT);
50  // }
51  // originalCursor = paneComposite.getCursor();
52  // paneComposite.setCursor(waitCursor);
53  // }
54 }
55 
56 void Saveable::EnableUI(QList<IWorkbenchPart::Pointer>& /*parts*/)
57 {
58  //TODO Saveable EnableUI
59  // for (unsigned int i = 0; i < parts.size(); i++) {
60  // IWorkbenchPart::Pointer workbenchPart = parts[i];
61  // Composite paneComposite = (Composite) ((PartSite) workbenchPart
62  // .getSite()).getPane().getControl();
63  // Control[] paneChildren = paneComposite.getChildren();
64  // Composite toEnable = ((Composite) paneChildren[0]);
65  // paneComposite.setCursor(originalCursor);
66  // if (waitCursor!=null && !waitCursor.isDisposed()) {
67  // waitCursor.dispose();
68  // waitCursor = null;
69  // }
70  // toEnable.setEnabled(true);
71  // }
72 }
73 
74 Object* Saveable::GetAdapter(const QString& /*adapter*/) const
75 {
76  return nullptr;
77 }
78 
79 }
Light weight base class for most BlueBerry classes.
Definition: berryObject.h:78
virtual void DoSave()=0
virtual void DisableUI(const QList< SmartPointer< IWorkbenchPart > > &parts, bool closing)
virtual void EnableUI(QList< SmartPointer< IWorkbenchPart > > &parts)
virtual berryObjectMacro(Saveable) private bool Show(SmartPointer< IWorkbenchPage > page)