/** * Do not call this method manually. It will be automatically called in a separate thread by a * TPTApplication instance. */ public void run() { try { activateLoadedView(loader.lazyLoad(this)); } catch (Throwable err) { activateErrorView(err); } }
protected void activateLoadingView() { removeAllComponents(); // This is workaround to ticket #14 at googlecode: // http://code.google.com/p/tpt/issues/detail?id=14 progressBar = new ProgressIndicator(); // ======== TPTSizer sz1 = new TPTSizer(null, "50%"); TPTSizer sz2 = new TPTSizer(null, "50%"); addComponent(sz1); final String message = loader.getLazyLoadingMessage(); loadingLabel.setValue( (message != null && !message.isEmpty()) ? message : getDefaultLoadingMessage()); addComponent(loadingLabel); addComponent(progressBar); addComponent(sz2); setComponentAlignment(loadingLabel, Alignment.MIDDLE_CENTER); setComponentAlignment(progressBar, Alignment.MIDDLE_CENTER); setExpandRatio(sz1, 0.5f); setExpandRatio(sz2, 0.5f); }