コード例 #1
0
 void PartClosed(berry::IWorkbenchPartReference::Pointer partRef)
 {
   if((partRef->GetId() == QmitkImageNavigatorView::VIEW_ID) || (partRef->GetId() == QmitkStdMultiWidgetEditor::EDITOR_ID))
   {
     m_View->SetMultiWidget(0);
   }
 }
コード例 #2
0
 void PartHidden(berry::IWorkbenchPartReference::Pointer ref)
 {
  if (ref->GetId()=="org.mitk.views.imagenavigator")
  {
   imageNavigatorAction->setChecked(false);
  }
 }
コード例 #3
0
void QmitkFunctionalityCoordinator::PartClosed( berry::IWorkbenchPartReference::Pointer partRef )
{
  // check for multiwidget and inform views that it not available any more
  if ( partRef->GetId() == QmitkStdMultiWidgetEditor::EDITOR_ID )
  {

    QmitkStdMultiWidgetEditor::Pointer stdMultiWidgetEditor = partRef->GetPart(false).Cast<QmitkStdMultiWidgetEditor>();
    for (std::set<QmitkFunctionality*>::iterator it = m_Functionalities.begin()
      ; it != m_Functionalities.end(); it++)
    {
      (*it)->StdMultiWidgetClosed(*(stdMultiWidgetEditor->GetStdMultiWidget()));
      (*it)->StdMultiWidgetNotAvailable(); // deprecated call, provided for consistence
    }
  }
  else
  {
    // check for functionality
    QmitkFunctionality::Pointer _QmitkFunctionality = partRef->GetPart(false).Cast<QmitkFunctionality>();
    if(_QmitkFunctionality.IsNotNull())
    {
      // deactivate on close ( the standalone functionality may still be activated  )
      this->DeactivateStandaloneFunctionality(partRef.GetPointer(), 0);

      // and set pointer to 0
      if(m_StandaloneFuntionality == partRef.GetPointer())
        m_StandaloneFuntionality = 0;

      m_Functionalities.erase(_QmitkFunctionality.GetPointer()); // remove as opened functionality

      // call PartClosed on the QmitkFunctionality
      _QmitkFunctionality->ClosePartProxy();
      //m_VisibleStandaloneFunctionalities.erase(_QmitkFunctionality.GetPointer()); // remove if necessary (should be done before in PartHidden()
    }
  }
}
コード例 #4
0
 void PartVisible(const berry::IWorkbenchPartReference::Pointer& ref) override
 {
   if (ref->GetId()=="org.mitk.views.imagenavigator")
   {
     imageNavigatorAction->setChecked(true);
   }
 }
コード例 #5
0
 void PartHidden(const berry::IWorkbenchPartReference::Pointer& ref) override
 {
   if (ref->GetId()=="org.mitk.views.viewnavigatorview")
   {
     viewNavigatorAction->setChecked(false);
   }
 }
コード例 #6
0
 void PerspectiveChanged(const berry::IWorkbenchPage::Pointer&,
                         const berry::IPerspectiveDescriptor::Pointer&,
                         const berry::IWorkbenchPartReference::Pointer& partRef, const std::string& changeId)
 {
     if (changeId=="viewHide" && partRef->GetId()=="org.mitk.views.viewnavigatorview")
         berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->RemovePerspectiveListener(parentWidget->m_PerspectiveListener.data());
     else
         parentWidget->UpdateTreeList(nullptr, partRef.GetPointer(), changeId);
 }
コード例 #7
0
  void PartHidden(const berry::IWorkbenchPartReference::Pointer& partRef)
  {
    if (partRef->GetId() == QmitkStdMultiWidgetEditor::EDITOR_ID)
    {
      QmitkStdMultiWidgetEditor::Pointer stdMultiWidgetEditor = partRef->GetPart(false).Cast<QmitkStdMultiWidgetEditor>();

      if (d->m_StdMultiWidget == stdMultiWidgetEditor->GetStdMultiWidget())
      {
        d->m_StdMultiWidget->RemovePlanesFromDataStorage();
        stdMultiWidgetEditor->RequestActivateMenuWidget(false);
      }
    }
  }
コード例 #8
0
  void PartVisible(const berry::IWorkbenchPartReference::Pointer& partRef) override
  {
    if (partRef->GetId() == QmitkStdMultiWidgetEditor::EDITOR_ID)
    {
      QmitkStdMultiWidgetEditor::Pointer stdMultiWidgetEditor = partRef->GetPart(false).Cast<QmitkStdMultiWidgetEditor>();

      if (d->m_StdMultiWidget == stdMultiWidgetEditor->GetStdMultiWidget())
      {
        d->m_StdMultiWidget->AddPlanesToDataStorage();
        stdMultiWidgetEditor->RequestActivateMenuWidget(true);
      }
    }
  }
コード例 #9
0
 void PartOpened(berry::IWorkbenchPartReference::Pointer partRef)
 {
   if (partRef->GetId() == QmitkStdMultiWidgetEditor::EDITOR_ID)
   {
     if (QmitkStdMultiWidgetEditor::Pointer multiWidgetPart =
         partRef->GetPart(false).Cast<QmitkStdMultiWidgetEditor>())
     {
       m_View->SetMultiWidget(multiWidgetPart->GetStdMultiWidget());
     }
     else
     {
       m_View->SetMultiWidget(0);
     }
   }
 }
コード例 #10
0
void QmitkFunctionalityCoordinator::PartOpened( berry::IWorkbenchPartReference::Pointer partRef )
{
   // check for multiwidget and inform views that it is available now
  if ( partRef->GetId() == QmitkStdMultiWidgetEditor::EDITOR_ID )
  {
    for (std::set<QmitkFunctionality*>::iterator it = m_Functionalities.begin()
      ; it != m_Functionalities.end(); it++)
    {
      (*it)->StdMultiWidgetAvailable(*(partRef
        ->GetPart(false).Cast<QmitkStdMultiWidgetEditor>()->GetStdMultiWidget()));
    }
  }
  else
  {
    // Check for QmitkFunctionality
    QmitkFunctionality::Pointer _QmitkFunctionality = partRef->GetPart(false).Cast<QmitkFunctionality>();
    if(_QmitkFunctionality.IsNotNull())
    {
      m_Functionalities.insert(_QmitkFunctionality.GetPointer()); // save as opened functionality
    }
  }
}