/** Sets whether the source depends on the current Locale. */ public void setLocalized(boolean localized) { if (_localized != localized) { if (localized && "instant".equals(_mode)) throw new UnsupportedOperationException("localized not supported in instant mode yet"); _localized = localized; if (_localized) fixMode(); //becomes defer mode if auto if (!_instantMode) invalidate(); else super.invalidate(); //invalidate is redundant in instant mode, but less memory leak in IE } }
/** Sets the inclusion mode. * @param mode the inclusion mode: auto, instant or defer. * @since 3.6.2 */ public void setMode(String mode) throws WrongValueException { if (!_mode.equals(mode)) { if (!"auto".equals(mode) && !"instant".equals(mode) && !"defer".equals(mode)) throw new WrongValueException("Unknown mode: " + mode); if ((_localized || _progressing) && "instant".equals(mode)) throw new UnsupportedOperationException("localized/progressing not allowed in the instant mode"); _mode = mode; fixMode(); if (!_instantMode) invalidate(); else super.invalidate(); } }
/** * Sets whether to show the {@link MZul#PLEASE_WAIT} message before a long operation. * This implementation will automatically use an echo event like {@link Events#echoEvent(String, org.zkoss.zk.ui.Component, String)} * to suspend the including progress before using the {@link Clients#showBusy(String)} * method to show the {@link MZul#PLEASE_WAIT} message at client side. * * <p>If setProgressing(true) is called, the <code>defer</code> mode is enabled automatically * if the current mode is <code>auto</code>. * * <p>Default: false. * @since 3.0.4 */ public void setProgressing(boolean progressing) { if (_progressing != progressing) { if (progressing && "instant".equals(_mode)) throw new UnsupportedOperationException("progressing not allowed in instant mode"); _progressing = progressing; fixMode(); //becomes defer mode if auto checkProgressing(); if (!_instantMode) { getChildren().clear(); invalidate(); } else super.invalidate(); } }
/** Sets the src. * * <p>If src is changed, the whole component is invalidate. * Thus, you want to smart-update, you have to override this method. * * @param src the source URI. If null or empty, nothing is included. * You can specify the source URI with the query string and they * will become a parameter that can be accessed by use * of {@link Execution#getParameter} or javax.servlet.ServletRequest's getParameter. * For example, if "/a.zul?b=c" is specified, you can access * the parameter with ${param.b} in a.zul. * @see #setDynamicProperty */ public void setSrc(String src) { if (src != null && src.length() == 0) src = null; if (!Objects.equals(_src, src)) { _src = src; fixMode(); if (!_instantMode) invalidate(); else super.invalidate(); //invalidate is redundant in instant mode, but less memory leak in IE } }