1 package be
.nikiroo
.fanfix
.reader
.tui
;
5 import be
.nikiroo
.utils
.resources
.MetaInfo
;
7 class ConfigItemString
<E
extends Enum
<E
>> extends ConfigItem
<E
> {
9 * Create a new {@link ConfigItemString} for the given {@link MetaInfo}.
12 * the {@link MetaInfo}
14 public ConfigItemString(TWidget parent
, MetaInfo
<E
> info
) {
15 super(parent
, info
, true);
19 protected Object
getFromField(int item
) {
20 TField field
= (TField
) getField(item
);
22 return field
.getText();
29 protected Object
getFromInfo(int item
) {
30 return getInfo().getString(item
, false);
34 protected void setToField(Object value
, int item
) {
35 TField field
= (TField
) getField(item
);
37 field
.setText(value
== null ?
"" : value
.toString());
42 protected void setToInfo(Object value
, int item
) {
43 getInfo().setString((String
) value
, item
);
47 protected TWidget
createEmptyField(int item
) {
48 return new TField(this, 0, 0, 1, false);