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 source = null; 11 public ListElement() 12 { 13 14 } 15 16 public Object getSource() 17 { 18 return source; 19 } 20 21 public void setSource(Object o) 22 { 23 source = o; 24 } 25 26 public ListElement(String text) 27 { 28 setString(text); 29 } 30 31 public void setString(String 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 getText() 48 { 49 return data.getText(); 50 } 51 52 public boolean isSelected() 53 { 54 return selected; 55 } 56 } 57 | Popular Tags |