TabSheet with ProgressIndicator

How to realize display of the indicator of performance long- time operations at switching between bookmarks?

For example, at me on the first bookmark it is opened many windows which at transition to other bookmark disappear () and are shown new, created for chosen at present. Between two these events passes time depending on total number of windows - and sometimes it is necessary to wait long enough while all windows will come to the necessary conditions.

It would be desirable to notify the user, for example, “Wait, there is a loading of the data”

The first of what I have thought - this modal window with ProgressIndicator, opened at tab change event and closed when all necessary content will be loaded. I will try to make so though it would be desirable as Vaadin sampler - replacing colors progress indicator in the left corner of a window.

Has written a class - ModalProgressIndicator, there has placed ProgressIndicator class, however the window isn’t displayed, though if comment
that it is possible to see it.

ModalProgressIndicator modalProgressIndicator = new ModalProgressIndicator(); 

// some time- long actions


In what there can be a problem?

Notification n = new Notification("Loading data...");

Where delay in generaly = f(

Any ideas?