本文整理汇总了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;
}
示例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);
}
}
示例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("");
}
}
示例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);
}
}
}
示例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;
}