Creates a new instance of TextInput @param caption @param boxType @param id @param text
(String caption, String text, String id, int boxType)
| 77 | * @param text |
| 78 | */ |
| 79 | public TextInput(String caption, String text, String id, int boxType) { |
| 80 | super(null); |
| 81 | this.caption=(caption==null)?"":caption; |
| 82 | this.id=id; |
| 83 | this.boxType=boxType; |
| 84 | this.homeList = VirtualCanvas.getInstance().getList(); |
| 85 | |
| 86 | colorItem=ColorTheme.getColor(ColorTheme.CONTROL_ITEM); |
| 87 | colorBorder=ColorTheme.getColor(ColorTheme.CURSOR_OUTLINE); |
| 88 | colorBGnd=ColorTheme.getColor(ColorTheme.LIST_BGND); |
| 89 | |
| 90 | font=FontCache.getFont(false, FontCache.roster); |
| 91 | fontHeight=font.getHeight(); |
| 92 | itemHeight=fontHeight; |
| 93 | |
| 94 | if (caption!=null) { |
| 95 | captionFont=FontCache.getFont(true, FontCache.msg); |
| 96 | captionFontHeight=captionFont.getHeight(); |
| 97 | itemHeight+=captionFontHeight; |
| 98 | } |
| 99 | if (text==null && id!=null) { |
| 100 | String tempText=""; |
| 101 | try { |
| 102 | DataInputStream is=NvStorage.ReadFileRecord(id, 0); |
| 103 | try { |
| 104 | tempText=is.readUTF(); |
| 105 | } catch (EOFException e) { is.close(); } |
| 106 | } catch (Exception e) {/* no history available */} |
| 107 | this.text=(tempText==null)?"":tempText; |
| 108 | } else { |
| 109 | this.text=(text==null)?"":text; |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | public TextInput(String caption, String text, String id) { |
| 114 | this(caption, text, id, TextField.ANY); |
nothing calls this directly
no test coverage detected