private Widget expressionEditor() { ExpressionBuilder builder = null; builder = new ExpressionBuilder( this.modeller, this.eventBus, this.constraint.getExpressionValue(), this.readOnly ); builder.addExpressionTypeChangeHandler( new ExpressionTypeChangeHandler() { public void onExpressionTypeChanged( ExpressionTypeChangeEvent event ) { System.out.println( "type changed: " + event.getOldType() + " -> " + event.getNewType() ); } } ); builder.addOnModifiedCommand( new Command() { public void execute() { executeOnValueChangeCommand(); } } ); Widget ed = widgets( new HTML( " " ), builder ); return ed; }
/** * An editor for the retval "formula" (expression). */ private Widget returnValueEditor() { TextBox box = new BoundTextBox( constraint ); if ( this.readOnly ) { return new SmallLabel( box.getText() ); } String msg = Constants.INSTANCE.FormulaEvaluateToAValue(); Image img = new Image( GuidedRuleEditorResources.INSTANCE.images().functionAssets() ); img.setTitle( msg ); box.setTitle( msg ); box.addChangeHandler( new ChangeHandler() { public void onChange( ChangeEvent event ) { executeOnValueChangeCommand(); } } ); Widget ed = widgets( img, box ); return ed; }
widgets( lit, new InfoPopup( Constants.INSTANCE.LiteralValue(), Constants.INSTANCE.LiteralValTip() ) ) ); widgets( templateKeyButton, new InfoPopup( templateKeyLabel, Constants.INSTANCE.LiteralValTip() ) ) ); widgets( variable, new InfoPopup( Constants.INSTANCE.ABoundVariable(), Constants.INSTANCE.BoundVariableTip() ) ) ); widgets( formula, new InfoPopup( Constants.INSTANCE.AFormula(), Constants.INSTANCE.FormulaExpressionTip() ) ) ); widgets( expression, new InfoPopup( Constants.INSTANCE.ExpressionEditor(), Constants.INSTANCE.ExpressionEditor() ) ) );