📄 html.java
字号:
/* Html.java{{IS_NOTE Purpose: Description: History: Mon Jul 25 11:39:49 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 org.zkoss.lang.Objects;import org.zkoss.zul.impl.XulElement;/** * A comonent used to embed the browser native content (i.e., HTML tags) * into the output sent to the browser. * The browser native content is specified by {@link #setContent}. * * <p>Notice that {@link Html} generates HTML SPAN to enclose * the embedded HTML tags. Thus, you can specify the style * ({@link #getStyle}), tooltip {@link #getTooltip} and so on. * * <pre><code><html style="border: 1px solid blue"><![CDATA[ * <ul> * <li>It is in a SPAN tag.</li> * </ul> *]]></html></code></pre> * * <p>The generated HTML tags will look like: * <pre><code><SPAN id="xxx" style="border: 1px solid blue"> * <ul> * <li>It is in a SPAN tag.</li> * </ul> *</SPAN></code></pre> * * <p>Since SPAN is used to enclosed the embedded HTML tags, so * the following is incorrect. * * <pre><code><html><![CDATA[ * <table> * <tr> * <td> <-- Incomplete since it is inside SPAN --> *]]></html> * *<textbox/> * *<html><![CDATA[ * </td> * </tr> * </table> *]]></html></code></pre> * * <p>If you need to generate the HTML tags directly * without enclosing with SPAN, you can use the Native namespace, * http://www.zkoss.org/2005/zk/native. * Refer to the Developer's Guide for more information. * * <p>A non-XUL extension. * * @author tomyeh */public class Html extends XulElement { private String _content = ""; /** Contructs a {@link Html} component to embed HTML tags. */ public Html() { } /** Contructs a {@link Html} component to embed HTML tags * with the specified content. */ public Html(String content) { _content = content != null ? content: ""; } /** Returns the embedded content (i.e., HTML tags). * <p>Default: empty (""). */ public String getContent() { return _content; } /** Sets the embedded content (i.e., HTML tags). */ public void setContent(String content) { if (content == null) content = ""; if (!Objects.equals(_content, content)) { _content = content; invalidate(); } } //-- Component --// /** Default: not childable. */ public boolean isChildable() { return false; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -