📄 listfooter.java
字号:
/* Listfooter.java{{IS_NOTE Purpose: Description: History: Fri Jan 13 12:42:38 2006, Created by tomyeh}}IS_NOTECopyright (C) 2006 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.util.List;import java.util.Iterator;import org.zkoss.zk.ui.Component;import org.zkoss.zk.ui.UiException;import org.zkoss.zul.impl.LabelImageElement;/** * A column of the footer of a listbox. * Its parent must be {@link Listfoot}. * * <p>Unlike {@link Listheader}, you could place any child in a list footer. * <p>Note: {@link Listcell} also accepts children. * * @author tomyeh */public class Listfooter extends LabelImageElement { public Listfooter() { } public Listfooter(String label) { setLabel(label); } public Listfooter(String label, String src) { setLabel(label); setImage(src); } /** Returns the listbox that this belongs to. */ public Listbox getListbox() { final Component comp = getParent(); return comp != null ? (Listbox)comp.getParent(): null; } /** Returns the listhead that this belongs to. */ public Listfoot getListfoot() { return (Listfoot)getParent(); } /** Returns the column index, starting from 0. */ public int getColumnIndex() { int j = 0; for (Iterator it = getParent().getChildren().iterator(); it.hasNext(); ++j) if (it.next() == this) break; return j; } /** Returns the list header that is in the same column as * this footer, or null if not available. */ public Listheader getListheader() { final Listbox listbox = getListbox(); if (listbox != null) { final Listhead lcs = listbox.getListhead(); if (lcs != null) { final int j = getColumnIndex(); final List lcschs = lcs.getChildren(); if (j < lcschs.size()) return (Listheader)lcschs.get(j); } } return null; } //-- super --// public String getOuterAttrs() { final StringBuffer sb = new StringBuffer(80).append(super.getOuterAttrs()); final String clkattrs = getAllOnClickAttrs(false); if (clkattrs != null) sb.append(clkattrs); final Listheader header = getListheader(); if (header != null) sb.append(header.getColAttrs()); return sb.toString(); } //-- Component --// public void setParent(Component parent) { if (parent != null && !(parent instanceof Listfoot)) throw new UiException("Wrong parent: "+parent); super.setParent(parent); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -