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. More... | |
Workbench * | active () const |
Returns the active workbench. More... | |
Workbench * | createWorkbench (const std::string &name, const std::string &className) |
Searches for and returns an existing workbench object with name name. More... | |
Workbench * | getWorkbench (const std::string &name) const |
Returns an instance of the workbench with name name. More... | |
void | removeWorkbench (const std::string &name) |
Removes the workbench with name name. More... | |
std::list< std::string > | workbenches () const |
Returns a list of all created workbench objects. More... | |
Static Public Member Functions | |
static void | destruct () |
static WorkbenchManager * | instance () |
Creates the only instance of the WorkbenchManager. More... | |
Protected Member Functions | |
WorkbenchManager () | |
~WorkbenchManager () | |
The WorkbenchManager class manages all workbench objects.
|
protected |
Referenced by instance().
|
protected |
bool WorkbenchManager::activate | ( | const std::string & | name, |
const std::string & | className | ||
) |
Activates the workbench with name name.
References Gui::Workbench::activate(), and createWorkbench().
Referenced by ArchBuildingPart.ViewProviderBuildingPart::doubleClicked(), and draftviewproviders.view_layer.ViewProviderLayer::setupContextMenu().
Workbench * WorkbenchManager::active | ( | ) | const |
Returns the active workbench.
Referenced by draftguitools.gui_shapestrings.ShapeString::action(), draftguitools.gui_texts.Text::action(), 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::DlgSettingsLazyLoadedImp::onLoadClicked(), 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.
References Base::BaseClass::getClassTypeId(), Base::Type::getTypeIfDerivedFrom(), getWorkbench(), and Gui::Workbench::setName().
Referenced by activate(), and Gui::Application::activateWorkbench().
|
static |
Referenced by Gui::Application::~Application().
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.
Referenced by Gui::Application::activateWorkbench(), and createWorkbench().
|
static |
Creates the only instance of the WorkbenchManager.
References WorkbenchManager().
Referenced by Gui::Application::activateWorkbench(), Gui::Dialog::DlgCustomToolbarsImp::addCustomCommand(), Gui::Dialog::DlgCustomToolbarsImp::addCustomToolbar(), Gui::Dialog::DlgSettingsLazyLoadedImp::buildUnloadedWorkbenchList(), Gui::MainWindow::changeEvent(), Gui::MainWindow::closeEvent(), Gui::MainWindow::createPopupMenu(), Gui::Dialog::DlgCustomToolbars::DlgCustomToolbars(), Gui::Dialog::DlgCustomToolbarsImp::moveDownCustomCommand(), Gui::Dialog::DlgCustomToolbarsImp::moveUpCustomCommand(), Gui::Dialog::DlgSettingsLazyLoadedImp::onLoadClicked(), 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.
Referenced by Gui::Application::sRemoveWorkbenchHandler().
std::list< std::string > WorkbenchManager::workbenches | ( | void | ) | const |
Returns a list of all created workbench objects.