01: /* Listfoot.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Fri Jan 13 12:42:31 2006, Created by tomyeh
10: }}IS_NOTE
11:
12: Copyright (C) 2006 Potix Corporation. All Rights Reserved.
13:
14: {{IS_RIGHT
15: This program is distributed under GPL Version 2.0 in the hope that
16: it will be useful, but WITHOUT ANY WARRANTY.
17: }}IS_RIGHT
18: */
19: package org.zkoss.zul;
20:
21: import org.zkoss.zk.ui.Component;
22: import org.zkoss.zk.ui.UiException;
23:
24: import org.zkoss.zul.impl.XulElement;
25:
26: /**
27: * A row of {@link Listfooter}.
28: *
29: * <p>Like {@link Listhead}, each listbox has at most one {@link Listfoot}.
30: *
31: * @author tomyeh
32: */
33: public class Listfoot extends XulElement {
34: /** Returns the list box that it belongs to.
35: * <p>It is the same as {@link #getParent}.
36: */
37: public Listbox getListbox() {
38: return (Listbox) getParent();
39: }
40:
41: //-- Component --//
42: public void setParent(Component parent) {
43: if (parent != null && !(parent instanceof Listbox))
44: throw new UiException("Wrong parent: " + parent);
45: super .setParent(parent);
46: }
47:
48: public boolean insertBefore(Component child, Component insertBefore) {
49: if (!(child instanceof Listfooter))
50: throw new UiException("Unsupported child for listfoot: "
51: + child);
52: return super.insertBefore(child, insertBefore);
53: }
54: }
|