01: // (c) copyright 2006 by eXXcellent solutions, Ulm. Author: bschmid
02:
03: package org.wings.border;
04:
05: import java.awt.*;
06:
07: import org.wings.SComponent;
08: import org.wings.style.CSSAttributeSet;
09:
10: /**
11: * If a default border is set, CGs will not write any inline borders and paddings. Thus the styles as defined in the
12: * stylesheet take effect.
13: * @author Benjamin Schmid <B.Schmid@exxcellent.de>
14: */
15: public class SDefaultBorder extends SAbstractBorder {
16: public static final SDefaultBorder INSTANCE = new SDefaultBorder();
17:
18: private boolean locked = false;
19:
20: private SDefaultBorder() {
21: locked = true;
22: }
23:
24: /**
25: * The default border is not modifyable, thus no component needs to be informed.
26: */
27: public void setComponent(SComponent newComponent) {
28: }
29:
30: /**
31: * Return no attributes.
32: */
33: public CSSAttributeSet getAttributes() {
34: return null;
35: }
36:
37: public void setInsets(Insets insets) {
38: if (locked)
39: throw new IllegalStateException(
40: "DefaultBorder is not configurable");
41: }
42:
43: public void setColor(Color color, int position) {
44: if (locked)
45: throw new IllegalStateException(
46: "DefaultBorder is not configurable");
47: }
48:
49: public void setThickness(int thickness, int position) {
50: if (locked)
51: throw new IllegalStateException(
52: "DefaultBorder is not configurable");
53: }
54:
55: public void setStyle(String style, int position) {
56: if (locked)
57: throw new IllegalStateException(
58: "DefaultBorder is not configurable");
59: }
60: }
|