private ListBox makeListBox( final DropDownData dd,
final boolean isMultipleSelect,
final DTCellValue52 value ) {
final ListBox lb = new ListBox( isMultipleSelect );
final EnumDropDownUtilities utilities = new EnumDropDownUtilities() {
@Override
protected int addItems( final ListBox listBox ) {
if ( allowEmptyValues ) {
listBox.addItem( GuidedDecisionTableConstants.INSTANCE.Choose(),
"" );
}
return allowEmptyValues ? 1 : 0;
}
@Override
protected void selectItem( final ListBox listBox ) {
final int itemCount = listBox.getItemCount();
listBox.setEnabled( itemCount > 0 );
if ( itemCount > 0 ) {
listBox.setSelectedIndex( 0 );
value.setStringValue( listBox.getValue( 0 ) );
} else {
value.setStringValue( null );
}
}
};
final String strValue = value.getStringValue() == null ? "" : value.getStringValue();
utilities.setDropDownData( strValue,
dd,
isMultipleSelect,
oracle.getResourcePath(),
lb );