How to use of One of the Method in "ThisComponent" -> ThisComponent.setCurrentController()?

Hi Friends,
How to Use One of the Method ThisComponent.setCurrentController() in LibreOffice Calc Which is Found in the website ?
http://itref.fc2web.com/openoffice/api/ThisComponent.html

Screen Shots

image

You refer to a random website. Someone decided to “document” “methods of ThisComponent”, but that is a wrong approach.

ThisComponent represents what it looks like: the current component - and that component would be different, depending on what is current. And its methods would be different in each case.

And the correct method description is on the official API site. E.g., for setCurrentController.

1 Like

So, What is the Use of setCurrentController and How to use that one

When several controllers are attached to the model, you call this method to set one of them active.

1 Like

any Example Please

Here’s complex example from @hanya , but I’m not ready to comment on it.

1 Like

Here is an example.
When you open Writer (which itself calls setCurrentController), and later use Window → New Window, this eventually calls SfxFrameLoader_Impl::impl_createDocumentView; that one calls ConnectFrameControllerModel; which in turn calls ConnectModelController; and finally, there setCurrentController is called, which makes the newly created controller (connecting the model to the new frame) the active one.

1 Like