The WorkbenchManager class manages all workbench objects. More...
#include <WorkbenchManager.h>
Public Member Functions | |
bool | activate (const std::string &name, const std::string &className) |
Activates the workbench with name name. | |
Workbench * | active () const |
Returns the active workbench. | |
Workbench * | createWorkbench (const std::string &name, const std::string &className) |
Searches for and returns an existing workbench object with name name. | |
Workbench * | getWorkbench (const std::string &name) const |
Returns an instance of the workbench with name name. | |
void | removeWorkbench (const std::string &name) |
Removes the workbench with name name. | |
std::list< std::string > | workbenches () const |
Returns a list of all created workbench objects. | |
Static Public Member Functions | |
static void | destruct () |
static WorkbenchManager * | instance () |
Creates the only instance of the WorkbenchManager. | |
Protected Member Functions | |
WorkbenchManager () | |
~WorkbenchManager () |
The WorkbenchManager class manages all workbench objects.
Definition at line 37 of file WorkbenchManager.h.
WorkbenchManager::WorkbenchManager | ( | ) | [protected] |
Definition at line 56 of file WorkbenchManager.cpp.
WorkbenchManager::~WorkbenchManager | ( | ) | [protected] |
Definition at line 60 of file WorkbenchManager.cpp.
References destruct().
bool WorkbenchManager::activate | ( | const std::string & | name, | |
const std::string & | className | |||
) |
Activates the workbench with name name.
Definition at line 126 of file WorkbenchManager.cpp.
References Gui::Workbench::activate(), and createWorkbench().
Referenced by Gui::WorkbenchPy::activate(), and Gui::Application::activateWorkbench().
Workbench * WorkbenchManager::active | ( | ) | const |
Returns the active workbench.
Definition at line 138 of file WorkbenchManager.cpp.
Referenced by Gui::Application::activateWorkbench(), Gui::Dialog::DlgCustomToolbarsImp::addCustomCommand(), Gui::Dialog::DlgCustomToolbarsImp::addCustomToolbar(), Gui::MainWindow::changeEvent(), Gui::MainWindow::createPopupMenu(), Gui::Dialog::DlgCustomToolbars::DlgCustomToolbars(), Gui::Dialog::DlgCustomToolbarsImp::moveDownCustomCommand(), Gui::Dialog::DlgCustomToolbarsImp::moveUpCustomCommand(), Gui::Dialog::DlgCustomToolbarsImp::removeCustomCommand(), Gui::Dialog::DlgCustomToolbarsImp::removeCustomToolbar(), Gui::Dialog::DlgCustomToolbarsImp::renameCustomToolbar(), Gui::Application::sActiveWorkbenchHandler(), and Gui::Application::setupContextMenu().
Workbench * WorkbenchManager::createWorkbench | ( | const std::string & | name, | |
const std::string & | className | |||
) |
Searches for and returns an existing workbench object with name name.
If no such workbench exists then a workbench of class className gets created, if possible. If the workbench cannot be created 0 is returned.
Definition at line 73 of file WorkbenchManager.cpp.
References Base::Console(), Base::Type::createInstanceByName(), Gui::Workbench::getClassTypeId(), Base::BaseClass::getTypeId(), getWorkbench(), and Gui::Workbench::setName().
Referenced by activate(), and Gui::Application::activateWorkbench().
void WorkbenchManager::destruct | ( | void | ) | [static] |
Definition at line 50 of file WorkbenchManager.cpp.
Referenced by Gui::Application::~Application(), and ~WorkbenchManager().
Workbench * WorkbenchManager::getWorkbench | ( | const std::string & | name | ) | const |
Returns an instance of the workbench with name name.
If there is no such workbench 0 is returned.
Definition at line 113 of file WorkbenchManager.cpp.
Referenced by Gui::Application::activateWorkbench(), and createWorkbench().
WorkbenchManager * WorkbenchManager::instance | ( | void | ) | [static] |
Creates the only instance of the WorkbenchManager.
Definition at line 43 of file WorkbenchManager.cpp.
Referenced by Gui::WorkbenchPy::activate(), Gui::Application::activateWorkbench(), Gui::Dialog::DlgCustomToolbarsImp::addCustomCommand(), Gui::Dialog::DlgCustomToolbarsImp::addCustomToolbar(), Gui::MainWindow::changeEvent(), Gui::MainWindow::createPopupMenu(), Gui::Dialog::DlgCustomToolbars::DlgCustomToolbars(), initCompleteGui(), Gui::Dialog::DlgCustomToolbarsImp::moveDownCustomCommand(), Gui::Dialog::DlgCustomToolbarsImp::moveUpCustomCommand(), Gui::WorkbenchGroup::refreshWorkbenchList(), Gui::Dialog::DlgCustomToolbarsImp::removeCustomCommand(), Gui::Dialog::DlgCustomToolbarsImp::removeCustomToolbar(), Gui::Dialog::DlgCustomToolbarsImp::renameCustomToolbar(), Gui::Application::sActiveWorkbenchHandler(), Gui::Application::setupContextMenu(), and Gui::Application::sRemoveWorkbenchHandler().
void WorkbenchManager::removeWorkbench | ( | const std::string & | name | ) |
Removes the workbench with name name.
If there is no such workbench exists nothing happens.
Definition at line 101 of file WorkbenchManager.cpp.
Referenced by Gui::Application::sRemoveWorkbenchHandler().
std::list< std::string > WorkbenchManager::workbenches | ( | void | ) | const |
Returns a list of all created workbench objects.
Definition at line 143 of file WorkbenchManager.cpp.