com.sun.interview.PropertiesQuestion has a ability to assign a constratints object that impacts the way property is shown, edited and validated in the Interview.
See #setConstraints(String, ValueConstraints)
The ValueConstraints class defines only a basic attributes - realOnly and visible.
There are also different subclasses of ValueConstraints available - StringConstraints, BooleanConstraints, etc. These objects imposes a typed constraint - that has a direct impact on the way Renderer/Editor are created for the property. For most of them Editor is a JComboBox.
The thing is that if a ValueConstraint (a parent object) is assigned to the property, it becames edited as a JComboBox and prohibits empty value!!!
So the only possibility to have a plain JTextField editor for the property is to not have ANY constraints set at all (setConstraints(<name>, null))
This is not correct. If property.getConstraints() returns a plain ValueConstraints object - then editor should be a JTextFiled. It should be hidden/visible/allowingUnset valuedepending on the properties. But it should be not a JComboBox!
See #setConstraints(String, ValueConstraints)
The ValueConstraints class defines only a basic attributes - realOnly and visible.
There are also different subclasses of ValueConstraints available - StringConstraints, BooleanConstraints, etc. These objects imposes a typed constraint - that has a direct impact on the way Renderer/Editor are created for the property. For most of them Editor is a JComboBox.
The thing is that if a ValueConstraint (a parent object) is assigned to the property, it becames edited as a JComboBox and prohibits empty value!!!
So the only possibility to have a plain JTextField editor for the property is to not have ANY constraints set at all (setConstraints(<name>, null))
This is not correct. If property.getConstraints() returns a plain ValueConstraints object - then editor should be a JTextFiled. It should be hidden/visible/allowingUnset valuedepending on the properties. But it should be not a JComboBox!
- relates to
-
CODETOOLS-6612902 ValueConstraints - isValid() implementation contradicts with the isUnsetAllowed()
-
- Open
-