tangoType = TangoAttributeHelper.getAttributeType(getDeviceName(), getAttributeName());
tangoFormat = TangoAttributeHelper.getAttributeFormat(getDeviceName(), getAttributeName());
if (getDeviceName() == null || getAttributeName() == null) {
label = null;
readWidget = (T) new TextField();
writeWidget = (T) new TextField();
}
else if (tangoType == TangoConstHelper.SCALAR_TYPE) {
// get the attribute Label
attributeLabel = TangoAttributeHelper.getLabel(getDeviceName(), getAttributeName());
label.setText(attributeLabel);
if (tangoFormat == TangoConstHelper.BOOLEAN_FORMAT) {
readWidget = (T) new CheckBox();
writeWidget = (T) new BooleanComboBox();
// disable the widget color (here the BooleanComboBox is green)
((BooleanScalarBox) boxType).setColorEnabled((CheckBox) readWidget, colorEnabled);
}
else if (tangoFormat == TangoConstHelper.STRING_FORMAT) {
readWidget = (T) new TextField();
writeWidget = (T) new TextField();
// disable the widget color
((StringScalarBox) boxType).setColorEnabled((TextField) readWidget, colorEnabled);
((StringScalarBox) boxType).setColorEnabled((TextField) writeWidget, colorEnabled);
((TextField) writeWidget).setOpaque(false);
// display Unit
((StringScalarBox) boxType).setUnitEnabled((TextField) readWidget, unitVisible);
}
else if (tangoFormat == TangoConstHelper.NUMERICAL_FORMAT) {
readWidget = (T) new TextField();
writeWidget = (T) new WheelSwitch();
((StringScalarBox) boxType).setUnitEnabled((TextField) readWidget, unitVisible);
((StringScalarBox) boxType).setColorEnabled((TextField) readWidget, colorEnabled);
}
}