include/sfx2/devtools/DevelopmentToolDockingWindow.hxx |    5 
 include/sfx2/devtools/ObjectInspectorTreeHandler.hxx   |   27 +
 sfx2/source/devtools/DevelopmentToolDockingWindow.cxx  |   13 
 sfx2/source/devtools/ObjectInspectorTreeHandler.cxx    |  325 +++++++---------
 sfx2/uiconfig/ui/developmenttool.ui                    |  338 +++++++++++++++--
 5 files changed, 502 insertions(+), 206 deletions(-)

New commits:
commit 28115cec387e4a548844a7402be798d6ff47f9ac
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Wed Feb 17 11:49:56 2021 +0900
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Mon Feb 22 06:28:00 2021 +0100

    devtools: change the object inspector view to tabs
    
    Until now we had only one tree view with top-level nodes for
    services, interfaces, properties and methods. The problem with
    this is that each one category has it's own distinct columns
    (especially methods) so they can't fit well into just one tree
    view. Services and interfaces categories are very simple so they
    can be presented in a simpler way.
    
    This change adds a tab-bar on top, for all the categories and each
    one is now presented in its own tree view, which makes it possible
    to modify the tree view to the specific category. Tree views are
    currently copies, but they will be modified in the future into
    what is more appropriate for the category.
    
    Change-Id: Ib532df9bb7b9e0920fff57085d6ec4f1031b3ed8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111092
    Tested-by: Tomaž Vajngerl <qui...@gmail.com>
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx 
b/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
index 987bc053a878..f3633189c9b6 100644
--- a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
+++ b/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
@@ -30,7 +30,10 @@ class SFX2_DLLPUBLIC DevelopmentToolDockingWindow final : 
public SfxDockingWindo
 {
 private:
     std::unique_ptr<weld::Label> mpClassNameLabel;
-    std::unique_ptr<weld::TreeView> mpClassListBox;
+    std::unique_ptr<weld::TreeView> mpInterfacesTreeView;
+    std::unique_ptr<weld::TreeView> mpServicesTreeView;
+    std::unique_ptr<weld::TreeView> mpPropertiesTreeView;
+    std::unique_ptr<weld::TreeView> mpMethodsTreeView;
     std::unique_ptr<weld::TreeView> mpDocumentModelTreeView;
     std::unique_ptr<weld::ToggleButton> mpSelectionToggle;
 
diff --git a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx 
b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
index 69769cc261d9..9bb27e4a72cc 100644
--- a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
+++ b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
@@ -19,16 +19,35 @@
 class ObjectInspectorTreeHandler
 {
 private:
-    std::unique_ptr<weld::TreeView>& mpObjectInspectorTree;
+    std::unique_ptr<weld::TreeView>& mpInterfacesTreeView;
+    std::unique_ptr<weld::TreeView>& mpServicesTreeView;
+    std::unique_ptr<weld::TreeView>& mpPropertiesTreeView;
+    std::unique_ptr<weld::TreeView>& mpMethodsTreeView;
+
     std::unique_ptr<weld::Label>& mpClassNameLabel;
 
-    void clearObjectInspectorChildren(weld::TreeIter const& rParent);
+    static void clearObjectInspectorChildren(std::unique_ptr<weld::TreeView>& 
pTreeView,
+                                             weld::TreeIter const& rParent);
+    static void handleExpanding(std::unique_ptr<weld::TreeView>& pTreeView,
+                                weld::TreeIter const& rParent);
+    static void clearAll(std::unique_ptr<weld::TreeView>& pTreeView);
+
+    void appendInterfaces(css::uno::Reference<css::uno::XInterface> const& 
xInterface);
+    void appendServices(css::uno::Reference<css::uno::XInterface> const& 
xInterface);
+    void appendProperties(css::uno::Reference<css::uno::XInterface> const& 
xInterface);
+    void appendMethods(css::uno::Reference<css::uno::XInterface> const& 
xInterface);
 
 public:
-    ObjectInspectorTreeHandler(std::unique_ptr<weld::TreeView>& 
pObjectInspectorTree,
+    ObjectInspectorTreeHandler(std::unique_ptr<weld::TreeView>& 
pInterfacesTreeView,
+                               std::unique_ptr<weld::TreeView>& 
pServicesTreeView,
+                               std::unique_ptr<weld::TreeView>& 
pPropertiesTreeView,
+                               std::unique_ptr<weld::TreeView>& 
pMethodsTreeView,
                                std::unique_ptr<weld::Label>& pClassNameLabel);
 
-    DECL_LINK(ExpandingHandler, const weld::TreeIter&, bool);
+    DECL_LINK(ExpandingHandlerInterfaces, const weld::TreeIter&, bool);
+    DECL_LINK(ExpandingHandlerServices, const weld::TreeIter&, bool);
+    DECL_LINK(ExpandingHandlerProperties, const weld::TreeIter&, bool);
+    DECL_LINK(ExpandingHandlerMethods, const weld::TreeIter&, bool);
 
     void introspect(css::uno::Reference<css::uno::XInterface> const& 
xInterface);
 
diff --git a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx 
b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx
index 5a5134548f11..6bd92f17256d 100644
--- a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx
+++ b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx
@@ -28,13 +28,17 @@ 
DevelopmentToolDockingWindow::DevelopmentToolDockingWindow(SfxBindings* pInputBi
     : SfxDockingWindow(pInputBindings, pChildWindow, pParent, 
"DevelopmentTool",
                        "sfx/ui/developmenttool.ui")
     , mpClassNameLabel(m_xBuilder->weld_label("class_name_value_id"))
-    , mpClassListBox(m_xBuilder->weld_tree_view("class_listbox_id"))
+    , 
mpInterfacesTreeView(m_xBuilder->weld_tree_view("interfaces_treeview_id"))
+    , mpServicesTreeView(m_xBuilder->weld_tree_view("services_treeview_id"))
+    , 
mpPropertiesTreeView(m_xBuilder->weld_tree_view("properties_treeview_id"))
+    , mpMethodsTreeView(m_xBuilder->weld_tree_view("methods_treeview_id"))
     , 
mpDocumentModelTreeView(m_xBuilder->weld_tree_view("leftside_treeview_id"))
     , mpSelectionToggle(m_xBuilder->weld_toggle_button("selection_toggle"))
     , maDocumentModelTreeHandler(
           mpDocumentModelTreeView,
           
pInputBindings->GetDispatcher()->GetFrame()->GetObjectShell()->GetBaseModel())
-    , maObjectInspectorTreeHandler(mpClassListBox, mpClassNameLabel)
+    , maObjectInspectorTreeHandler(mpInterfacesTreeView, mpServicesTreeView, 
mpPropertiesTreeView,
+                                   mpMethodsTreeView, mpClassNameLabel)
 {
     mpDocumentModelTreeView->connect_changed(
         LINK(this, DevelopmentToolDockingWindow, 
DocumentModelTreeViewSelectionHandler));
@@ -106,7 +110,10 @@ void DevelopmentToolDockingWindow::dispose()
 
     // dispose welded objects
     mpClassNameLabel.reset();
-    mpClassListBox.reset();
+    mpInterfacesTreeView.reset();
+    mpServicesTreeView.reset();
+    mpPropertiesTreeView.reset();
+    mpMethodsTreeView.reset();
     mpSelectionToggle.reset();
     mpDocumentModelTreeView.reset();
 
diff --git a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx 
b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
index cbf5640abd5a..6ea018564865 100644
--- a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
+++ b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
@@ -205,7 +205,7 @@ public:
 
     virtual bool shouldShowExpander() { return false; }
 
-    virtual void fillChildren(std::unique_ptr<weld::TreeView>& rTree, 
weld::TreeIter const& rParent)
+    virtual void fillChildren(std::unique_ptr<weld::TreeView>& rTree, const 
weld::TreeIter* pParent)
         = 0;
 
     virtual std::vector<std::pair<sal_Int32, OUString>> getColumnValues()
@@ -232,12 +232,12 @@ OUString lclAppendNode(std::unique_ptr<weld::TreeView>& 
pTree, ObjectInspectorNo
 }
 
 OUString lclAppendNodeToParent(std::unique_ptr<weld::TreeView>& pTree,
-                               weld::TreeIter const& rParent, 
ObjectInspectorNodeInterface* pEntry)
+                               const weld::TreeIter* pParent, 
ObjectInspectorNodeInterface* pEntry)
 {
     OUString sName = pEntry->getObjectName();
     OUString sId(OUString::number(reinterpret_cast<sal_Int64>(pEntry)));
     std::unique_ptr<weld::TreeIter> pCurrent = pTree->make_iterator();
-    pTree->insert(&rParent, -1, &sName, &sId, nullptr, nullptr, 
pEntry->shouldShowExpander(),
+    pTree->insert(pParent, -1, &sName, &sId, nullptr, nullptr, 
pEntry->shouldShowExpander(),
                   pCurrent.get());
     pTree->set_text_emphasis(*pCurrent, true, 0);
 
@@ -261,7 +261,7 @@ public:
     }
 
     void fillChildren(std::unique_ptr<weld::TreeView>& /*rTree*/,
-                      weld::TreeIter const& /*rParent*/) override
+                      const weld::TreeIter* /*pParent*/) override
     {
     }
 
@@ -274,11 +274,6 @@ protected:
     uno::Any maAny;
     uno::Reference<uno::XComponentContext> mxContext;
 
-    uno::Reference<uno::XInterface> getObjectFromAny()
-    {
-        return uno::Reference<uno::XInterface>(maAny, uno::UNO_QUERY);
-    }
-
     ObjectInspectorNodeInterface* createNodeObjectForAny(OUString const& 
rName, uno::Any& rAny);
 
 public:
@@ -323,38 +318,6 @@ public:
     }
 };
 
-class ServicesNode : public BasicValueNode
-{
-public:
-    ServicesNode(css::uno::Reference<css::uno::XInterface> const& xObject,
-                 uno::Reference<uno::XComponentContext> const& xContext)
-        : BasicValueNode("Services", uno::Any(xObject), xContext)
-    {
-    }
-
-    bool shouldShowExpander() override { return true; }
-
-    void fillChildren(std::unique_ptr<weld::TreeView>& pTree,
-                      weld::TreeIter const& rParent) override
-    {
-        auto xObject = getObjectFromAny();
-        if (xObject.is())
-        {
-            auto xServiceInfo = uno::Reference<lang::XServiceInfo>(xObject, 
uno::UNO_QUERY);
-            const uno::Sequence<OUString> 
aServiceNames(xServiceInfo->getSupportedServiceNames());
-            for (auto const& aServiceName : aServiceNames)
-            {
-                lclAppendNodeToParent(pTree, rParent, new 
SimpleStringNode(aServiceName));
-            }
-        }
-    }
-
-    std::vector<std::pair<sal_Int32, OUString>> getColumnValues() override
-    {
-        return std::vector<std::pair<sal_Int32, OUString>>();
-    }
-};
-
 class GenericPropertiesNode : public BasicValueNode
 {
 public:
@@ -365,93 +328,7 @@ public:
     }
 
     void fillChildren(std::unique_ptr<weld::TreeView>& pTree,
-                      weld::TreeIter const& rParent) override;
-};
-
-class PropertiesNode : public GenericPropertiesNode
-{
-public:
-    PropertiesNode(uno::Reference<uno::XInterface> const& xObject,
-                   uno::Reference<uno::XComponentContext> const& xContext)
-        : GenericPropertiesNode("Properties", uno::Any(xObject), xContext)
-    {
-    }
-
-    bool shouldShowExpander() override { return true; }
-
-    std::vector<std::pair<sal_Int32, OUString>> getColumnValues() override
-    {
-        return ObjectInspectorNodeInterface::getColumnValues();
-    }
-};
-
-class InterfacesNode : public BasicValueNode
-{
-public:
-    InterfacesNode(css::uno::Reference<css::uno::XInterface> const& xObject,
-                   uno::Reference<uno::XComponentContext> const& xContext)
-        : BasicValueNode("Interfaces", uno::Any(xObject), xContext)
-    {
-    }
-
-    bool shouldShowExpander() override { return true; }
-
-    void fillChildren(std::unique_ptr<weld::TreeView>& pTree,
-                      weld::TreeIter const& rParent) override
-    {
-        auto xObject = getObjectFromAny();
-        if (xObject.is())
-        {
-            uno::Reference<lang::XTypeProvider> xTypeProvider(xObject, 
uno::UNO_QUERY);
-            if (xTypeProvider.is())
-            {
-                const auto xSequenceTypes = xTypeProvider->getTypes();
-                for (auto const& xType : xSequenceTypes)
-                {
-                    OUString aName = xType.getTypeName();
-                    lclAppendNodeToParent(pTree, rParent, new 
SimpleStringNode(aName));
-                }
-            }
-        }
-    }
-
-    std::vector<std::pair<sal_Int32, OUString>> getColumnValues() override
-    {
-        return std::vector<std::pair<sal_Int32, OUString>>();
-    }
-};
-
-class MethodsNode : public BasicValueNode
-{
-public:
-    MethodsNode(css::uno::Reference<css::uno::XInterface> const& xObject,
-                uno::Reference<uno::XComponentContext> const& xContext)
-        : BasicValueNode("Methods", uno::Any(xObject), xContext)
-    {
-    }
-
-    bool shouldShowExpander() override { return true; }
-
-    void fillChildren(std::unique_ptr<weld::TreeView>& pTree,
-                      weld::TreeIter const& rParent) override
-    {
-        uno::Reference<beans::XIntrospection> xIntrospection
-            = beans::theIntrospection::get(mxContext);
-        auto xIntrospectionAccess = xIntrospection->inspect(maAny);
-
-        const auto xMethods = 
xIntrospectionAccess->getMethods(beans::MethodConcept::ALL);
-        for (auto const& xMethod : xMethods)
-        {
-            OUString aMethodName = xMethod->getName();
-
-            lclAppendNodeToParent(pTree, rParent, new 
SimpleStringNode(aMethodName));
-        }
-    }
-
-    std::vector<std::pair<sal_Int32, OUString>> getColumnValues() override
-    {
-        return std::vector<std::pair<sal_Int32, OUString>>();
-    }
+                      const weld::TreeIter* pParent) override;
 };
 
 class StructNode : public BasicValueNode
@@ -466,7 +343,7 @@ public:
     bool shouldShowExpander() override { return true; }
 
     void fillChildren(std::unique_ptr<weld::TreeView>& pTree,
-                      weld::TreeIter const& rParent) override;
+                      const weld::TreeIter* pParent) override;
 };
 
 class SequenceNode : public BasicValueNode
@@ -481,7 +358,7 @@ public:
     bool shouldShowExpander() override { return true; }
 
     void fillChildren(std::unique_ptr<weld::TreeView>& pTree,
-                      weld::TreeIter const& rParent) override
+                      const weld::TreeIter* pParent) override
     {
         auto xReflection = reflection::theCoreReflection::get(mxContext);
         uno::Reference<reflection::XIdlClass> xClass
@@ -497,7 +374,7 @@ public:
 
             auto* pObjectInspectorNode = 
createNodeObjectForAny(OUString::number(i), aArrayValue);
             if (pObjectInspectorNode)
-                lclAppendNodeToParent(pTree, rParent, pObjectInspectorNode);
+                lclAppendNodeToParent(pTree, pParent, pObjectInspectorNode);
         }
     }
 
@@ -521,7 +398,7 @@ public:
 };
 
 void GenericPropertiesNode::fillChildren(std::unique_ptr<weld::TreeView>& 
pTree,
-                                         weld::TreeIter const& rParent)
+                                         const weld::TreeIter* pParent)
 {
     if (!maAny.hasValue())
         return;
@@ -553,11 +430,11 @@ void 
GenericPropertiesNode::fillChildren(std::unique_ptr<weld::TreeView>& pTree,
 
         auto* pObjectInspectorNode = createNodeObjectForAny(xProperty.Name, 
aCurrentAny);
         if (pObjectInspectorNode)
-            lclAppendNodeToParent(pTree, rParent, pObjectInspectorNode);
+            lclAppendNodeToParent(pTree, pParent, pObjectInspectorNode);
     }
 }
 
-void StructNode::fillChildren(std::unique_ptr<weld::TreeView>& pTree, 
weld::TreeIter const& rParent)
+void StructNode::fillChildren(std::unique_ptr<weld::TreeView>& pTree, const 
weld::TreeIter* pParent)
 {
     auto xReflection = reflection::theCoreReflection::get(mxContext);
     uno::Reference<reflection::XIdlClass> xClass
@@ -572,7 +449,9 @@ void 
StructNode::fillChildren(std::unique_ptr<weld::TreeView>& pTree, weld::Tree
 
         auto* pObjectInspectorNode = createNodeObjectForAny(aFieldName, 
aFieldValue);
         if (pObjectInspectorNode)
-            lclAppendNodeToParent(pTree, rParent, pObjectInspectorNode);
+        {
+            lclAppendNodeToParent(pTree, pParent, pObjectInspectorNode);
+        }
     }
 }
 
@@ -603,50 +482,155 @@ ObjectInspectorNodeInterface* 
BasicValueNode::createNodeObjectForAny(OUString co
 } // end anonymous namespace
 
 ObjectInspectorTreeHandler::ObjectInspectorTreeHandler(
-    std::unique_ptr<weld::TreeView>& pObjectInspectorTree,
+    std::unique_ptr<weld::TreeView>& pInterfacesTreeView,
+    std::unique_ptr<weld::TreeView>& pServicesTreeView,
+    std::unique_ptr<weld::TreeView>& pPropertiesTreeView,
+    std::unique_ptr<weld::TreeView>& pMethodsTreeView,
     std::unique_ptr<weld::Label>& pClassNameLabel)
-    : mpObjectInspectorTree(pObjectInspectorTree)
+    : mpInterfacesTreeView(pInterfacesTreeView)
+    , mpServicesTreeView(pServicesTreeView)
+    , mpPropertiesTreeView(pPropertiesTreeView)
+    , mpMethodsTreeView(pMethodsTreeView)
     , mpClassNameLabel(pClassNameLabel)
 {
-    mpObjectInspectorTree->connect_expanding(
-        LINK(this, ObjectInspectorTreeHandler, ExpandingHandler));
+    mpInterfacesTreeView->connect_expanding(
+        LINK(this, ObjectInspectorTreeHandler, ExpandingHandlerInterfaces));
+    mpServicesTreeView->connect_expanding(
+        LINK(this, ObjectInspectorTreeHandler, ExpandingHandlerServices));
+    mpPropertiesTreeView->connect_expanding(
+        LINK(this, ObjectInspectorTreeHandler, ExpandingHandlerProperties));
+    mpMethodsTreeView->connect_expanding(
+        LINK(this, ObjectInspectorTreeHandler, ExpandingHandlerMethods));
 }
 
-IMPL_LINK(ObjectInspectorTreeHandler, ExpandingHandler, weld::TreeIter const&, 
rParent, bool)
+void 
ObjectInspectorTreeHandler::handleExpanding(std::unique_ptr<weld::TreeView>& 
pTreeView,
+                                                 weld::TreeIter const& rParent)
 {
-    OUString sID = mpObjectInspectorTree->get_id(rParent);
+    OUString sID = pTreeView->get_id(rParent);
     if (sID.isEmpty())
-        return true;
+        return;
 
-    clearObjectInspectorChildren(rParent);
+    clearObjectInspectorChildren(pTreeView, rParent);
     auto* pNode = 
reinterpret_cast<ObjectInspectorNodeInterface*>(sID.toInt64());
-    pNode->fillChildren(mpObjectInspectorTree, rParent);
+    pNode->fillChildren(pTreeView, &rParent);
+}
 
+IMPL_LINK(ObjectInspectorTreeHandler, ExpandingHandlerInterfaces, 
weld::TreeIter const&, rParent,
+          bool)
+{
+    handleExpanding(mpInterfacesTreeView, rParent);
     return true;
 }
 
-void ObjectInspectorTreeHandler::clearObjectInspectorChildren(weld::TreeIter 
const& rParent)
+IMPL_LINK(ObjectInspectorTreeHandler, ExpandingHandlerServices, weld::TreeIter 
const&, rParent,
+          bool)
+{
+    handleExpanding(mpServicesTreeView, rParent);
+    return true;
+}
+
+IMPL_LINK(ObjectInspectorTreeHandler, ExpandingHandlerProperties, 
weld::TreeIter const&, rParent,
+          bool)
+{
+    handleExpanding(mpPropertiesTreeView, rParent);
+    return true;
+}
+
+IMPL_LINK(ObjectInspectorTreeHandler, ExpandingHandlerMethods, weld::TreeIter 
const&, rParent, bool)
+{
+    handleExpanding(mpMethodsTreeView, rParent);
+    return true;
+}
+
+void ObjectInspectorTreeHandler::clearObjectInspectorChildren(
+    std::unique_ptr<weld::TreeView>& pTreeView, weld::TreeIter const& rParent)
 {
     bool bChild = false;
     do
     {
-        bChild = mpObjectInspectorTree->iter_has_child(rParent);
+        bChild = pTreeView->iter_has_child(rParent);
         if (bChild)
         {
-            std::unique_ptr<weld::TreeIter> pChild = 
mpObjectInspectorTree->make_iterator(&rParent);
-            bChild = mpObjectInspectorTree->iter_children(*pChild);
+            std::unique_ptr<weld::TreeIter> pChild = 
pTreeView->make_iterator(&rParent);
+            bChild = pTreeView->iter_children(*pChild);
             if (bChild)
             {
-                clearObjectInspectorChildren(*pChild);
-                OUString sID = mpObjectInspectorTree->get_id(*pChild);
+                clearObjectInspectorChildren(pTreeView, *pChild);
+                OUString sID = pTreeView->get_id(*pChild);
                 auto* pEntry = 
reinterpret_cast<ObjectInspectorNodeInterface*>(sID.toInt64());
                 delete pEntry;
-                mpObjectInspectorTree->remove(*pChild);
+                pTreeView->remove(*pChild);
             }
         }
     } while (bChild);
 }
 
+void ObjectInspectorTreeHandler::clearAll(std::unique_ptr<weld::TreeView>& 
pTreeView)
+{
+    // destroy all ObjectInspectorNodes from the tree
+    pTreeView->all_foreach([&pTreeView](weld::TreeIter& rEntry) {
+        OUString sID = pTreeView->get_id(rEntry);
+        auto* pEntry = 
reinterpret_cast<ObjectInspectorNodeInterface*>(sID.toInt64());
+        delete pEntry;
+        return false;
+    });
+    pTreeView->clear();
+}
+
+void 
ObjectInspectorTreeHandler::appendInterfaces(uno::Reference<uno::XInterface> 
const& xInterface)
+{
+    if (!xInterface.is())
+        return;
+    uno::Reference<lang::XTypeProvider> xTypeProvider(xInterface, 
uno::UNO_QUERY);
+    if (xTypeProvider.is())
+    {
+        const auto xSequenceTypes = xTypeProvider->getTypes();
+        for (auto const& xType : xSequenceTypes)
+        {
+            OUString aName = xType.getTypeName();
+            lclAppendNode(mpInterfacesTreeView, new SimpleStringNode(aName));
+        }
+    }
+}
+
+void 
ObjectInspectorTreeHandler::appendServices(uno::Reference<uno::XInterface> 
const& xInterface)
+{
+    if (!xInterface.is())
+        return;
+
+    auto xServiceInfo = uno::Reference<lang::XServiceInfo>(xInterface, 
uno::UNO_QUERY);
+    const uno::Sequence<OUString> 
aServiceNames(xServiceInfo->getSupportedServiceNames());
+    for (auto const& aServiceName : aServiceNames)
+    {
+        lclAppendNode(mpServicesTreeView, new SimpleStringNode(aServiceName));
+    }
+}
+
+void 
ObjectInspectorTreeHandler::appendProperties(uno::Reference<uno::XInterface> 
const& xInterface)
+{
+    if (!xInterface.is())
+        return;
+    GenericPropertiesNode aNode("", uno::Any(xInterface), 
comphelper::getProcessComponentContext());
+    aNode.fillChildren(mpPropertiesTreeView, nullptr);
+}
+
+void ObjectInspectorTreeHandler::appendMethods(uno::Reference<uno::XInterface> 
const& xInterface)
+{
+    if (!xInterface.is())
+        return;
+
+    uno::Reference<beans::XIntrospection> xIntrospection
+        = 
beans::theIntrospection::get(comphelper::getProcessComponentContext());
+    auto xIntrospectionAccess = xIntrospection->inspect(uno::Any(xInterface));
+
+    const auto xMethods = 
xIntrospectionAccess->getMethods(beans::MethodConcept::ALL);
+    for (auto const& xMethod : xMethods)
+    {
+        OUString aMethodName = xMethod->getName();
+        lclAppendNode(mpMethodsTreeView, new SimpleStringNode(aMethodName));
+    }
+}
+
 void ObjectInspectorTreeHandler::introspect(uno::Reference<uno::XInterface> 
const& xInterface)
 {
     if (!xInterface.is())
@@ -662,26 +646,33 @@ void 
ObjectInspectorTreeHandler::introspect(uno::Reference<uno::XInterface> cons
     mpClassNameLabel->set_label(aImplementationName);
 
     // fill object inspector
-    mpObjectInspectorTree->freeze();
-    mpObjectInspectorTree->clear();
-
-    lclAppendNode(mpObjectInspectorTree, new ServicesNode(xInterface, 
xContext));
-    lclAppendNode(mpObjectInspectorTree, new InterfacesNode(xInterface, 
xContext));
-    lclAppendNode(mpObjectInspectorTree, new PropertiesNode(xInterface, 
xContext));
-    lclAppendNode(mpObjectInspectorTree, new MethodsNode(xInterface, 
xContext));
-
-    mpObjectInspectorTree->thaw();
+    mpInterfacesTreeView->freeze();
+    clearAll(mpInterfacesTreeView);
+    appendInterfaces(xInterface);
+    mpInterfacesTreeView->thaw();
+
+    mpServicesTreeView->freeze();
+    clearAll(mpServicesTreeView);
+    appendServices(xInterface);
+    mpServicesTreeView->thaw();
+
+    mpPropertiesTreeView->freeze();
+    clearAll(mpPropertiesTreeView);
+    appendProperties(xInterface);
+    mpPropertiesTreeView->thaw();
+
+    mpMethodsTreeView->freeze();
+    clearAll(mpMethodsTreeView);
+    appendMethods(xInterface);
+    mpMethodsTreeView->thaw();
 }
 
 void ObjectInspectorTreeHandler::dispose()
 {
-    // destroy all ObjectInspectorNodes from the tree
-    mpObjectInspectorTree->all_foreach([this](weld::TreeIter& rEntry) {
-        OUString sID = mpObjectInspectorTree->get_id(rEntry);
-        auto* pEntry = 
reinterpret_cast<ObjectInspectorNodeInterface*>(sID.toInt64());
-        delete pEntry;
-        return false;
-    });
+    clearAll(mpInterfacesTreeView);
+    clearAll(mpServicesTreeView);
+    clearAll(mpPropertiesTreeView);
+    clearAll(mpMethodsTreeView);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/uiconfig/ui/developmenttool.ui 
b/sfx2/uiconfig/ui/developmenttool.ui
index d65542b00167..32423886558c 100644
--- a/sfx2/uiconfig/ui/developmenttool.ui
+++ b/sfx2/uiconfig/ui/developmenttool.ui
@@ -10,7 +10,43 @@
       <column type="gchararray"/>
     </columns>
   </object>
-  <object class="GtkTreeStore" id="object_inspector_liststore">
+  <object class="GtkTreeStore" id="object_inspector_interfaces_liststore">
+    <columns>
+      <!-- column-name text -->
+      <column type="gchararray"/>
+      <!-- column-name value -->
+      <column type="gchararray"/>
+      <!-- column-name type -->
+      <column type="gchararray"/>
+      <!-- column-name id -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkTreeStore" id="object_inspector_methods_liststore">
+    <columns>
+      <!-- column-name text -->
+      <column type="gchararray"/>
+      <!-- column-name value -->
+      <column type="gchararray"/>
+      <!-- column-name type -->
+      <column type="gchararray"/>
+      <!-- column-name id -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkTreeStore" id="object_inspector_properties_liststore">
+    <columns>
+      <!-- column-name text -->
+      <column type="gchararray"/>
+      <!-- column-name value -->
+      <column type="gchararray"/>
+      <!-- column-name type -->
+      <column type="gchararray"/>
+      <!-- column-name id -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkTreeStore" id="object_inspector_services_liststore">
     <columns>
       <!-- column-name text -->
       <column type="gchararray"/>
@@ -147,62 +183,302 @@
               </packing>
             </child>
             <child>
-              <object class="GtkScrolledWindow">
+              <object class="GtkNotebook">
                 <property name="visible">True</property>
                 <property name="can-focus">True</property>
                 <property name="hexpand">True</property>
                 <property name="vexpand">True</property>
-                <property name="shadow-type">in</property>
                 <child>
-                  <object class="GtkTreeView" id="class_listbox_id">
+                  <object class="GtkScrolledWindow">
                     <property name="visible">True</property>
                     <property name="can-focus">True</property>
-                    <property name="receives-default">True</property>
                     <property name="hexpand">True</property>
                     <property name="vexpand">True</property>
-                    <property 
name="model">object_inspector_liststore</property>
-                    <property name="search-column">0</property>
-                    <property name="enable-tree-lines">True</property>
-                    <child internal-child="selection">
-                      <object class="GtkTreeSelection"/>
+                    <property name="shadow-type">in</property>
+                    <child>
+                      <object class="GtkTreeView" id="interfaces_treeview_id">
+                        <property name="visible">True</property>
+                        <property name="can-focus">True</property>
+                        <property name="receives-default">True</property>
+                        <property name="hexpand">True</property>
+                        <property name="vexpand">True</property>
+                        <property 
name="model">object_inspector_interfaces_liststore</property>
+                        <property name="search-column">0</property>
+                        <property name="enable-tree-lines">True</property>
+                        <child internal-child="selection">
+                          <object class="GtkTreeSelection"/>
+                        </child>
+                        <child>
+                          <object class="GtkTreeViewColumn" 
id="treeviewcolumn4">
+                            <property name="resizable">True</property>
+                            <property name="title" translatable="yes" 
context="developmenttool|object">Object</property>
+                            <child>
+                              <object class="GtkCellRendererText" 
id="obj_insp_cellrenderertext4"/>
+                              <attributes>
+                                <attribute name="text">0</attribute>
+                              </attributes>
+                            </child>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkTreeViewColumn" 
id="treeviewcolumn5">
+                            <property name="resizable">True</property>
+                            <property name="title" translatable="yes" 
context="developmenttool|value">Value</property>
+                            <child>
+                              <object class="GtkCellRendererText" 
id="obj_insp_cellrenderertext5"/>
+                              <attributes>
+                                <attribute name="text">1</attribute>
+                              </attributes>
+                            </child>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkTreeViewColumn" 
id="treeviewcolumn6">
+                            <property name="resizable">True</property>
+                            <property name="title" translatable="yes" 
context="developmenttool|type">Type</property>
+                            <child>
+                              <object class="GtkCellRendererText" 
id="obj_insp_cellrenderertext6"/>
+                              <attributes>
+                                <attribute name="text">2</attribute>
+                              </attributes>
+                            </child>
+                          </object>
+                        </child>
+                      </object>
                     </child>
+                  </object>
+                </child>
+                <child type="tab">
+                  <object class="GtkLabel">
+                    <property name="visible">True</property>
+                    <property name="can-focus">False</property>
+                    <property name="label" translatable="yes" 
context="developmenttool|interfaces">Interfaces</property>
+                  </object>
+                  <packing>
+                    <property name="tab-fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkScrolledWindow">
+                    <property name="visible">True</property>
+                    <property name="can-focus">True</property>
+                    <property name="hexpand">True</property>
+                    <property name="vexpand">True</property>
+                    <property name="shadow-type">in</property>
                     <child>
-                      <object class="GtkTreeViewColumn" id="treeviewcolumn1">
-                        <property name="resizable">True</property>
-                        <property name="title" translatable="yes" 
context="developmenttool|object">Object</property>
+                      <object class="GtkTreeView" id="services_treeview_id">
+                        <property name="visible">True</property>
+                        <property name="can-focus">True</property>
+                        <property name="receives-default">True</property>
+                        <property name="hexpand">True</property>
+                        <property name="vexpand">True</property>
+                        <property 
name="model">object_inspector_services_liststore</property>
+                        <property name="search-column">0</property>
+                        <property name="enable-tree-lines">True</property>
+                        <child internal-child="selection">
+                          <object class="GtkTreeSelection"/>
+                        </child>
                         <child>
-                          <object class="GtkCellRendererText" 
id="obj_insp_cellrenderertext1"/>
-                          <attributes>
-                            <attribute name="text">0</attribute>
-                          </attributes>
+                          <object class="GtkTreeViewColumn" 
id="treeviewcolumn7">
+                            <property name="resizable">True</property>
+                            <property name="title" translatable="yes" 
context="developmenttool|object">Object</property>
+                            <child>
+                              <object class="GtkCellRendererText" 
id="obj_insp_cellrenderertext7"/>
+                              <attributes>
+                                <attribute name="text">0</attribute>
+                              </attributes>
+                            </child>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkTreeViewColumn" 
id="treeviewcolumn8">
+                            <property name="resizable">True</property>
+                            <property name="title" translatable="yes" 
context="developmenttool|value">Value</property>
+                            <child>
+                              <object class="GtkCellRendererText" 
id="obj_insp_cellrenderertext8"/>
+                              <attributes>
+                                <attribute name="text">1</attribute>
+                              </attributes>
+                            </child>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkTreeViewColumn" 
id="treeviewcolumn9">
+                            <property name="resizable">True</property>
+                            <property name="title" translatable="yes" 
context="developmenttool|type">Type</property>
+                            <child>
+                              <object class="GtkCellRendererText" 
id="obj_insp_cellrenderertext9"/>
+                              <attributes>
+                                <attribute name="text">2</attribute>
+                              </attributes>
+                            </child>
+                          </object>
                         </child>
                       </object>
                     </child>
+                  </object>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child type="tab">
+                  <object class="GtkLabel">
+                    <property name="visible">True</property>
+                    <property name="can-focus">False</property>
+                    <property name="label" translatable="yes" 
context="developmenttool|services">Services</property>
+                  </object>
+                  <packing>
+                    <property name="position">1</property>
+                    <property name="tab-fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkScrolledWindow">
+                    <property name="visible">True</property>
+                    <property name="can-focus">True</property>
+                    <property name="hexpand">True</property>
+                    <property name="vexpand">True</property>
+                    <property name="shadow-type">in</property>
                     <child>
-                      <object class="GtkTreeViewColumn" id="treeviewcolumn2">
-                        <property name="resizable">True</property>
-                        <property name="title" translatable="yes" 
context="developmenttool|value">Value</property>
+                      <object class="GtkTreeView" id="properties_treeview_id">
+                        <property name="visible">True</property>
+                        <property name="can-focus">True</property>
+                        <property name="receives-default">True</property>
+                        <property name="hexpand">True</property>
+                        <property name="vexpand">True</property>
+                        <property 
name="model">object_inspector_properties_liststore</property>
+                        <property name="search-column">0</property>
+                        <property name="enable-tree-lines">True</property>
+                        <child internal-child="selection">
+                          <object class="GtkTreeSelection"/>
+                        </child>
                         <child>
-                          <object class="GtkCellRendererText" 
id="obj_insp_cellrenderertext2"/>
-                          <attributes>
-                            <attribute name="text">1</attribute>
-                          </attributes>
+                          <object class="GtkTreeViewColumn" 
id="treeviewcolumn1">
+                            <property name="resizable">True</property>
+                            <property name="title" translatable="yes" 
context="developmenttool|object">Object</property>
+                            <child>
+                              <object class="GtkCellRendererText" 
id="obj_insp_cellrenderertext1"/>
+                              <attributes>
+                                <attribute name="text">0</attribute>
+                              </attributes>
+                            </child>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkTreeViewColumn" 
id="treeviewcolumn2">
+                            <property name="resizable">True</property>
+                            <property name="title" translatable="yes" 
context="developmenttool|value">Value</property>
+                            <child>
+                              <object class="GtkCellRendererText" 
id="obj_insp_cellrenderertext2"/>
+                              <attributes>
+                                <attribute name="text">1</attribute>
+                              </attributes>
+                            </child>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkTreeViewColumn" 
id="treeviewcolumn3">
+                            <property name="resizable">True</property>
+                            <property name="title" translatable="yes" 
context="developmenttool|type">Type</property>
+                            <child>
+                              <object class="GtkCellRendererText" 
id="obj_insp_cellrenderertext3"/>
+                              <attributes>
+                                <attribute name="text">2</attribute>
+                              </attributes>
+                            </child>
+                          </object>
                         </child>
                       </object>
                     </child>
+                  </object>
+                  <packing>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
+                <child type="tab">
+                  <object class="GtkLabel">
+                    <property name="visible">True</property>
+                    <property name="can-focus">False</property>
+                    <property name="label" translatable="yes" 
context="developmenttool|properties">Properties</property>
+                  </object>
+                  <packing>
+                    <property name="position">2</property>
+                    <property name="tab-fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkScrolledWindow">
+                    <property name="visible">True</property>
+                    <property name="can-focus">True</property>
+                    <property name="hexpand">True</property>
+                    <property name="vexpand">True</property>
+                    <property name="shadow-type">in</property>
                     <child>
-                      <object class="GtkTreeViewColumn" id="treeviewcolumn3">
-                        <property name="resizable">True</property>
-                        <property name="title" translatable="yes" 
context="developmenttool|type">Type</property>
+                      <object class="GtkTreeView" id="methods_treeview_id">
+                        <property name="visible">True</property>
+                        <property name="can-focus">True</property>
+                        <property name="receives-default">True</property>
+                        <property name="hexpand">True</property>
+                        <property name="vexpand">True</property>
+                        <property 
name="model">object_inspector_methods_liststore</property>
+                        <property name="search-column">0</property>
+                        <property name="enable-tree-lines">True</property>
+                        <child internal-child="selection">
+                          <object class="GtkTreeSelection"/>
+                        </child>
                         <child>
-                          <object class="GtkCellRendererText" 
id="obj_insp_cellrenderertext3"/>
-                          <attributes>
-                            <attribute name="text">2</attribute>
-                          </attributes>
+                          <object class="GtkTreeViewColumn" 
id="treeviewcolumn10">
+                            <property name="resizable">True</property>
+                            <property name="title" translatable="yes" 
context="developmenttool|object">Object</property>
+                            <child>
+                              <object class="GtkCellRendererText" 
id="obj_insp_cellrenderertext10"/>
+                              <attributes>
+                                <attribute name="text">0</attribute>
+                              </attributes>
+                            </child>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkTreeViewColumn" 
id="treeviewcolumn11">
+                            <property name="resizable">True</property>
+                            <property name="title" translatable="yes" 
context="developmenttool|value">Value</property>
+                            <child>
+                              <object class="GtkCellRendererText" 
id="obj_insp_cellrenderertext11"/>
+                              <attributes>
+                                <attribute name="text">1</attribute>
+                              </attributes>
+                            </child>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkTreeViewColumn" 
id="treeviewcolumn12">
+                            <property name="resizable">True</property>
+                            <property name="title" translatable="yes" 
context="developmenttool|type">Type</property>
+                            <child>
+                              <object class="GtkCellRendererText" 
id="obj_insp_cellrenderertext12"/>
+                              <attributes>
+                                <attribute name="text">2</attribute>
+                              </attributes>
+                            </child>
+                          </object>
                         </child>
                       </object>
                     </child>
                   </object>
+                  <packing>
+                    <property name="position">3</property>
+                  </packing>
+                </child>
+                <child type="tab">
+                  <object class="GtkLabel">
+                    <property name="visible">True</property>
+                    <property name="can-focus">False</property>
+                    <property name="label" translatable="yes" 
context="developmenttool|methods">Methods</property>
+                  </object>
+                  <packing>
+                    <property name="position">3</property>
+                    <property name="tab-fill">False</property>
+                  </packing>
                 </child>
               </object>
               <packing>
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to