Examples of EnumDropDownUtilities


Examples of org.kie.workbench.common.widgets.client.widget.EnumDropDownUtilities

    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 );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.