Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkViewNavigatorWidget.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,
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 //Qmitk headers
19 
20 // Blueberry
21 #include <berryISelectionService.h>
22 #include <berryIWorkbenchWindow.h>
24 #include <berryPlatformUI.h>
25 #include <berryPlatform.h>
26 #include <berryIWorkbenchPage.h>
28 #include <berryIHandlerService.h>
30 #include <berryUIElement.h>
31 
32 // MITK
33 #include <mitkLogMacros.h>
34 
35 // Qt
36 #include <QHash>
37 #include <QMessageBox>
38 #include <QTreeView>
39 #include <QStandardItem>
40 #include <QSortFilterProxyModel>
41 
42 class KeywordRegistry
43 {
44 public:
45  KeywordRegistry()
46  {
48  auto keywordExts = extensionPointService->GetConfigurationElementsFor("org.blueberry.ui.keywords");
49  for (auto keywordExtsIt = keywordExts.begin(); keywordExtsIt != keywordExts.end(); ++keywordExtsIt)
50  {
51  QString keywordId = (*keywordExtsIt)->GetAttribute("id");
52  QString keywordLabels = (*keywordExtsIt)->GetAttribute("label");
53  m_Keywords[keywordId].push_back(keywordLabels);
54  }
55  }
56 
57  QStringList GetKeywords(const QString& id)
58  {
59  return m_Keywords[id];
60  }
61 
62  QStringList GetKeywords(const QStringList& ids)
63  {
64  QStringList result;
65  for (int i = 0; i < ids.size(); ++i)
66  {
67  result.append(this->GetKeywords(ids[i]));
68  }
69  return result;
70  }
71 
72 private:
73  QHash<QString, QStringList> m_Keywords;
74 };
75 
76 
77 class ClassFilterProxyModel : public QSortFilterProxyModel
78 {
79 private :
80  bool hasToBeDisplayed(const QModelIndex index) const;
81  bool displayElement(const QModelIndex index) const;
82 public:
83  ClassFilterProxyModel(QObject *parent = nullptr);
84  bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
85 };
86 ClassFilterProxyModel::ClassFilterProxyModel(QObject *parent):
87  QSortFilterProxyModel(parent)
88 {
89 }
90 
91 bool ClassFilterProxyModel::filterAcceptsRow(int sourceRow,
92  const QModelIndex &sourceParent) const
93 {
94  QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent);
95 
96  return hasToBeDisplayed(index);
97 }
98 
99 bool ClassFilterProxyModel::displayElement(const QModelIndex index) const
100 {
101  bool result = false;
102  QString type = sourceModel()->data(index, Qt::DisplayRole).toString();
103  QStandardItem * item = dynamic_cast<QStandardItemModel*>(sourceModel())->itemFromIndex(index);
104 
105  if (type.contains(filterRegExp()))
106  {
107  return true;
108  }
109  {
110  mitk::QtViewItem* viewItem = dynamic_cast<mitk::QtViewItem*>(item);
111  if (viewItem)
112  {
113  for (int i = 0; i < viewItem->m_Tags.size(); ++i)
114  {
115  if (viewItem->m_Tags[i].contains(filterRegExp()))
116  {
117  return true;
118  }
119  }
120  if (viewItem->m_Description.contains(filterRegExp()))
121  {
122  return true;
123  }
124  }
125  }
126  {
127  mitk::QtPerspectiveItem* viewItem = dynamic_cast<mitk::QtPerspectiveItem*>(item);
128  if (viewItem)
129  {
130  for (int i = 0; i < viewItem->m_Tags.size(); ++i)
131  {
132  if (viewItem->m_Tags[i].contains(filterRegExp()))
133  {
134  return true;
135  }
136  }
137  if (viewItem->m_Description.contains(filterRegExp()))
138  {
139  return true;
140  }
141  }
142  }
143 
144  return result;
145 }
146 
147 bool ClassFilterProxyModel::hasToBeDisplayed(const QModelIndex index) const
148 {
149  bool result = false;
150  if ( sourceModel()->rowCount(index) > 0 )
151  {
152  for( int ii = 0; ii < sourceModel()->rowCount(index); ii++)
153  {
154  QModelIndex childIndex = sourceModel()->index(ii,0,index);
155  if ( ! childIndex.isValid() )
156  break;
157  result = hasToBeDisplayed(childIndex);
158  result |= displayElement(index);
159  if (result)
160  {
161  break;
162  }
163  }
164  }
165  else
166  {
167  result = displayElement(index);
168  }
169  return result;
170 }
171 
172 class ViewNavigatorPerspectiveListener: public berry::IPerspectiveListener
173 {
174 public:
175 
176  ViewNavigatorPerspectiveListener(QmitkViewNavigatorWidget* p) :
177  parentWidget(p)
178  {
179  }
180 
181  Events::Types GetPerspectiveEventTypes() const override
182  {
184  // remove the following line when command framework is finished
186  }
187 
190  {
191  parentWidget->m_ActivePerspective = perspective;
192  parentWidget->UpdateTreeList();
193  }
194 
196  const berry::IPerspectiveDescriptor::Pointer& /*oldPerspective*/,
197  const berry::IPerspectiveDescriptor::Pointer& newPerspective) override
198  {
199  parentWidget->m_ActivePerspective = newPerspective;
200  parentWidget->UpdateTreeList();
201  }
202 
204  const berry::IPerspectiveDescriptor::Pointer& /*perspective*/) override
205  {
206  parentWidget->m_ActivePerspective = nullptr;
207  parentWidget->UpdateTreeList();
208  }
209 
211  const berry::IPerspectiveDescriptor::Pointer& /*perspective*/) override
212  {
213  parentWidget->UpdateTreeList();
214  }
215 
217  const berry::IPerspectiveDescriptor::Pointer& /*perspective*/) override
218  {
219  parentWidget->m_ActivePerspective = nullptr;
220  parentWidget->UpdateTreeList();
221  }
222 
224 
227  const berry::IWorkbenchPartReference::Pointer& partRef, const std::string& changeId)
228  {
229  if (changeId=="viewHide" && partRef->GetId()=="org.mitk.views.viewnavigatorview")
230  berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->RemovePerspectiveListener(parentWidget->m_PerspectiveListener.data());
231  else
232  parentWidget->UpdateTreeList(nullptr, partRef.GetPointer(), changeId);
233  }
234 
235 private:
236  QmitkViewNavigatorWidget* parentWidget;
237 };
238 
240 {
241  if (a.IsNull() || b.IsNull())
242  return false;
243  return a->GetLabel().compare(b->GetLabel()) < 0;
244 }
245 
247 {
248  if (a.IsNull() || b.IsNull())
249  return false;
250  return a->GetLabel().compare(b->GetLabel()) < 0;
251 }
252 
253 bool compareQStandardItems(const QStandardItem* a, const QStandardItem* b)
254 {
255  if (a==nullptr || b==nullptr)
256  return false;
257  return a->text().compare(b->text()) < 0;
258 }
259 
261  QWidget * parent, Qt::WindowFlags )
262  : QWidget(parent)
263  , m_Window(window)
264 {
265  m_Generated = false;
266  this->CreateQtPartControl(this);
267 }
268 
270 {
271  m_Window->RemovePerspectiveListener(m_PerspectiveListener.data());
272 }
273 
275 {
276  m_Controls.lineEdit->setFocus();
277 }
278 
280 {
281  // create GUI widgets from the Qt Designer's .ui file
283  m_Window->AddPerspectiveListener(m_PerspectiveListener.data());
284 
285  m_Parent = parent;
286  m_Controls.setupUi( parent );
287  connect( m_Controls.m_PluginTreeView, SIGNAL(customContextMenuRequested(QPoint)), SLOT(CustomMenuRequested(QPoint)));
288  connect( m_Controls.m_PluginTreeView, SIGNAL(doubleClicked(const QModelIndex&)), SLOT(ItemClicked(const QModelIndex&)));
289  connect( m_Controls.lineEdit, SIGNAL(textChanged(QString)), SLOT(FilterChanged()));
290 
291  m_ContextMenu = new QMenu(m_Controls.m_PluginTreeView);
292  m_Controls.m_PluginTreeView->setContextMenuPolicy(Qt::CustomContextMenu);
293 
294  // Create a new TreeModel for the data
295  m_TreeModel = new QStandardItemModel();
296  m_FilterProxyModel = new ClassFilterProxyModel(this);
297  m_FilterProxyModel->setSourceModel(m_TreeModel);
298  //proxyModel->setFilterFixedString("Diff");
299  m_Controls.m_PluginTreeView->setModel(m_FilterProxyModel);
300 
301  this->UpdateTreeList();
302 }
303 
304 void QmitkViewNavigatorWidget::UpdateTreeList(QStandardItem* root, berry::IWorkbenchPartReference *partRef, const std::string &changeId)
305 {
306  berry::IWorkbenchPage::Pointer page = m_Window->GetActivePage();
307  if (page.IsNull())
308  return;
309 
310  if( !m_Generated )
311  {
313  }
314 
315  if (root==nullptr)
316  root = m_TreeModel->invisibleRootItem();
317  for (int i=0; i<root->rowCount(); i++)
318  {
319  QStandardItem* item = root->child(i);
320  QFont font;
321  if (dynamic_cast<mitk::QtPerspectiveItem*>(item))
322  {
323  mitk::QtPerspectiveItem* pItem = dynamic_cast<mitk::QtPerspectiveItem*>(item);
324  berry::IPerspectiveDescriptor::Pointer currentPersp = page->GetPerspective();
325 
326  if (currentPersp.IsNotNull() && currentPersp->GetId()==pItem->m_Perspective->GetId())
327  font.setBold(true);
328  pItem->setFont(font);
329  }
330  mitk::QtViewItem* vItem = dynamic_cast<mitk::QtViewItem*>(item);
331  if (vItem)
332  {
333  QList<berry::IViewPart::Pointer> viewParts(page->GetViews());
334  for (int i=0; i<viewParts.size(); i++)
335  if(viewParts[i]->GetPartName()==vItem->m_View->GetLabel())
336  {
337  font.setBold(true);
338  break;
339  }
340 
341  if( partRef!=nullptr && partRef->GetId()==vItem->m_View->GetId() && changeId=="viewHide")
342  font.setBold(false);
343 
344  vItem->setFont(font);
345  }
346  UpdateTreeList(item, partRef, changeId);
347  }
348 }
349 
351 {
352  // active workbench window available?
353  if (m_Window.IsNull())
354  return false;
355 
356  // active page available?
357  berry::IWorkbenchPage::Pointer page = m_Window->GetActivePage();
358  if (page.IsNull())
359  return false;
360 
361  // everything is fine and we can remove the window listener
362  if (m_WindowListener != nullptr)
364 
365  // initialize tree model
366  m_TreeModel->clear();
367  QStandardItem *treeRootItem = m_TreeModel->invisibleRootItem();
368 
369  // get all available perspectives
371  QList<berry::IPerspectiveDescriptor::Pointer> perspectiveDescriptors(perspRegistry->GetPerspectives());
372  qSort(perspectiveDescriptors.begin(), perspectiveDescriptors.end(), comparePerspectives);
373 
374  // get all Keywords
375  KeywordRegistry keywordRegistry;
376 
377  berry::IPerspectiveDescriptor::Pointer currentPersp = page->GetPerspective();
378  //QStringList perspectiveExcludeList = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetPerspectiveExcludeList();
379 
380  std::vector< QStandardItem* > categoryItems;
381  QStandardItem *perspectiveRootItem = new QStandardItem("Workflows");
382  perspectiveRootItem->setEditable(false);
383  perspectiveRootItem->setFont(QFont("", 12, QFont::Normal));
384  treeRootItem->appendRow(perspectiveRootItem);
385 
386  for (int i=0; i<perspectiveDescriptors.size(); i++)
387  {
388  berry::IPerspectiveDescriptor::Pointer p = perspectiveDescriptors.at(i);
389 /*
390  bool skipPerspective = false;
391  for(int e=0; e<perspectiveExcludeList.size(); e++)
392  if(perspectiveExcludeList.at(e)==p->GetId())
393  {
394  skipPerspective = true;
395  break;
396  }
397  if (skipPerspective)
398  continue;
399 */
400  //QIcon* pIcon = static_cast<QIcon*>(p->GetImageDescriptor()->CreateImage());
401  mitk::QtPerspectiveItem* pItem = new mitk::QtPerspectiveItem(p->GetLabel());
402  pItem->m_Perspective = p;
403  pItem->m_Description = p->GetDescription();
404  QStringList keylist = p->GetKeywordReferences();
405  pItem->m_Tags = keywordRegistry.GetKeywords(keylist);
406  pItem->setEditable(false);
407 
408  QFont font; font.setBold(true);
409  if (currentPersp.IsNotNull() && currentPersp->GetId()==p->GetId())
410  pItem->setFont(font);
411 
412  QStringList catPath = p->GetCategoryPath();
413  if (catPath.isEmpty())
414  {
415  perspectiveRootItem->appendRow(pItem);
416  }
417  else
418  {
419  QStandardItem* categoryItem = nullptr;
420 
421  for (unsigned int c=0; c<categoryItems.size(); c++)
422  {
423  if (categoryItems.at(c)->text() == catPath.front())
424  {
425  categoryItem = categoryItems.at(c);
426  break;
427  }
428  }
429 
430  if (categoryItem==nullptr)
431  {
432  categoryItem = new QStandardItem(QIcon(),catPath.front());
433  categoryItems.push_back(categoryItem);
434  }
435  categoryItem->setEditable(false);
436  categoryItem->appendRow(pItem);
437  categoryItem->setFont(QFont("", 12, QFont::Normal));
438  }
439  }
440  std::sort(categoryItems.begin(), categoryItems.end(), compareQStandardItems);
441  for (unsigned int i=0; i<categoryItems.size(); i++)
442  perspectiveRootItem->appendRow(categoryItems.at(i));
443 
444  // get all available views
446  QList<berry::IViewDescriptor::Pointer> viewDescriptors(viewRegistry->GetViews());
447  QList<berry::IViewPart::Pointer> viewParts(page->GetViews());
448  qSort(viewDescriptors.begin(), viewDescriptors.end(), compareViews);
449  auto emptyItem = new QStandardItem();
450  emptyItem->setFlags(Qt::ItemIsEnabled);
451  treeRootItem->appendRow(emptyItem);
452  //QStringList viewExcludeList = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetViewExcludeList();
453 
454  //There currently is no way to get the list of excluded views at application start
455  QStringList viewExcludeList;
456  // internal view used for the intro screen, will crash when opened directly, see T22352
457  viewExcludeList.append(QString("org.blueberry.ui.internal.introview"));
458 
459  QStandardItem* viewRootItem = new QStandardItem(QIcon(),"Views");
460  viewRootItem->setFont(QFont("", 12, QFont::Normal));
461  viewRootItem->setEditable(false);
462  treeRootItem->appendRow(viewRootItem);
463 
464  categoryItems.clear();
465  QStandardItem* noCategoryItem = new QStandardItem(QIcon(),"Miscellaneous");
466  noCategoryItem->setEditable(false);
467  noCategoryItem->setFont(QFont("", 12, QFont::Normal));
468 
469  for (int i = 0; i < viewDescriptors.size(); ++i)
470  {
471  berry::IViewDescriptor::Pointer v = viewDescriptors[i];
472  bool skipView = false;
473  for(int e=0; e<viewExcludeList.size(); e++)
474  if(viewExcludeList.at(e)==v->GetId())
475  {
476  skipView = true;
477  break;
478  }
479  if (skipView)
480  continue;
481 
482  QStringList catPath = v->GetCategoryPath();
483 
484  QIcon icon = v->GetImageDescriptor();
485  mitk::QtViewItem* vItem = new mitk::QtViewItem(icon, v->GetLabel());
486  vItem->m_View = v;
487  vItem->setToolTip(v->GetDescription());
488  vItem->m_Description = v->GetDescription();
489 
490  QStringList keylist = v->GetKeywordReferences();
491  vItem->m_Tags = keywordRegistry.GetKeywords(keylist);
492  vItem->setEditable(false);
493 
494  for (int i=0; i<viewParts.size(); i++)
495  if(viewParts[i]->GetPartName()==v->GetLabel())
496  {
497  QFont font; font.setBold(true);
498  vItem->setFont(font);
499  break;
500  }
501 
502  if (catPath.empty())
503  noCategoryItem->appendRow(vItem);
504  else
505  {
506  QStandardItem* categoryItem = nullptr;
507 
508  for (unsigned int c=0; c<categoryItems.size(); c++)
509  if (categoryItems.at(c)->text() == catPath.front())
510  {
511  categoryItem = categoryItems.at(c);
512  break;
513  }
514 
515  if (categoryItem==nullptr)
516  {
517  categoryItem = new QStandardItem(QIcon(),catPath.front());
518  categoryItems.push_back(categoryItem);
519  }
520  categoryItem->setEditable(false);
521  categoryItem->appendRow(vItem);
522  categoryItem->setFont(QFont("", 12, QFont::Normal));
523  }
524  }
525  std::sort(categoryItems.begin(), categoryItems.end(), compareQStandardItems);
526 
527  for (unsigned int i=0; i<categoryItems.size(); i++)
528  viewRootItem->appendRow(categoryItems.at(i));
529  if (noCategoryItem->hasChildren())
530  viewRootItem->appendRow(noCategoryItem);
531 
532  m_Controls.m_PluginTreeView->expandAll();
533 
534  return true;
535 }
536 
538 {
539  QString filterString = m_Controls.lineEdit->text();
540 // if (filterString.size() > 0 )
541  m_Controls.m_PluginTreeView->expandAll();
542 // else
543 // m_Controls.m_PluginTreeView->collapseAll();
544  // QRegExp::PatternSyntax syntax = QRegExp::RegExp;
545 
546  Qt::CaseSensitivity caseSensitivity = Qt::CaseInsensitive;
547  QString strPattern = "^*" + filterString;
548  QRegExp regExp(strPattern, caseSensitivity);
549 
550  m_FilterProxyModel->setFilterRegExp(regExp);
551 }
552 
553 void QmitkViewNavigatorWidget::ItemClicked(const QModelIndex &index)
554 {
555  QStandardItem* item = m_TreeModel->itemFromIndex(m_FilterProxyModel->mapToSource(index));
556 
557  if ( dynamic_cast< mitk::QtPerspectiveItem* >(item) )
558  {
559  try
560  {
561  mitk::QtPerspectiveItem* pItem = dynamic_cast< mitk::QtPerspectiveItem* >(item);
563  }
564  catch (...)
565  {
566  QMessageBox::critical(nullptr, "Opening Perspective Failed", QString("The requested perspective could not be opened.\nSee the log for details."));
567  }
568  }
569  else if ( dynamic_cast< mitk::QtViewItem* >(item) )
570  {
572 
573  if (page.IsNotNull())
574  {
575  try
576  {
577  mitk::QtViewItem* vItem = dynamic_cast< mitk::QtViewItem* >(item);
578  page->ShowView(vItem->m_View->GetId());
579  }
580  catch (berry::PartInitException e)
581  {
582  BERRY_ERROR << "Error: " << e.what() << std::endl;
583  }
584  }
585  }
586 }
587 
589 {
590  berry::IHandlerService* handlerService = m_Window->GetService<berry::IHandlerService>();
591  try
592  {
595  FillTreeList();
596  }
597  catch(const berry::NotHandledException)
598  {}
599  catch(const berry::CommandException& e)
600  {
601  MITK_ERROR << e.what();
602  }
603 }
604 
606 {
607  if (QMessageBox::Yes == QMessageBox(QMessageBox::Question, "Please confirm", "Do you really want to reset the current perspective?", QMessageBox::Yes|QMessageBox::No).exec())
608  berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->ResetPerspective();
609 }
610 
612 {
613  if (QMessageBox::Yes == QMessageBox(QMessageBox::Question, "Please confirm", "Do you really want to close the current perspective?", QMessageBox::Yes|QMessageBox::No).exec())
614  {
615  berry::IWorkbenchPage::Pointer page = m_Window->GetActivePage();
616  page->ClosePerspective(page->GetPerspective(), true, true);
617 
618  // if ( page->GetPerspective().IsNull() )
619  // {
620  // berry::IPerspectiveRegistry* perspRegistry = berry::PlatformUI::GetWorkbench()->GetPerspectiveRegistry();
621  // berry::PlatformUI::GetWorkbench()->ShowPerspective( perspRegistry->GetDefaultPerspective(), berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow() );
622  // }
623  }
624 }
625 
627 {
628  if (QMessageBox::Yes == QMessageBox(QMessageBox::Question, "Please confirm", "Do you really want to close all perspectives?", QMessageBox::Yes|QMessageBox::No).exec())
629  {
631  page->CloseAllPerspectives(true, true);
632 
633  // berry::IPerspectiveRegistry* perspRegistry = berry::PlatformUI::GetWorkbench()->GetPerspectiveRegistry();
634  // berry::PlatformUI::GetWorkbench()->ShowPerspective( perspRegistry->GetDefaultPerspective(), berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow() );
635  }
636 }
637 
639 {
640  m_Controls.m_PluginTreeView->expandAll();
641 }
642 
644 {
645  m_Controls.m_PluginTreeView->collapseAll();
646 }
647 
649 {
650  QModelIndex index = m_Controls.m_PluginTreeView->indexAt(pos);
651  QStandardItem* item = m_TreeModel->itemFromIndex(m_FilterProxyModel->mapToSource(index));
652 
653  if (m_ContextMenu==nullptr)
654  return;
655 
656  m_ContextMenu->clear();
657 
658  QAction* expandAction = new QAction("Expand tree", this);
659  m_ContextMenu->addAction(expandAction);
660  connect(expandAction, SIGNAL(triggered()), SLOT(ExpandAll()));
661 
662  QAction* collapseAction = new QAction("Collapse tree", this);
663  m_ContextMenu->addAction(collapseAction);
664  connect(collapseAction, SIGNAL(triggered()), SLOT(CollapseAll()));
665 
666  m_ContextMenu->addSeparator();
667 
668 
669  if ( item!=nullptr && dynamic_cast< mitk::QtPerspectiveItem* >(item) )
670  {
671  berry::IPerspectiveDescriptor::Pointer persp = dynamic_cast< mitk::QtPerspectiveItem* >(item)->m_Perspective;
672  if (this->m_ActivePerspective.IsNotNull() && this->m_ActivePerspective == persp)
673  {
674  //m_ContextMenu->addSeparator();
675 
676  QAction* saveAsAction = new QAction("Save As...", this);
677  m_ContextMenu->addAction(saveAsAction);
678  connect(saveAsAction, SIGNAL(triggered()), SLOT(SaveCurrentPerspectiveAs()));
679  m_ContextMenu->addSeparator();
680  }
681  }
682 
683  QAction* resetAction = new QAction("Reset current perspective", this);
684  m_ContextMenu->addAction(resetAction);
685  connect(resetAction, SIGNAL(triggered()), SLOT(ResetCurrentPerspective()));
686 
687  QAction* closeAction = new QAction("Close perspective", this);
688  m_ContextMenu->addAction(closeAction);
689  connect(closeAction, SIGNAL(triggered()), SLOT(ClosePerspective()));
690 
691  m_ContextMenu->addSeparator();
692 
693  QAction* closeAllAction = new QAction("Close all perspectives", this);
694  m_ContextMenu->addAction(closeAllAction);
695  connect(closeAllAction, SIGNAL(triggered()), SLOT(CloseAllPerspectives()));
696 
697  m_ContextMenu->popup(m_Controls.m_PluginTreeView->viewport()->mapToGlobal(pos));
698 }
berry::IViewDescriptor::Pointer m_View
virtual IPerspectiveRegistry * GetPerspectiveRegistry() const =0
#define MITK_ERROR
Definition: mitkLogMacros.h:24
virtual void PerspectiveActivated(const SmartPointer< IWorkbenchPage > &page, const IPerspectiveDescriptor::Pointer &perspective)
virtual void PerspectiveOpened(const SmartPointer< IWorkbenchPage > &page, const IPerspectiveDescriptor::Pointer &perspective)
virtual QString GetId() const =0
virtual void RemoveWindowListener(IWindowListener *listener)=0
virtual QList< IPerspectiveDescriptor::Pointer > GetPerspectives()=0
bool compareQStandardItems(const QStandardItem *a, const QStandardItem *b)
virtual Object::Pointer ExecuteCommand(const QString &commandId, const SmartPointer< const UIElement > &uielement)=0
#define BERRY_ERROR
Definition: berryLog.h:26
berry::IPerspectiveDescriptor::Pointer m_Perspective
QScopedPointer< berry::IWindowListener > m_WindowListener
void ItemClicked(const QModelIndex &index)
virtual void PerspectiveClosed(const SmartPointer< IWorkbenchPage > &page, const IPerspectiveDescriptor::Pointer &perspective)
virtual Events::Types GetPerspectiveEventTypes() const =0
virtual void CreateQtPartControl(QWidget *parent)
virtual QList< IViewDescriptor::Pointer > GetViews() const =0
QmitkViewNavigatorWidget(berry::IWorkbenchWindow::Pointer window, QWidget *parent=nullptr, Qt::WindowFlags f=nullptr)
Ui::QmitkViewNavigatorWidgetControls m_Controls
static IWorkbench * GetWorkbench()
virtual QList< SmartPointer< IConfigurationElement > > GetConfigurationElementsFor(const QString &extensionPointId) const =0
static IExtensionRegistry * GetExtensionRegistry()
QStandardItemModel * m_TreeModel
virtual IWorkbenchWindow::Pointer GetActiveWorkbenchWindow() const =0
QStringList m_Tags
void UpdateTreeList(QStandardItem *item=nullptr, berry::IWorkbenchPartReference *partRef=nullptr, const std::string &changeId="")
The custom viewer plugin implements simple viewer functionality presented in a customized look and feel It was developed to demonstrate extensibility and customizability of the blueberry application framework As an example for the GUI customization capabilities provided by the BlueBerry application the custom viewer plugin was developed It features simple viewer functionality presented in a customized look and feel The custom viewer consists of two i e a viewer perspective and a DICOM perspective As part of the viewer perspective
bool compareViews(const berry::IViewDescriptor::Pointer &a, const berry::IViewDescriptor::Pointer &b)
berry::IPerspectiveDescriptor::Pointer m_ActivePerspective
ObjectType * GetPointer() const
ClassFilterProxyModel * m_FilterProxyModel
QScopedPointer< berry::IPerspectiveListener > m_PerspectiveListener
virtual IViewRegistry * GetViewRegistry() const =0
virtual void PerspectiveSavedAs(const SmartPointer< IWorkbenchPage > &page, const IPerspectiveDescriptor::Pointer &oldPerspective, const IPerspectiveDescriptor::Pointer &newPerspective)
virtual SmartPointer< IWorkbenchPage > ShowPerspective(const QString &perspectiveId, IWorkbenchWindow::Pointer window)=0
bool comparePerspectives(const berry::IPerspectiveDescriptor::Pointer &a, const berry::IPerspectiveDescriptor::Pointer &b)
virtual void PerspectiveChanged(const SmartPointer< IWorkbenchPage > &page, const IPerspectiveDescriptor::Pointer &perspective, const QString &changeId)
virtual void PerspectiveDeactivated(const SmartPointer< IWorkbenchPage > &page, const IPerspectiveDescriptor::Pointer &perspective)