Exemple #1
0
void ShellPool::ShellClosed(ShellEvent::Pointer e)
{

  if (e->doit)
  {
    Shell::Pointer s = e->GetSource();
    IShellListener::Pointer l =
        s->GetData(CLOSE_LISTENER).Cast<IShellListener> ();

    if (l != 0)
    {
      s->SetData(Object::Pointer(0), CLOSE_LISTENER);
      l->ShellClosed(e);

      // The shell can 'cancel' the close by setting
      // the 'doit' to false...if so, do nothing
      if (e->doit)
      {
        availableShells.push_back(s);
        s->SetVisible(false);
      }
      else
      {
        // Restore the listener
        s->SetData(l, CLOSE_LISTENER);
      }
    }
  }
  e->doit = false;
}
Exemple #2
0
bool LayoutPart::IsDocked()
{
  Shell::Pointer s = this->GetShell();
  if (s == 0) {
      return false;
  }

  return s->GetData().Cast<IWorkbenchWindow>() != 0;
}
Exemple #3
0
IWorkbenchWindow::Pointer LayoutPart::GetWorkbenchWindow()
{
  Shell::Pointer s = this->GetShell();
  if (s == 0)
  {
    return IWorkbenchWindow::Pointer(0);
  }
  Object::Pointer data = s->GetData();
  if (data.Cast<IWorkbenchWindow>() != 0)
  {
    return data.Cast<IWorkbenchWindow>();
  }
  else if (data.Cast<DetachedWindow>() != 0)
  {
    return data.Cast<DetachedWindow>()->GetWorkbenchPage()->GetWorkbenchWindow();
  }

  return IWorkbenchWindow::Pointer(0);

}