private void generateSetMethodCallsMethod( final ActionCallMethod action, final FieldNature[] fieldValues ) { buf.append( indentation ); if ( isDSLEnhanced ) { buf.append( ">" ); } buf.append( action.getVariable() ); buf.append( "." ); buf.append( action.getMethodName() ); buf.append( "( " ); boolean isFirst = true; for ( int i = 0; i < fieldValues.length; i++ ) { ActionFieldFunction valueFunction = (ActionFieldFunction) fieldValues[ i ]; if ( isFirst == true ) { isFirst = false; } else { buf.append( ", " ); } constraintValueBuilder.buildRHSFieldValue( buf, valueFunction.getType(), valueFunction.getValue() ); } buf.append( " );\n" ); } }
private Widget getSetterLabel() { HorizontalPanel horiz = new HorizontalPanel(); if ( model.getState() == ActionCallMethod.TYPE_UNDEFINED ) { Image edit = GuidedRuleEditorImages508.INSTANCE.AddFieldToFact(); edit.setAltText( Constants.INSTANCE.AddAnotherFieldToThisSoYouCanSetItsValue() ); edit.setTitle( Constants.INSTANCE.AddAnotherFieldToThisSoYouCanSetItsValue() ); edit.addClickHandler( new ClickHandler() { public void onClick( ClickEvent event ) { Widget w = (Widget) event.getSource(); showAddFieldPopup( w ); } } ); horiz.add( new SmallLabel( HumanReadable.getActionDisplayName("call") + " [" + model.getVariable() + "]" ) ); // NON-NLS if ( !this.readOnly ) { horiz.add( edit ); } } else { horiz.add( new SmallLabel( HumanReadable.getActionDisplayName( "call" ) + " [" + model.getVariable() + "." + model.getMethodName() + "]" ) ); // NON-NLS } return horiz; }
a.getVariable() ); assertEquals( "addName", a.getMethodName() ); assertEquals( 1, a.getFieldValues().length );