예제 #1
0
bool DefaultSaveable::Show(IWorkbenchPage::Pointer page)
{
  IWorkbenchPart::Pointer _part(part);
  IWorkbenchPartReference::Pointer reference = page->GetReference(_part);
  if (reference != 0)
  {
    page->Activate(_part);
    return true;
  }
  if (_part.Cast<IViewPart> () != 0)
  {
    IViewPart::Pointer viewPart = _part.Cast<IViewPart> ();
    try
    {
      page->ShowView(viewPart->GetViewSite()->GetId(),
                     viewPart->GetViewSite()->GetSecondaryId(),
                     IWorkbenchPage::VIEW_ACTIVATE);
    } catch (const PartInitException& /*e*/)
    {
      return false;
    }
    return true;
  }
  return false;
}
예제 #2
0
void PartTester::TestView(IViewPart::Pointer part)
{
  if (!(part->GetSite() == part->GetViewSite().GetPointer()))
    throw Poco::AssertionViolationException(
        "A part's site must be the same as a part's view site"); //$NON-NLS-1$

  TestWorkbenchPart(part);
}