+}
+
+//***************************************************
+void XGUI_ObjectsBrowser::onEditItem()
+{
+ if (myObjectsList.size() > 0) {
+ ObjectPtr aFeature = myObjectsList.first();
+ if (aFeature) { // Selection happens in TreeView
+ // Find index which corresponds the feature
+ QModelIndex aIndex;
+ foreach(QModelIndex aIdx, selectedIndexes())
+ {
+ ObjectPtr aFea = dataModel()->object(aIdx);
+ if (dataModel()->object(aIdx)->isSame(aFeature)) {
+ aIndex = aIdx;
+ break;
+ }
+ }
+ if (aIndex.isValid()) {
+ myTreeView->setCurrentIndex(aIndex);
+ myTreeView->edit(aIndex);
+ }
+ } else { //Selection happens in Upper label
+ myActiveDocLbl->setReadOnly(false);
+ myActiveDocLbl->setFocus();
+ myActiveDocLbl->selectAll();
+ myActiveDocLbl->grabMouse();
+ myActiveDocLbl->setProperty("OldText", myActiveDocLbl->text());
+ }
+ }
+}
+
+//***************************************************
+void XGUI_ObjectsBrowser::onSelectionChanged()
+{
+ myObjectsList = myTreeView->selectedObjects();
+ emit selectionChanged();
+}
+
+//***************************************************
+void XGUI_ObjectsBrowser::rebuildDataTree()
+{
+ myDocModel->rebuildDataTree();
+ update();
+}
+
+//***************************************************
+void XGUI_ObjectsBrowser::setObjectsSelected(const QObjectPtrList& theObjects)
+{
+ QList<QModelIndex> theIndexes;
+ QItemSelectionModel* aSelectModel = myTreeView->selectionModel();
+ aSelectModel->clear();
+
+ foreach(ObjectPtr aFeature, theObjects)
+ {
+ QModelIndex aIndex = myDocModel->objectIndex(aFeature);
+ if (aIndex.isValid()) {
+ aSelectModel->select(aIndex, QItemSelectionModel::Select);
+ }
+ }
+}
+
+//***************************************************
+void XGUI_ObjectsBrowser::processEvent(const std::shared_ptr<Events_Message>& theMessage)
+{
+ myDocModel->processEvent(theMessage);
+}
+
+
+//***************************************************
+void XGUI_ObjectsBrowser::clearContent()
+{
+ myObjectsList.clear();
+ myTreeView->clear();
+}