18 #include "internal/QmitkFunctionalityUtil.h"
19 #include "internal/QmitkCommonLegacyActivator.h"
38 #include <QMessageBox>
39 #include <QScrollArea>
40 #include <QVBoxLayout>
41 #include <QApplication>
47 , m_SelectionProvider(0)
48 , m_DataStorageServiceTracker(QmitkCommonLegacyActivator::GetContext())
49 , m_HandlesMultipleDataStorages(false)
50 , m_InDataStorageChanged(false)
52 m_DataStorageServiceTracker.open();
57 m_HandlesMultipleDataStorages = multiple;
62 return m_HandlesMultipleDataStorages;
72 if(m_HandlesMultipleDataStorages)
109 QScrollArea* scrollArea =
new QScrollArea;
111 scrollArea->setFrameShadow(QFrame::Plain);
112 scrollArea->setFrameShape(QFrame::NoFrame);
113 scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
114 scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
125 scrollArea->setWidgetResizable(
true);
129 QWidget* parentQWidget =
static_cast<QWidget*
>(parent);
130 QVBoxLayout* parentLayout =
new QVBoxLayout(parentQWidget);
131 parentLayout->setMargin(0);
132 parentLayout->setSpacing(0);
133 parentLayout->addWidget(scrollArea);
136 parentQWidget->setLayout(parentLayout);
162 this->
GetSite()->GetWorkbenchWindow()->GetSelectionService()->AddPostSelectionListener(
163 m_BlueBerrySelectionListener.data());
167 new QmitkFunctionalitySelectionProvider(
this));
168 m_SelectionProvider = _SelectionProvider.GetPointer();
225 m_DataStorageServiceTracker.close();
235 if(sourcepart.
IsNull() || sourcepart->GetSite()->GetId() !=
"org.mitk.views.datamanager")
277 this->
GetSite()->GetPage()->GetActiveEditor();
294 return activeStdMultiWidget;
303 QMessageBox::critical ( parent,
"Exception caught!", str );
319 QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) );
324 QApplication::setOverrideCursor( QCursor(Qt::BusyCursor) );
339 QApplication::restoreOverrideCursor();
virtual void RemovePostSelectionListener(ISelectionListener *listener)=0
virtual IDataStorageReference::Pointer GetDefaultDataStorage() const =0
itk::SmartPointer< Self > Pointer
std::vector< mitk::DataNode * > GetDataManagerSelection() const
virtual IDataStorageReference::Pointer GetActiveDataStorage() const =0
void NodeRemovedProxy(const mitk::DataNode *node)
mitk::IDataStorageReference::Pointer GetDataStorageReference() const
void UnRegister(bool del=true) const
virtual ~QmitkFunctionality()
void SetActivated(bool activated)
virtual IDataStorageReference::Pointer GetDataStorage() const =0
void CreatePartControl(QWidget *parent) override
virtual SmartPointer< IPreferences > GetSystemPreferences()=0
QmitkStdMultiWidget * GetActiveStdMultiWidget(bool reCreateWidget=true)
virtual void StdMultiWidgetClosed(QmitkStdMultiWidget &stdMultiWidget)
berry::IPreferences::Pointer GetPreferences() const
void AfterCreateQtPartControl()
void SetVisible(bool visible)
virtual void Deactivated()
virtual void OnPreferencesChanged(const berry::IBerryPreferences *)
mitk::DataStorage::Pointer GetDefaultDataStorage() const
berry::SmartPointer< Self > Pointer
void NodeAddedProxy(const mitk::DataNode *node)
virtual void CreateQtPartControl(QWidget *parent)=0
mitk::DataStorage::Pointer GetDataStorage() const
bool HandlesMultipleDataStorages() const
virtual bool IsExclusiveFunctionality() const
void BlueBerrySelectionChanged(const berry::IWorkbenchPart::Pointer &sourcepart, const berry::ISelection::ConstPointer &selection)
virtual void StdMultiWidgetNotAvailable()
The base class of all MITK related blueberry views (~ in the old version of MITK, this was called "Fu...
virtual void DataStorageChanged()
void NodeChangedProxy(const mitk::DataNode *node)
void SetHandleMultipleDataStorages(bool multiple)
SmartPointer< Other > Cast() const
virtual void StdMultiWidgetAvailable(QmitkStdMultiWidget &stdMultiWidget)
std::vector< mitk::DataNode * > DataNodeSelectionToVector(mitk::DataNodeSelection::ConstPointer currentSelection) const
void RestoreOverrideCursor()
void HandleException(std::exception &e, QWidget *parent=NULL, bool showDialog=true) const
berry::SmartPointer< Self > Pointer
static const int MATCH_ID
IWorkbenchPartSite::Pointer GetSite() const override
virtual void OnSelectionChanged(std::vector< mitk::DataNode * >)