01: package net.xoetrope.awt;
02:
03: import java.awt.Component;
04: import java.awt.ScrollPane;
05: import net.xoetrope.xui.XAttributedComponent;
06:
07: /**
08: * <p>Wraps ScrollPane</p>
09: * <p>Copyright (c) Xoetrope Ltd., 1998-2004<br>
10: * License: see license.txt
11: * $Revision: 1.6 $
12: */
13: public class XScrollPane extends ScrollPane implements
14: XAttributedComponent {
15: private static int nextScrollPanePolicy;
16:
17: /**
18: * Set the scrollbar policy for the next scroll pane that is created.
19: * Once used this value reverts to the default value of SCROLLBARS_AS_NEEDED
20: */
21: public static void setNextScrollPanePolicy(int scrollBarPolicy) {
22: nextScrollPanePolicy = scrollBarPolicy;
23: }
24:
25: /**
26: * Creates a new scroll pane
27: */
28: public XScrollPane() {
29: super (nextScrollPanePolicy);
30: nextScrollPanePolicy = ScrollPane.SCROLLBARS_AS_NEEDED;
31: }
32:
33: /**
34: * Adds a new component and then lays out the container
35: * @param c a component to add to this pane
36: * @return the newly added component
37: */
38: public Component add(Component c) {
39: super .add(c);
40: layout();
41:
42: return c;
43: }
44:
45: /**
46: * Set one or more attributes of the component.
47: * @param attribName the attribute name
48: * @param attribValue the attribute value
49: */
50: public void setAttribute(String attribName, String attribValue) {
51: }
52: }
|