MCPcopy Create free account
hub / github.com/BombusMod/BombusMod / TextInput

Method TextInput

src/main/java/ui/controls/form/TextInput.java:79–111  ·  view source on GitHub ↗

Creates a new instance of TextInput @param caption @param boxType @param id @param text

(String caption, String text, String id, int boxType)

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls 7

getInstanceMethod · 0.95
getColorMethod · 0.95
getFontMethod · 0.95
ReadFileRecordMethod · 0.95
getHeightMethod · 0.65
getListMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected