⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nativehelpers.java

📁 ZK 基础介绍 功能操作 模块 结合数据库操作
💻 JAVA
字号:
/* NativeHelpers.java{{IS_NOTE	Purpose:			Description:			History:		Thu Aug 23 17:33:59     2007, Created by tomyeh}}IS_NOTECopyright (C) 2007 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.zk.ui.impl;import java.util.Collection;import java.util.Iterator;import java.util.Map;import org.zkoss.lang.Objects;import org.zkoss.xml.HTMLs;import org.zkoss.idom.Namespace;/** * Utilities for implementing {@link org.zkoss.zk.ui.ext.Native.Helper}. * * @author tomyeh * @since 3.0.0 */public class NativeHelpers {	/** Generates the attributes for the specified properties	 * and namespaces.	 *	 * @param props a map of name and value pairs or null	 * if no properties at all.	 * Note: the value doesn't contain any EL expression.	 * @param namespaces a list of {@link Namespace}	 * to be generated, or null if not.	 * Note: EL expressions is not allowed	 */	public static final	void getAttributes(StringBuffer sb, Map props, Collection namespaces) {		if (namespaces != null && !namespaces.isEmpty()) {			for (Iterator it = namespaces.iterator(); it.hasNext();) {				final Namespace ns = (Namespace)it.next();				sb.append(" xmlns");				if (ns.getPrefix().length() > 0)					sb.append(':').append(ns.getPrefix());				sb.append("=\"").append(ns.getURI()).append('"');			}		}		if (props != null && !props.isEmpty()) {			for (Iterator it = props.entrySet().iterator(); it.hasNext();) {				final Map.Entry me = (Map.Entry)it.next();				HTMLs.appendAttribute(sb,					Objects.toString(me.getKey()),					Objects.toString(me.getValue()));			}		}	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -