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


Java EventQueues类代码示例

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


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

示例1: subscribeEventQueues

import org.zkoss.zk.ui.event.EventQueues; //导入依赖的package包/类
private static List<SubscriptionInfo> subscribeEventQueues(final Object controller, final boolean rewire) {
	final List<SubscriptionInfo> subsInfo = new ArrayList<SubscriptionInfo>();
	Reflections.forMethods(controller.getClass(), Subscribe.class, 
			new MethodRunner<Subscribe>() {
		public void onMethod(Class<?> clazz, Method method, Subscribe anno) {
			// check method signature
			if ((method.getModifiers() & Modifier.STATIC) != 0) 
				throw new UiException("Cannot add forward to static method: " + 
						method.getName());

			EventQueue<Event> eq = EventQueues.lookup(anno.value(), anno.scope(), true);
			//zk - 1446, NotSerializableException when using @Subscribe
			SubscribeMethodEventListener l = new SubscribeMethodEventListener(method, controller, anno.eventName());
			if(!rewire || !eq.isSubscribed(l)){
				eq.subscribe(l);
				subsInfo.add(new SubscriptionInfo(anno.value(),anno.scope(),anno.autoUnsubscribe(),l));
			}
		}
	});
	return subsInfo.size() > 0 ? subsInfo : null;
}
 
开发者ID:beemsoft,项目名称:techytax-zk,代码行数:22,代码来源:SelectorsExt.java

示例2: afterComponentDetached

import org.zkoss.zk.ui.event.EventQueues; //导入依赖的package包/类
public void afterComponentDetached(Component comp, Page prevpage) {
	if(_self == comp || Components.isAncestor(comp, _self)){
		//remove queue
		if(_subsInfo!=null && _subsInfo.size()>0){
			for(SubscriptionInfo si:_subsInfo){
				if(!si.isAutoUnsubscribe()) continue;
				
				EventQueue<Event> eq = EventQueues.lookup(si.getQueueName(),si.getScope(),false);
				if(eq!=null){
					eq.unsubscribe(si.getListener());
				}
			}
		}
		prevpage.getDesktop().removeListener(this);
	}
}
 
开发者ID:beemsoft,项目名称:techytax-zk,代码行数:17,代码来源:SelectorsExt.java

示例3: apply

import org.zkoss.zk.ui.event.EventQueues; //导入依赖的package包/类
@Override
void apply(Spreadsheet ss) {
	String shareScope = ss.getBook().getShareScope();
	if (shareScope == null || shareScope.equals(EventQueues.DESKTOP)){
		for (int i=0 ; i < ss.getBook().getNumberOfSheets() ; i++){
			Ranges.range(ss.getBook().getSheetAt(i)).protectSheet("", 
					false, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
		}
	}else{
		/*
		 * When a book is shared, protecting sheets will affect other collaborators.
		 * Need to avoid editing at the component level.
		 */
		ss.addEventListener(Events.ON_START_EDITING, CANCEL_EDIT_LISTENER);
		ss.setAttribute(CTRL_KEY, ss.getCtrlKeys());
		ss.setCtrlKeys("");
	}
}
 
开发者ID:zkoss,项目名称:zssessentials,代码行数:19,代码来源:AuthorityService.java

示例4: clear

import org.zkoss.zk.ui.event.EventQueues; //导入依赖的package包/类
@Override
void clear(Spreadsheet ss) {
	String shareScope = ss.getBook().getShareScope();
	if (shareScope == null || shareScope.equals(EventQueues.DESKTOP)){
		for (int i=0 ; i < ss.getBook().getNumberOfSheets() ; i++){
			Ranges.range(ss.getBook().getSheetAt(i)).unprotectSheet("");
		}
	}else{
		/*
		 * When a book is shared, protecting sheets will affect other collaborators.
		 * Need to avoid editing at the component level.
		 */
		ss.removeEventListener(Events.ON_START_EDITING, CANCEL_EDIT_LISTENER);
		String ctrlKeys = (String)ss.getAttribute(CTRL_KEY);
		if (ctrlKeys!= null){
			ss.setCtrlKeys(ctrlKeys);
		}
	}
	
}
 
开发者ID:zkoss,项目名称:zssessentials,代码行数:21,代码来源:AuthorityService.java

示例5: lookupQueue

import org.zkoss.zk.ui.event.EventQueues; //导入依赖的package包/类
public static EventQueue<QueueMessage> lookupQueue() {
	EventQueue<QueueMessage> queue = EventQueues.lookup(QUEUE_NAME, EventQueues.DESKTOP, true);
	return queue;
}
 
开发者ID:beemsoft,项目名称:techytax-zk,代码行数:5,代码来源:QueueUtil.java


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