Package org.drools.guvnor.client.common

Examples of org.drools.guvnor.client.common.DropDownValueChanged


    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 ) {
                                                    onValueChangeCommand.execute();
View Full Code Here


            factField = factAndField.substring( dotIndex + 1,
                                                factAndField.length() );
            selectedValue = value;

            //ChangeHandler for drop-down; not called when initialising the drop-down
            DropDownValueChanged handler = new DropDownValueChanged() {

                public void valueChanged(String newText,
                                         String newValue) {

                    makeDirty();
View Full Code Here

        //Enumeration (these support multi-select for "in" and "not in", so check before comma separated lists)
        if ( this.dropDownData != null ) {
            final String operator = constraint.getOperator();
            final boolean multipleSelect = SuggestionCompletionEngine.operatorRequiresList( operator );
            EnumDropDown enumDropDown = new EnumDropDown( constraint.getValue(),
                                                          new DropDownValueChanged() {

                                                              public void valueChanged(String newText,
                                                                                       String newValue) {

                                                                  //Prevent recursion once value change has been applied
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 ) {
                                                    onValueChangeCommand.execute();
View Full Code Here

        panel.clear();

        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.INSTANCE.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

        if (factName.lastIndexOf(".") > -1){
            // if fact is a fully qualified className, strip off the packageName
            factName = factName.substring(factName.lastIndexOf(".")+1);
        }
        final EnumDropDown dropDownFields = new EnumDropDown("",
                new DropDownValueChanged() {
                    public void valueChanged(String newText,
                                             String newValue) {
                        //do nothing
                    }
                }, DropDownData.create(new String[]{}));

        EnumDropDown dropDownFacts = new EnumDropDown(factName,
                new DropDownValueChanged() {
                    public void valueChanged(String newText, String newValue) {
                        String selectedField = scorecardModel.getFieldName();
                        selectedField = selectedField+" : double";
                        dropDownFields.setDropDownData(selectedField, DropDownData.create(getEligibleFields(newValue, typesForScore)));
                    }
                }, DropDownData.create(sce.getFactTypes()));

        ddReasonCodeField = new EnumDropDown("",
                new DropDownValueChanged() {
                    public void valueChanged(String newText,
                                             String newValue) {
                        //do nothing
                    }
                }, DropDownData.create(new String[]{}));
View Full Code Here

            if (selectedFact.lastIndexOf(".") > -1) {
                selectedFact = selectedFact.substring(selectedFact.lastIndexOf(".")+1);
            }
        }
        final EnumDropDown dropDownFields = new EnumDropDown("",
                new DropDownValueChanged() {
                    public void valueChanged(String newText,
                                             String newValue) {
                        //do nothing
                    }
                }, DropDownData.create(new String[]{}));

        EnumDropDown dropDownFacts = new EnumDropDown(selectedFact,
                new DropDownValueChanged() {
                    public void valueChanged(String newText, String newValue) {
                        String selectedField = "";
                        if (characteristic != null) {
                            selectedField = characteristic.getField();
                            selectedField = selectedField+" : "+characteristic.getDataType();
View Full Code Here

        return null;
    }

    private EnumDropDown booleanEditor(String currentValue) {
        return new EnumDropDown(currentValue,
                new DropDownValueChanged() {
                    public void valueChanged(String newText,
                                             String newValue) {
                        boolean enabled = "true".equalsIgnoreCase(newValue);
                        ddReasonCodeAlgo.setEnabled(enabled);
                        tbBaselineScore.setEnabled(enabled);
View Full Code Here

                DropDownData.create(new String[]{"false", "true"}));
    }

    private EnumDropDown dropDownEditor(final DropDownData dropDownData, String currentValue) {
        return new EnumDropDown(currentValue,
                new DropDownValueChanged() {
                    public void valueChanged(String newText,
                                             String newValue) {
                        //valueHasChanged(newValue);
                    }
                },
View Full Code Here

    }

    private EnumDropDown createEnumDropDown() {

        final EnumDropDown box = new EnumDropDown( constraint.getValue(),
                                                   new DropDownValueChanged() {
                                                       public void valueChanged(String newText,
                                                                                String newValue) {
                                                           constraint.setValue( newValue );
                                                           textWidget.setText( newText );
                                                       }
View Full Code Here

TOP

Related Classes of org.drools.guvnor.client.common.DropDownValueChanged

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.