📄 include.java
字号:
/* Include.java{{IS_NOTE Purpose: Description: History: Wed Sep 28 18:01:03 2005, Created by tomyeh}}IS_NOTECopyright (C) 2005 Potix Corporation. All Rights Reserved.{{IS_RIGHT This program is distributed under GPL Version 2.0 in the hope that it will be useful, but WITHOUT ANY WARRANTY.}}IS_RIGHT*/package org.zkoss.zul;import java.io.Writer;import java.io.IOException;import org.zkoss.lang.Objects;import org.zkoss.zk.ui.UiException;import org.zkoss.zk.ui.WrongValueException;import org.zkoss.zk.ui.sys.UiEngine;import org.zkoss.zk.ui.sys.WebAppCtrl;import org.zkoss.zul.impl.XulElement;/** * Includes the result generated by any servlet. * * <p>Non-XUL extension. * * <p>If the servlet is eventually another ZUL page, the page will be * added to the current desktop when this element is added to * the current desktop. * * @author tomyeh */public class Include extends XulElement { protected String _src; private boolean _localized; public Include() { } public Include(String src) { setSrc(src); } /** Returns the src. * <p>Default: null. */ public String getSrc() { return _src; } /** 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 URL. If null or empty, nothing is included. */ public void setSrc(String src) throws WrongValueException { if (src != null && src.length() == 0) src = null; if (!Objects.equals(_src, src)) { _src = src; invalidate(); } } /** Returns whether the source depends on the current Locale. * If true, it will search xxx_en_US.yyy, xxx_en.yyy and xxx.yyy * for the proper content, where src is assumed to be xxx.yyy. * * <p>Default: false; */ public final boolean isLocalized() { return _localized; } /** Sets whether the source depends on the current Locale. */ public final void setLocalized(boolean localized) { if (_localized != localized) { _localized = localized; invalidate(); } } //-- Component --// /** Default: not childable. */ public boolean isChildable() { return false; } public void redraw(Writer out) throws IOException { final UiEngine ueng = ((WebAppCtrl)getDesktop().getWebApp()).getUiEngine(); ueng.pushOwner(this); try { super.redraw(out); } finally { ueng.popOwner(); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -