01: /*
02: * Copyright 2000,2005 wingS development team.
03: *
04: * This file is part of wingS (http://wingsframework.org).
05: *
06: * wingS is free software; you can redistribute it and/or modify
07: * it under the terms of the GNU Lesser General Public License
08: * as published by the Free Software Foundation; either version 2.1
09: * of the License, or (at your option) any later version.
10: *
11: * Please see COPYING for the complete licence.
12: */
13: package org.wings.plaf;
14:
15: import org.wings.SComponent;
16: import org.wings.io.Device;
17:
18: import java.io.IOException;
19: import java.io.Serializable;
20:
21: public interface ComponentCG<COMPONENT_TYPE extends SComponent> extends
22: Serializable {
23: /**
24: * Installs the CG.
25: * <p/>
26: * <p><b>Note</b>: Be very careful here since this method is called from
27: * the SComponent constructor! Don't call any methods which rely on
28: * something that will be constructed in a subconstructor later!
29: */
30: public void installCG(COMPONENT_TYPE c);
31:
32: /**
33: * Uninstalls the CG.
34: */
35: public void uninstallCG(COMPONENT_TYPE c);
36:
37: /**
38: * Notify the CG that the state of the according component has changed.
39: * @param c The 'dirty' component.
40: */
41: public void componentChanged(COMPONENT_TYPE c);
42:
43: /**
44: * Writes the given component to the Device.
45: * <p/>
46: * <p>This renders the component according to this pluggable look and
47: * feel; it reads the properties of the component and genereates the
48: * HTML, XML or whatever representation that is written to the Device.
49: * <p/>
50: * <p>This method should be called from the write method in SComponent or
51: * a subclass. It delegates
52: *
53: * @param device the output device.
54: * @param component the component to be rendered.
55: */
56: public void write(Device device, COMPONENT_TYPE component)
57: throws IOException;
58:
59: /**
60: * Returns an update for the complete component.
61: *
62: * @param component the component to be updated.
63: */
64: public Update getComponentUpdate(COMPONENT_TYPE component);
65: }
|