01: /*
02: * Copyright Javelin Software, All rights reserved.
03: */
04:
05: package com.javelin.swinglets.plaf.wml;
06:
07: import java.awt.*;
08:
09: import com.javelin.swinglets.*;
10: import com.javelin.swinglets.tabbed.*;
11:
12: /**
13: * This interface defines the methods any object that would like to be
14: * a renderer for cell in a STabbedPane for WML
15: *
16: * @author Robin Sharp
17: */
18:
19: public class WMLDefaultTabbedCellRenderer extends SLabel implements
20: STabbedCellRenderer {
21: /**
22: * Create a WMLDefaultTabbedCellRenderer.
23: */
24: public WMLDefaultTabbedCellRenderer() {
25: setFont(SFont.getFont("Arial,Helvetica", SFont.PLAIN, 8));
26: }
27:
28: /**
29: * If the component is a SComponent it is returned. Otherwise the
30: * value is converted toString() on a SLabel.
31: */
32: public SComponent getTabbedCellRendererComponent(
33: STabbedPane tabbedPane, int index, SLink link) {
34: setText(tabbedPane.getTitleAt(index));
35: return this;
36: }
37:
38: }
|