public void visitActionRetractFact( final ActionRetractFact action ) { buf.append( indentation ); if ( isDSLEnhanced ) { buf.append( ">" ); } buf.append( "retract( " ); buf.append( action.getVariableName() ); buf.append( " );\n" ); }
/** * @param binding The name of the LHS fact binding. * @return Returns true if the specified binding is used on the RHS. */ public boolean isBoundFactUsed( final String binding ) { if ( this.rhs == null ) { return false; } for ( int i = 0; i < this.rhs.length; i++ ) { if ( this.rhs[ i ] instanceof ActionSetField ) { final ActionSetField set = (ActionSetField) this.rhs[ i ]; if ( set.getVariable().equals( binding ) ) { return true; } } else if ( this.rhs[ i ] instanceof ActionRetractFact ) { final ActionRetractFact ret = (ActionRetractFact) this.rhs[ i ]; if ( ret.getVariableName().equals( binding ) ) { return true; } } } return false; }
private ActionRetractFact visitActionRetractFact( ActionRetractFact arf ) { ActionRetractFact clone = new ActionRetractFact(); clone.setVariableName( arf.getVariableName() ); return clone; }
public ActionRetractFactWidget( RuleModeller modeller, EventBus eventBus, ActionRetractFact model, Boolean readOnly ) { super( modeller, eventBus ); HorizontalPanel layout = new HorizontalPanel(); layout.setWidth( "100%" ); layout.setStyleName( "model-builderInner-Background" ); this.isFactTypeKnown = modeller.getSuggestionCompletions().isFactTypeRecognized( modeller.getModel().getLHSBindingType( model.getVariableName() ) ); if ( readOnly == null ) { this.readOnly = !this.isFactTypeKnown; } else { this.readOnly = readOnly; } if ( this.readOnly ) { layout.addStyleName( "editor-disabled-widget" ); } String desc = modeller.getModel().getLHSBindingType( model.getVariableName() ) + " [" + model.getVariableName() + "]"; layout.add( new SmallLabel( HumanReadable.getActionDisplayName("retract") + " <b>" + desc + "</b>" ) ); //This widget couldn't be modified. this.setModified( false ); initWidget( layout ); }