Package org.zkoss.zk.ui.event

Examples of org.zkoss.zk.ui.event.EventQueue


          // notification with title + message + selfClosing
          map.put("title", "Zksample2 Notification");
          map.put("message", "<br>Hello i'm a notification based on ZK-Gritter.<br><br>Many thanks to gekkio for writting the implementation.");
          map.put("autoClosing", false);
          EventQueue eq;
          eq = EventQueues.lookup("ApplicationEventQueue", EventQueues.APPLICATION, false);
          eq.publish(new Event("APPLICATION_NOTIFICATION", null, map));

          // notification with title + message + image
          map = new HashMap<String, Object>(0);
          map.put("title", "WOW !!!");
          map.put("message",
              "The notifications can hold a little image.<br><br> You can close me by clicking the 'x' in the left top corner shown when mouse is over.<br><br>Further you can stop/start the notifications with the checkbox <br>EN: 'stop notifications' <br>DE: 'Stoppe Benachrichtigungen'<br> on top right of the application.");
          map.put("autoClosing", true);
          map.put("image", "/images/sge.jpg");
          // EventQueues.lookup("ApplicationEventQueue",
          // EventQueues.APPLICATION, true).publish(new
          // Event("APPLICATION_NOTIFICATION", null, map));
          eq.publish(new Event("APPLICATION_NOTIFICATION", null, map));

        }
      });
      this.timer.setRunning(true);
    }
View Full Code Here


  private void createApplicationMessageQueue() {

    if (!EventQueues.exists("ApplicationEventQueue", EventQueues.APPLICATION)) {

      // autoCreate EventQueue
      EventQueue eq = EventQueues.lookup("ApplicationEventQueue", EventQueues.APPLICATION, true);

      // listen
      eq.subscribe(new SerializableEventListener() {
        private static final long serialVersionUID = 1L;

        @SuppressWarnings("unchecked")
        public void onEvent(Event event) throws Exception {
          System.out.println("ApplicationEventQueue onEvent");

          if (event.getName().equals("APPLICATION_NOTIFICATION")) {
            Map<String, Object> map = (Map<String, Object>) event.getData();
            showNotification(map);
          }
        }
      });
    } else {
      // Get the EventQueue
      EventQueue eq = EventQueues.lookup("ApplicationEventQueue", EventQueues.APPLICATION, false);

      // NEW listen
      eq.subscribe(new SerializableEventListener() {
        private static final long serialVersionUID = 1L;

        @SuppressWarnings("unchecked")
        public void onEvent(Event event) throws Exception {
View Full Code Here

    _bookname = bookname;
    _sheets = new HashMap<String, RefSheet>(3);
    _variableRefs = new ConcurrentHashMap<String, Ref>(4);
    _maxrow = maxrow;
    _maxcol = maxcol;
    EventQueue tmp = null;
    try {
      tmp = EventQueues.lookup(bookname);
    } catch(IllegalStateException ex) {
      //ignore for zsstest case(No execution)
    }
View Full Code Here

    getEventQueue().unsubscribe(listener);
  }
 
  @Override
  public void publish(Event event) {
    final EventQueue que = getEventQueue();
    if (que != null) {
      que.publish(event);
    }
  }
View Full Code Here

TOP

Related Classes of org.zkoss.zk.ui.event.EventQueue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.