/** * Shows/hides loading indicator. * * @param show True to show the indicator, false to hide */ public void showLoading(boolean show) { if (show && Display.getInstance().getCurrent() != loadingForm && (loadingAccount || loadingGuides)) { loadingForm.show(); loadingComp.startSpin(); revalidate(); } else if (!show) { loadingComp.stopSpin(); this.show(); revalidate(); } }
/** * Show/hide loading component. * * @param show If true, the component is shown, otherwise hidden */ public void showLoading(boolean show) { if (show) { if (!this.contains(loadingComp)) { addComponent(loadingComp); loadingComp.startSpin(); repaint(); } } else { if (this.contains(loadingComp)) { loadingComp.stopSpin(); removeComponent(loadingComp); } } }