Package org.drools.guvnor.client.modeldriven.ui

Examples of org.drools.guvnor.client.modeldriven.ui.EnumDropDown


    }

    private void refresh() {
        root.clear();
        if ( enums != null && (enums.fixedList != null || enums.queryExpression != null) ) {
            root.add( new EnumDropDown( methodParameter.value,
                                        new DropDownValueChanged() {
                                            public void valueChanged(String newText,
                                                                     String newValue) {
                                                methodParameter.value = newValue;
                                                if ( onValueChangeCommand != null ) {
View Full Code Here


                                                 field.getValue() );
            box.addKeyPressHandler( new NumbericFilterKeyPressHandler( box ) );
            panel.add( box );
        } else if ( flType != null && flType.equals( SuggestionCompletionEngine.TYPE_BOOLEAN ) ) {
            String[] c = new String[]{"true", "false"};
            panel.add( new EnumDropDown( field.getValue(),
                                         new DropDownValueChanged() {
                                             public void valueChanged(String newText,
                                                                      String newValue) {
                                                 callback.valueChanged( newValue );
                                             }
                                         },
                                         DropDownData.create( c ) ) );
        } else if ( flType != null && flType.equals( SuggestionCompletionEngine.TYPE_DATE ) ) {
            final DatePickerTextBox datePicker = new DatePickerTextBox( field.getValue() );
            String m = ((Constants) GWT.create( Constants.class )).ValueFor0( field.getName() );
            datePicker.setTitle( m );
            datePicker.addValueChanged( new ValueChanged() {
                public void valueChanged(String newValue) {
                    field.setValue( newValue );
                }
            } );

            panel.add( datePicker );
        } else {
            String[] enums = sce.getDataEnumList( key );
            if ( enums != null ) {
                field.setNature( FieldData.TYPE_ENUM );
                panel.add( new EnumDropDown( field.getValue(),
                                             new DropDownValueChanged() {
                                                 public void valueChanged(String newText,
                                                                          String newValue) {
                                                     callback.valueChanged( newValue );
                                                 }
View Full Code Here

                                                 field.getExpected() );
            box.addKeyPressHandler( new NumbericFilterKeyPressHandler( box ) );
            panel.add( box );
        } else if ( flType != null && flType.equals( SuggestionCompletionEngine.TYPE_BOOLEAN ) ) {
            String[] c = new String[]{"true", "false"};
            panel.add( new EnumDropDown( field.getExpected(),
                                         new DropDownValueChanged() {
                                             public void valueChanged(String newText,
                                                                      String newValue) {
                                                 callback.valueChanged( newValue );
                                             }
                                         },
                                         DropDownData.create( c ) ) );
        } else if ( flType != null && flType.equals( SuggestionCompletionEngine.TYPE_DATE ) ) {
            final DatePickerTextBox datePicker = new DatePickerTextBox( field.getExpected() );
            String m = ((Constants) GWT.create( Constants.class )).ValueFor0( field.getFieldName() );
            datePicker.setTitle( m );
            datePicker.addValueChanged( new ValueChanged() {
                public void valueChanged(String newValue) {
                    field.setExpected( newValue );
                }
            } );

            panel.add( datePicker );
        } else {
            String[] enums = sce.getDataEnumList( key );
            if ( enums != null ) {
                //GUVNOR-1324: Java enums are of type TYPE_COMPARABLE whereas Guvnor enums are not.
                //The distinction here controls whether the EXPECTED value is handled as a true
                //Java enum or a literal with a selection list (i.e. Guvnor enum)
                String dataType = sce.getFieldType( key );
                if(dataType.equals(SuggestionCompletionEngine.TYPE_COMPARABLE)) {
                    field.setNature( FieldData.TYPE_ENUM );
                } else {
                    field.setNature( FieldData.TYPE_LITERAL );
                }
               
                panel.add( new EnumDropDown( field.getExpected(),
                                             new DropDownValueChanged() {
                                                 public void valueChanged(String newText,
                                                                          String newValue) {
                                                     callback.valueChanged( newValue );
                                                 }
View Full Code Here

                                                 field.getExpected() );
            box.addKeyPressHandler( new NumbericFilterKeyPressHandler( box ) );
            panel.add( box );
        } else if ( flType != null && flType.equals( SuggestionCompletionEngine.TYPE_BOOLEAN ) ) {
            String[] c = new String[]{"true", "false"};
            panel.add( new EnumDropDown( field.getExpected(),
                                         new DropDownValueChanged() {
                                             public void valueChanged(String newText,
                                                                      String newValue) {
                                                 callback.valueChanged( newValue );
                                             }
                                         },
                                         DropDownData.create( c ) ) );
        } else if ( flType != null && flType.equals( SuggestionCompletionEngine.TYPE_DATE ) ) {
            final DatePickerTextBox datePicker = new DatePickerTextBox( field.getExpected() );
            String m = ((Constants) GWT.create( Constants.class )).ValueFor0( field.getFieldName() );
            datePicker.setTitle( m );
            datePicker.addValueChanged( new ValueChanged() {
                public void valueChanged(String newValue) {
                    field.setExpected( newValue );
                }
            } );

            panel.add( datePicker );
        } else {
            Map<String, String> currentValueMap = new HashMap<String, String>();
            // TODO fill currentValueMap with values of other VerifyFields (if any)
            DropDownData dropDownData = sce.getEnums(factType, field.getFieldName(), currentValueMap);
            if ( dropDownData != null ) {
                //GUVNOR-1324: Java enums are of type TYPE_COMPARABLE whereas Guvnor enums are not.
                //The distinction here controls whether the EXPECTED value is handled as a true
                //Java enum or a literal with a selection list (i.e. Guvnor enum)
                String dataType = sce.getFieldType( key );
                if(dataType.equals(SuggestionCompletionEngine.TYPE_COMPARABLE)) {
                    field.setNature( FieldData.TYPE_ENUM );
                } else {
                    field.setNature( FieldData.TYPE_LITERAL );
                }
               
                panel.add( new EnumDropDown( field.getExpected(),
                                             new DropDownValueChanged() {
                                                 public void valueChanged(String newText,
                                                                          String newValue) {
                                                     callback.valueChanged( newValue );
                                                 }
View Full Code Here

                                                 field.getValue() );
            box.addKeyPressHandler( new NumbericFilterKeyPressHandler( box ) );
            panel.add( box );
        } else if ( flType != null && flType.equals( SuggestionCompletionEngine.TYPE_BOOLEAN ) ) {
            String[] c = new String[]{"true", "false"};
            panel.add( new EnumDropDown( field.getValue(),
                                         new DropDownValueChanged() {
                                             public void valueChanged(String newText,
                                                                      String newValue) {
                                                 callback.valueChanged( newValue );
                                             }
                                         },
                                         DropDownData.create( c ) ) );
        } else if ( flType != null && flType.equals( SuggestionCompletionEngine.TYPE_DATE ) ) {
            final DatePickerTextBox datePicker = new DatePickerTextBox( field.getValue() );
            String m = ((Constants) GWT.create( Constants.class )).ValueFor0( field.getName() );
            datePicker.setTitle( m );
            datePicker.addValueChanged( new ValueChanged() {
                public void valueChanged(String newValue) {
                    field.setValue( newValue );
                }
            } );

            panel.add( datePicker );
        } else {
            Map<String, String> currentValueMap = new HashMap<String, String>();
            for (FieldData otherFieldData : givenFact.getFieldData()) {
                currentValueMap.put(otherFieldData.getName(), otherFieldData.getValue());
            }
            DropDownData dropDownData = sce.getEnums(factType, field.getName(), currentValueMap);
            if ( dropDownData != null ) {
                field.setNature( FieldData.TYPE_ENUM );
                panel.add( new EnumDropDown( field.getValue(),
                                             new DropDownValueChanged() {
                                                 public void valueChanged(String newText,
                                                                          String newValue) {
                                                     callback.valueChanged( newValue );
                                                 }
View Full Code Here

                                                 field.expected );
            box.addKeyboardListener( ActionValueEditor.getNumericFilter( box ) );
            panel.add( box );
        } else if ( flType.equals( SuggestionCompletionEngine.TYPE_BOOLEAN ) ) {
            String[] c = new String[]{"true", "false"};
            panel.add( new EnumDropDown( field.expected,
                                         new DropDownValueChanged() {
                                             public void valueChanged(String newText,
                                                                      String newValue) {
                                                 callback.valueChanged( newValue );
                                             }
                                         },
                                         DropDownData.create( c ) ) );
        } else {
            String[] enums = sce.getDataEnumList( key );
            if ( enums != null ) {
                panel.add( new EnumDropDown( field.expected,
                                             new DropDownValueChanged() {
                                                 public void valueChanged(String newText,
                                                                          String newValue) {
                                                     callback.valueChanged( newValue );
                                                 }
View Full Code Here

                    field.value);
            box.addKeyboardListener(ActionValueEditor.getNumericFilter(box));
            panel.add(box);
        } else if (flType != null && flType.equals(SuggestionCompletionEngine.TYPE_BOOLEAN)) {
            String[] c = new String[]{"true", "false"};
            panel.add(new EnumDropDown(field.value,
                    new DropDownValueChanged() {
                        public void valueChanged(String newText,
                                                 String newValue) {
                            callback.valueChanged(newValue);
                        }
                    },
                    DropDownData.create(c)));
        } else {
            String[] enums = sce.getDataEnumList(key);
            if (enums != null) {
                panel.add(new EnumDropDown(field.value,
                        new DropDownValueChanged() {
                            public void valueChanged(String newText,
                                                     String newValue) {
                                callback.valueChanged(newValue);
                            }
View Full Code Here

                                                 field.expected );
            box.addKeyboardListener( ActionValueEditor.getNumericFilter( box ) );
            panel.add( box );
        } else if ( flType.equals( SuggestionCompletionEngine.TYPE_BOOLEAN ) ) {
            String[] c = new String[]{"true", "false"};
            panel.add( new EnumDropDown( field.expected,
                                         new DropDownValueChanged() {
                                             public void valueChanged(String newText,
                                                                      String newValue) {
                                                 callback.valueChanged( newValue );
                                             }
                                         },
                                         DropDownData.create( c ) ) );
        } else if (flType != null && flType.equals(SuggestionCompletionEngine.TYPE_DATE)) {          
            final DatePickerTextBox datePicker = new DatePickerTextBox( field.expected );
            String m = Format.format(((Constants) GWT.create(Constants.class)).ValueFor0(),
                field.fieldName);
            datePicker.setTitle(m);
            datePicker.addValueChanged(new ValueChanged() {
                public void valueChanged(String newValue) {
                  field.expected = newValue;
                }
            });

             panel.add(datePicker);
        } else {
            String[] enums = sce.getDataEnumList( key );
            if ( enums != null ) {
                panel.add( new EnumDropDown( field.expected,
                                             new DropDownValueChanged() {
                                                 public void valueChanged(String newText,
                                                                          String newValue) {
                                                     callback.valueChanged( newValue );
                                                 }
View Full Code Here

                    field.value);
            box.addKeyboardListener(ActionValueEditor.getNumericFilter(box));
            panel.add(box);
        } else if (flType != null && flType.equals(SuggestionCompletionEngine.TYPE_BOOLEAN)) {
            String[] c = new String[]{"true", "false"};
            panel.add(new EnumDropDown(field.value,
                    new DropDownValueChanged() {
                        public void valueChanged(String newText,
                                                 String newValue) {
                            callback.valueChanged(newValue);
                        }
                    },
                    DropDownData.create(c)));
        } else if (flType != null && flType.equals(SuggestionCompletionEngine.TYPE_DATE)) {          
            final DatePickerTextBox datePicker = new DatePickerTextBox( field.value );
            String m = Format.format(((Constants) GWT.create(Constants.class)).ValueFor0(),
                field.name);
            datePicker.setTitle(m);
            datePicker.addValueChanged(new ValueChanged() {
                public void valueChanged(String newValue) {
                    field.value = newValue;
                }
            });

             panel.add(datePicker);
        } else {
            String[] enums = sce.getDataEnumList(key);
            if (enums != null) {
                panel.add(new EnumDropDown(field.value,
                        new DropDownValueChanged() {
                            public void valueChanged(String newText,
                                                     String newValue) {
                                callback.valueChanged(newValue);
                            }
View Full Code Here

    }

    private void refresh() {
        root.clear();
        if ( enums != null && (enums.fixedList != null || enums.queryExpression != null) ) {
            root.add( new EnumDropDown( methodParameter.value,
                                        new DropDownValueChanged() {
                                            public void valueChanged(String newText,
                                                                     String newValue) {
                                                methodParameter.value = newValue;
                                                if ( onValueChangeCommand != null ) {
View Full Code Here

TOP

Related Classes of org.drools.guvnor.client.modeldriven.ui.EnumDropDown

Copyright © 2018 www.massapicom. 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.