com.sun.star.awt.XVclContainer deprecated interface

I found a piece of code which has to do with mouse motion listener. It works, but it utilizes a condition with reference to the aforementioned interface, which is marked as deprecated. If one were to update this code, what would be the proper approach in this case? Could I just simply use a com.sun.star.awt.XWindow in that code instead?

link to original code: Apache OpenOffice Community Forum - Apply XMouseMotionHandler to the sheet - (View topic)

Also, what is the procedure for deprecating certain features in scripting/programming language? Is there a certain amount of time that a deprecated feature still needs to function properly? What are the rules with respect to that aspect?

Quoting from the documentation (about MediaDescriptor properties):

Some properties are tagged deprecated. There are old implementations that still use these properties. They are supported, but their use is discouraged. Use the new property that can be found in the description column of the deprecated property.

As far as using the interface from the topic title (and the example), I think the XAccessibleContext interface (and related ones) gives us more options.

Thank you for your help. I’ve been going through the documentation that you mention, as well as the API reference. Yet, I could not find a clear answer to my original question.

I checked every interface that the ComponentWindow supports, but nothing has worked so far, including the one you mentioned, except for that deprecate interface. At least if that function is to stay the way it is.

I’ve been trying to wrap my head around the reason for the checking of the presence of XVclContainer interface and the subsequent recursion in that function. Upon further reading of the developer’s guide, the way I understand it, is that the main ComponentWindow, which is attached to the frame, holds many other subcomponents such as the menus, scroll bars, status bar, etc… And each of those are treated as windows, and have to have the mousemotionlistener engaged on an individual basis. I guess XVclContainer was/is the common ground for all those trivial and nontrivial subcomponents.

The question is if it’s even important to make that assessment? What else could there be within those subcomponents that would not comply with the listener assignment?

Or am I going too far with all this, and should I just let this function check against the depricated interface?