eu.livotov.tpt.gui.widgets
Interface TPTLazyLoadingLayout.LazyLoader

Enclosing class:
TPTLazyLoadingLayout

public static interface TPTLazyLoadingLayout.LazyLoader

Implement this interface in your long initialing component and move all lenghty stuff into the lazyLoad method, returning the fully initializing component at the end


Method Summary
 java.lang.String getLazyLoadingMessage()
          Provides an informational message, which is shown together with a progress indicator during the loading process.
 com.vaadin.ui.Component lazyLoad(TPTLazyLoadingLayout layout)
          Implement all your lenghty stuff here.
 

Method Detail

getLazyLoadingMessage

java.lang.String getLazyLoadingMessage()
Provides an informational message, which is shown together with a progress indicator during the loading process.

Returns:
message or null. If null is returned, the text label will not be shown.

lazyLoad

com.vaadin.ui.Component lazyLoad(TPTLazyLoadingLayout layout)
Implement all your lenghty stuff here. For instance, query database and fill up the UI fields with the actual data. This method will be invoked automatically in the separate server thread. In this method you feel free to use TPTApplication.getCurrentApplication() method to get an instance of your application, if needed. If you need to report any error and you do not want to handle it yourself - simply throw an exception. Its message (via getMessage() method) will be displayed automatically.

Parameters:
layout - instance of TPTLazyLoadingLayout. You can use this instance to update a progress status or customize any informational components on the fly.
Returns:
actual component, which will be shown instead of the progress indicator when loading process is finished.