当前位置: 首页>>代码示例>>Java>>正文


Java UIDetachedException类代码示例

本文整理汇总了Java中com.vaadin.ui.UIDetachedException的典型用法代码示例。如果您正苦于以下问题:Java UIDetachedException类的具体用法?Java UIDetachedException怎么用?Java UIDetachedException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UIDetachedException类属于com.vaadin.ui包,在下文中一共展示了UIDetachedException类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateUI

import com.vaadin.ui.UIDetachedException; //导入依赖的package包/类
/**
 * Thread safe UI updates
 * 
 * Execute UI changes in a runnable after attaining the applications's lock.
 * Runnable won't be run, if the view isn't anymore active. 
 * 
 * Make sure this method won't get called before the UI is ready. In 
 * practice the easiest way to ensure this is to start data queries only 
 * after the UI is initialized and visible.
 * 
 * @param runnable
 */
public void updateUI(Runnable runnable) {
	
	try {
		ui.access(runnable);
		
		// this is needed, because the ChipsterAdminUI is configured
		// for manual push
		ui.accessSynchronously(new Runnable() {
			public void run() {
				ui.push();			
			}
		});
	} catch (UIDetachedException e) {
		// user reloaded the page during the update
	}		
}
 
开发者ID:chipster,项目名称:chipster,代码行数:29,代码来源:AsynchronousView.java

示例2: configError

import com.vaadin.ui.UIDetachedException; //导入依赖的package包/类
/**
 * Configure la gestion des erreurs
 */
private void configError(){
	/* Log les erreurs non gerees */
	VaadinSession.getCurrent().setErrorHandler(e -> {
		Throwable cause = e.getThrowable();
		while (cause instanceof Throwable) {
			/* Gère les accès non autorisés */
			if (cause instanceof AccessDeniedException) {
				navigateToView(ErreurView.NAME);
				return;
			}
			/* Gère les UIs détachées pour les utilisateurs déconnectés */
			if (cause instanceof AuthenticationCredentialsNotFoundException || cause instanceof UIDetachedException 
				|| cause instanceof UploadException || cause instanceof IllegalStateException
				|| cause instanceof SocketTimeoutException
				|| MethodUtils.checkCause(cause,"SocketTimeoutException")
				|| MethodUtils.checkCause(cause,"ClientAbortException")					
				|| cause instanceof EOFException
				|| cause instanceof URISyntaxException
				|| cause instanceof UIException) {
				sendError();
				cause.printStackTrace();
				return;
			}
			if (MethodUtils.checkCauseByStackTrace(cause,"FileUploadHandler", 0)
				||
				MethodUtils.checkCauseByStackTrace(cause,"OnDemandPdfBrowserOpener", 1)
				||
				MethodUtils.checkCauseByStackTrace(cause,"DownloadStream", 3)
				||
				MethodUtils.checkCauseByStackTrace(cause,"AtmosphereRequest", 7)
				||
				MethodUtils.checkCauseByStackTrace(cause,"AbstractTextField", 0)
				||
				MethodUtils.checkCauseByStackTrace(cause,"SocketChannelImpl", 4)
				|| 
				MethodUtils.checkCauseEmpty(cause)
				){
					sendError();
					cause.printStackTrace();
					return;
			}				
			cause = cause.getCause();
		}
		sendError();
		logger.error("Erreur inconnue", e.getThrowable());
	});
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:51,代码来源:MainUI.java


注:本文中的com.vaadin.ui.UIDetachedException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。