01: /* Foot.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Fri Jan 19 12:05:37 2007, Created by tomyeh
10: }}IS_NOTE
11:
12: Copyright (C) 2007 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: * Defines a set of footers ({@link Footer}) for a grid ({@link Grid}).
28: *
29: * @author tomyeh
30: */
31: public class Foot extends XulElement {
32: /** Returns the grid that it belongs to.
33: * It is the same as {@link #getParent}.
34: */
35: public Grid getGrid() {
36: return (Grid) getParent();
37: }
38:
39: //-- Component --//
40: public void setParent(Component parent) {
41: if (parent != null && !(parent instanceof Grid))
42: throw new UiException("Wrong parent: " + parent);
43: super .setParent(parent);
44: }
45:
46: public boolean insertBefore(Component child, Component insertBefore) {
47: if (!(child instanceof Footer))
48: throw new UiException("Unsupported child for foot: "
49: + child);
50: return super.insertBefore(child, insertBefore);
51: }
52: }
|