Close method in Window interface is deprecated - Why?

Hi,
I’m in the process of migrating some add-ons to CUBA 7, and I noticed (among other things) that the close() method in the Window interface is marked as @Deprecated.

On the other hand, the method is yet used in many predefined CUBA screens, and I can’t see any obvious reason (or documentation) around its deprecation. Even the official doc page about AbstractWindow does not mention the deprecation, and the close method is listed among the other methods like in the past versions (see: AbstractWindow - CUBA Platform. Developer’s Manual).

So is it a bug, or how are we supposed to self-close a window from within its controller? And please update the documentation accordingly, and add directions to the deprecated attribute itself.

Thanks for your support,
Paolo

Hi,

how are we supposed to self-close a window from within its controller?

    @Deprecated
    default boolean close(String actionId) {
        OperationResult result = getFrameOwner().close(new StandardCloseAction(actionId));
        return result.getStatus() == OperationResult.Status.SUCCESS;
    }

I think that default method implementation tells for itself. You should call com.haulmont.cuba.gui.screen.Screen#close method in order to close current screen.

On the other hand, the method is yet used in many predefined CUBA screens

CUBA predefined screens were intentionally not migrated to new Screen API to ensure that existing applications are not broken when being upgraded to CUBA 7.0

Even the official doc page about AbstractWindow does not mention the deprecation, and the close method is listed among the other methods like in the past versions

AbstractWindow is a part of Legacy Screen API. Legacy Screen API is not going to be deleted from the CUBA in the near future, therefore it was not deleted from the documentation:

image