KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > wings > plaf > ComponentCG


1 /*
2  * $Id: ComponentCG.java,v 1.8 2005/05/27 12:51:29 blueshift Exp $
3  * Copyright 2000,2005 wingS development team.
4  *
5  * This file is part of wingS (http://www.j-wings.org).
6  *
7  * wingS is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation; either version 2.1
10  * of the License, or (at your option) any later version.
11  *
12  * Please see COPYING for the complete licence.
13  */

14 package org.wings.plaf;
15
16 import org.wings.SComponent;
17 import org.wings.style.CSSSelector;
18 import org.wings.io.Device;
19
20 import java.io.IOException JavaDoc;
21 import java.io.Serializable JavaDoc;
22
23 public interface ComponentCG
24         extends Serializable JavaDoc {
25     /**
26      * Installs the CG.
27      * <p/>
28      * <p><b>Note</b>: Be very careful here since this method is called from
29      * the SComponent constructor! Don't call any methods which rely on
30      * something that will be constructed in a subconstructor later!
31      */

32     void installCG(SComponent c);
33
34     /**
35      * Uninstalls the CG.
36      */

37     void uninstallCG(SComponent c);
38
39     /**
40      * Writes the given component to the Device.
41      * <p/>
42      * <p>This renders the component according to this pluggable look and
43      * feel; it reads the properties of the component and genereates the
44      * HTML, XML or whatever representation that is written to the Device.
45      * <p/>
46      * <p>This method should be called from the write method in SComponent or
47      * a subclass. It delegates
48      *
49      * @param device the output device.
50      * @param component the component to be rendered.
51      */

52     void write(Device device, SComponent component) throws IOException JavaDoc;
53
54     /**
55      * A component may have multiple stylable areas. A tabbed pane for example has a content, the tabs,
56      * the selected tab, etc. These areas are addressed by so called pseudo selectors. There are constants
57      * in SComponents and derivates (prefixed with SELECTOR_), that address commonly used areas. It's the
58      * responsibility of the CG to apply the styling to the respective areas. In case of HTML, one can use
59      * arbitrary CSS selectors in order to style what ever is addressable by means of CSS selector.
60      *
61      * @param component The component addressed by the pseudo selector
62      * @param pseudoSelector A unqiue name naming a specific area of the passed component (i.e. content pane or button area).
63      * @return The real-life css selector for the current browser.
64      */

65     CSSSelector mapSelector(SComponent component, CSSSelector pseudoSelector);
66 }
67
Popular Tags