Medical Imaging Interaction Toolkit  2018.4.99-899caed2
Medical Imaging Interaction Toolkit
berrySaveable.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 "berrySaveable.h"
14 
15 #include "berryIWorkbenchPage.h"
16 #include "berryIWorkbenchPart.h"
17 
18 namespace berry
19 {
20 
22 {
23  return false;
24 }
25 
26 /*IJobRunnable*/void Saveable::DoSave(/*IProgressMonitor monitor,
27  IShellProvider shellProvider*/)
28 {
29 }
30 
31 void Saveable::DisableUI(const QList<IWorkbenchPart::Pointer>& /*parts*/,
32  bool /*closing*/)
33 {
34  //TODO Saveable DisableUI
35  // for (int i = 0; i < parts.length; i++) {
36  // IWorkbenchPart workbenchPart = parts[i];
37  // Composite paneComposite = (Composite) ((PartSite) workbenchPart
38  // .getSite()).getPane().getControl();
39  // Control[] paneChildren = paneComposite.getChildren();
40  // Composite toDisable = ((Composite) paneChildren[0]);
41  // toDisable.setEnabled(false);
42  // if (waitCursor == null) {
43  // waitCursor = new Cursor(workbenchPart.getSite().getWorkbenchWindow().getShell().getDisplay(), SWT.CURSOR_WAIT);
44  // }
45  // originalCursor = paneComposite.getCursor();
46  // paneComposite.setCursor(waitCursor);
47  // }
48 }
49 
50 void Saveable::EnableUI(QList<IWorkbenchPart::Pointer>& /*parts*/)
51 {
52  //TODO Saveable EnableUI
53  // for (unsigned int i = 0; i < parts.size(); i++) {
54  // IWorkbenchPart::Pointer workbenchPart = parts[i];
55  // Composite paneComposite = (Composite) ((PartSite) workbenchPart
56  // .getSite()).getPane().getControl();
57  // Control[] paneChildren = paneComposite.getChildren();
58  // Composite toEnable = ((Composite) paneChildren[0]);
59  // paneComposite.setCursor(originalCursor);
60  // if (waitCursor!=null && !waitCursor.isDisposed()) {
61  // waitCursor.dispose();
62  // waitCursor = null;
63  // }
64  // toEnable.setEnabled(true);
65  // }
66 }
67 
68 Object* Saveable::GetAdapter(const QString& /*adapter*/) const
69 {
70  return nullptr;
71 }
72 
73 }
Light weight base class for most BlueBerry classes.
Definition: berryObject.h:72
virtual void DoSave()=0
virtual void DisableUI(const QList< SmartPointer< IWorkbenchPart > > &parts, bool closing)
virtual void EnableUI(QList< SmartPointer< IWorkbenchPart > > &parts)
virtual bool Show(SmartPointer< IWorkbenchPage > page)