KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > text > list > ListElement


1 package text.list;
2
3 import text.*;
4
5 public class ListElement
6 {
7    protected AttributedString data;
8    protected boolean selected = false;
9    protected Object JavaDoc source = null; // source object
10

11    public ListElement()
12    {
13
14    }
15
16    public Object JavaDoc getSource()
17    {
18       return source;
19    }
20
21    public void setSource(Object JavaDoc o)
22    {
23       source = o;
24    }
25
26    public ListElement(String JavaDoc text)
27    {
28       setString(text);
29    }
30
31    public void setString(String JavaDoc text)
32    {
33       data = AttributedString.CreateAttributedString(text);
34       data.assignWidths();
35    }
36
37    public void setSelected(boolean _selected)
38    {
39       selected = _selected;
40    }
41
42    public AttributedText getAttributedText()
43    {
44       return data.getAttributedText();
45    }
46
47    public String JavaDoc getText()
48    {
49       return data.getText();
50    }
51
52    public boolean isSelected()
53    {
54       return selected;
55    }
56 }
57
Popular Tags