public void setValue( DSLVariableValue value ) { this.oldVariableValue = value; box.setText( value.getValue() ); }
/** * This will strip off any "{" stuff, substituting values accordingly */ public String interpolate() { getValues(); if ( definition == null ) { return ""; } int variableStart = definition.indexOf( "{" ); if ( variableStart < 0 ) { return definition; } int index = 0; int variableEnd = 0; StringBuilder sb = new StringBuilder(); while ( variableStart >= 0 ) { sb.append( definition.substring( variableEnd, variableStart ) ); variableEnd = getIndexForEndOfVariable( definition, variableStart ) + 1; variableStart = definition.indexOf( "{", variableEnd ); sb.append( values.get( index++ ).getValue() ); } if ( variableEnd < definition.length() ) { sb.append( definition.substring( variableEnd ) ); } return sb.toString(); }
private DSLVariableValue visitDSLVariableValue( DSLVariableValue value ) { DSLVariableValue clone = new DSLVariableValue(); clone.setValue( value.getValue() ); return clone; }
public void refreshDropDownData() { resultWidget.setDropDownData( selectedValue.getValue(), getDropDownData() ); }
factAndField.length() ); fieldValueMap.put( field, values.get( iVariable ).getValue() );
public Widget getBox( DSLVariableValue variableDef, String regex, boolean readonly ) { FieldEditor currentBox = new FieldEditor(); currentBox.setVisibleLength( variableDef.getValue().length() + 1 ); currentBox.setValue( variableDef ); currentBox.setRestriction( regex ); currentBox.box.setEnabled( !readonly ); return currentBox; }
resultWidget = new EnumDropDown( value.getValue(), handler, dropDownData );
public DSLDateSelector( DSLVariableValue selectedDate, String dateFormat ) { resultWidget = new DatePickerLabel( selectedDate.getValue(), dateFormat ); resultWidget.addValueChanged( new ValueChanged() { public void valueChanged( String newValue ) { updateSentence(); makeDirty(); } } ); //Wrap widget within a HorizontalPanel to add a space before and after the Widget HorizontalPanel hp = new HorizontalPanel(); hp.add( new HTML( " " ) ); hp.add( resultWidget ); hp.add( new HTML( " " ) ); initWidget( hp ); }
public void onClick( ClickEvent event ) { final CustomFormPopUp customFormPopUp = new CustomFormPopUp( GuidedRuleEditorImages508.INSTANCE.Wizard(), Constants.INSTANCE.FieldValue(), DSLCustomFormButton.this.customFormConfiguration ); customFormPopUp.addOkButtonHandler( new ClickHandler() { public void onClick( ClickEvent event ) { String id = customFormPopUp.getFormId(); String value = customFormPopUp.getFormValue(); btnCustomForm.setText( value ); selectedValue = new DSLComplexVariableValue( id, value ); updateSentence(); makeDirty(); customFormPopUp.hide(); } } ); //if selectedValue is an instance of DSLComplexVariableValue, //then both id and value are passed to the custom form //if not, only the value is passed and "" is passed as id if ( selectedValue instanceof DSLComplexVariableValue ) { DSLComplexVariableValue complexSelectedValue = (DSLComplexVariableValue) selectedValue; customFormPopUp.show( complexSelectedValue.getId(), complexSelectedValue.getValue() ); } else { customFormPopUp.show( "", selectedValue.getValue() ); } } } );
public DSLCheckBox( String variableDef, DSLVariableValue value ) { resultWidget = new ListBox(); resultWidget.addItem( "true" ); resultWidget.addItem( "false" ); if ( value.getValue().equalsIgnoreCase( "true" ) ) { resultWidget.setSelectedIndex( 0 ); } else { resultWidget.setSelectedIndex( 1 ); } resultWidget.addChangeHandler( new ChangeHandler() { public void onChange( ChangeEvent event ) { updateSentence(); makeDirty(); } } ); resultWidget.setVisible( true ); //Wrap widget within a HorizontalPanel to add a space before and after the Widget HorizontalPanel hp = new HorizontalPanel(); hp.add( new HTML( " " ) ); hp.add( resultWidget ); hp.add( new HTML( " " ) ); initWidget( hp ); }
this.btnCustomForm = new Button( selectedValue.getValue() );
assertTrue( values.get( 0 ) instanceof DSLComplexVariableValue ); assertEquals( "rating", values.get( 0 ).getValue() ); assertEquals( "ENUM:Applicant.creditRating", ( (DSLComplexVariableValue) values.get( 0 ) ).getId() );