示例#1
0
 /**
  * Processes an AU request.
  *
  * <p>Default: in addition to what are handled by {@link XulElement#service}, it also handles
  * onOpen.
  *
  * @since 5.0.0
  */
 public void service(org.zkoss.zk.au.AuRequest request, boolean everError) {
   final String cmd = request.getCommand();
   if (cmd.equals(Events.ON_OPEN)) {
     OpenEvent evt = OpenEvent.getOpenEvent(request);
     setVisible(evt.isOpen());
     Events.postEvent(evt);
   } else if (cmd.equals(Events.ON_MAXIMIZE)) {
     MaximizeEvent evt = MaximizeEvent.getMaximizeEvent(request);
     setLeftDirectly(evt.getLeft());
     setTopDirectly(evt.getTop());
     setWidthDirectly(evt.getWidth());
     setHeightDirectly(evt.getHeight());
     _maximized = evt.isMaximized();
     if (_maximized) setVisibleDirectly(true);
     Events.postEvent(evt);
   } else if (cmd.equals(Events.ON_MINIMIZE)) {
     MinimizeEvent evt = MinimizeEvent.getMinimizeEvent(request);
     setLeftDirectly(evt.getLeft());
     setTopDirectly(evt.getTop());
     setWidthDirectly(evt.getWidth());
     setHeightDirectly(evt.getHeight());
     _minimized = evt.isMinimized();
     if (_minimized) {
       setVisibleDirectly(false);
       if (_mode == MODAL) leaveModal(OVERLAPPED);
     }
     Events.postEvent(evt);
   } else super.service(request, everError);
 }
示例#2
0
 private boolean setVisible0(boolean visible) {
   if (!visible && _mode == MODAL) {
     // Hide first to avoid unpleasant effect
     super.setVisible(false);
     leaveModal(OVERLAPPED);
     return true;
   }
   return super.setVisible(visible);
 }
示例#3
0
 /* Set non-modal mode. */
 private void setNonModalMode(int mode) {
   if (_mode != mode) {
     if (_mode == MODAL) leaveModal(mode);
     else {
       _mode = mode;
       smartUpdate("mode", modeToString(_mode));
     }
   }
   setVisible(true);
 }
示例#4
0
 public void onPageDetached(Page page) {
   if (_mode == MODAL && getPage() == null) leaveModal(OVERLAPPED);
 }