01: // (c) copyright 2006 by eXXcellent solutions, Ulm. Author: bschmid
02:
03: package foo.bar;
04:
05: import org.wings.SBorderLayout;
06: import org.wings.SComponent;
07: import org.wings.SPanel;
08: import org.wings.SDimension;
09: import org.wings.SConstants;
10: import org.wings.border.SLineBorder;
11: import org.wings.plaf.WingSetExample;
12:
13: import java.awt.Color;
14:
15: /**
16: * A simple example to show this component up inside the wingset demo.
17: *
18: * @author Benjamin Schmid <B.Schmid@exxcellent.de>
19: */
20: public class MyComponentExample implements WingSetExample {
21:
22: private SPanel panel;
23: private MyComponent myComponent;
24:
25: public void activateExample() {
26: panel = new SPanel(new SBorderLayout());
27: panel.setBackground(Color.yellow);
28: myComponent = new MyComponent("ExampleTest");
29: myComponent.setBorder(new SLineBorder(Color.blue));
30: myComponent.setPreferredSize(new SDimension(300, 100));
31: myComponent.setHorizontalAlignment(SConstants.CENTER);
32: panel.add(myComponent, SBorderLayout.CENTER);
33: }
34:
35: public void passivateExample() {
36: // don't care
37: }
38:
39: public SComponent getExample() {
40: return panel;
41: }
42:
43: public String getExampleName() {
44: return "MyComponent";
45: }
46:
47: public String getExampleGroup() {
48: return "Custom";
49: }
50: }
|