7 #include "monitorQt/action/ComponentsTree.hpp" 9 #include <fwCore/base.hpp> 11 #include <fwRuntime/Bundle.hpp> 12 #include <fwRuntime/Extension.hpp> 13 #include <fwRuntime/ExtensionPoint.hpp> 14 #include <fwRuntime/Runtime.hpp> 16 #include <fwServices/macros.hpp> 18 #include <QApplication> 19 #include <QVBoxLayout> 44 m_treeContainer->clearSelection();
45 m_treeContainer->clear();
49 while (iter_bundles != defaultRuntime->
bundlesEnd())
51 const std::string bundleName = (*iter_bundles)->getIdentifier();
52 bool isBundleEnable = (*iter_bundles)->isEnable();
53 QTreeWidgetItem* bundleItem =
new QTreeWidgetItem();
56 bundleItem->setBackground(0, QBrush(QColor(155, 155, 155)));
58 bundleItem->setText(0, QString::fromStdString(bundleName));
59 m_treeContainer->addTopLevelItem( bundleItem );
62 QTreeWidgetItem* extensionsItem =
new QTreeWidgetItem();
63 extensionsItem->setText(0, QObject::tr(
"Extensions"));
64 bundleItem->addChild( extensionsItem );
66 while (iter_extension != (*iter_bundles)->extensionsEnd())
68 std::string
point = (*iter_extension)->getPoint();
69 bool isExtensionEnable = (*iter_extension)->isEnable();
70 QTreeWidgetItem* item =
new QTreeWidgetItem();
71 if(!isExtensionEnable)
73 item->setBackground(0, QBrush(QColor(155, 155, 155)));
75 item->setText(0, QString::fromStdString(point));
76 extensionsItem->addChild( item );
99 QWidget* parent = qApp->activeWindow();
100 m_dialog =
new QDialog(parent);
101 m_dialog->setWindowTitle(
"Components Tree");
102 m_treeContainer =
new QTreeWidget(m_dialog);
103 m_treeContainer->setHeaderHidden(
true);
105 QVBoxLayout* topsizer =
new QVBoxLayout();
106 topsizer->addWidget(m_treeContainer);
107 topsizer->setContentsMargins(0, 0, 0, 0);
108 m_dialog->setLayout(topsizer);
115 delete m_treeContainer;
static FWRUNTIME_API Runtime * getDefault()
Retrieves the default runtime instance.
Defines the runtime class.
void updating() override
Fill factory information in m_tree and show the dialog.
FWGUI_API void actionServiceStarting()
Method called when the action service is starting.
MONITORQT_API ComponentsTree() noexcept
Does nothing.
FWRUNTIME_API BundleIterator bundlesBegin()
Retrieves the iterator on the begining of the bundle collection.
Implements an action that show bundle information.
FWGUI_API void actionServiceStopping()
Method called when the action service is stopping.
FWRUNTIME_API BundleIterator bundlesEnd()
Retrieves the iterator on the end of the bundle collection.
Defines the service interface managing the menu items.
void configuring() override
Calls classic IAction methods to configure.
void starting() override
Prepare dialog box.
FWGUI_API void initialize()
Initialize the action.
void stopping() override
Delete dialog box.
ExtensionContainer::const_iterator ExtensionConstIterator
Defines the extension container.
Base class for each data object.
virtual MONITORQT_API ~ComponentsTree() noexcept
Does nothing.
BundleContainer::iterator BundleIterator
Defines the bundle container iterator type.