private void addExistentialConditionalElements() { String ces[] = HumanReadable.CONDITIONAL_ELEMENTS; choices.addItem( SECTION_SEPARATOR ); for ( int i = 0; i < ces.length; i++ ) { final String ce = ces[ i ]; String key = "CE" + ce; choices.addItem( HumanReadable.getCEDisplayName( ce ) + " ...", key ); cmds.put( key, new Command() { public void execute() { addNewCE( ce, Integer.parseInt( positionCbo.getValue( positionCbo.getSelectedIndex() ) ) ); hide(); } } ); } }
public static String getActionDisplayName( String action ) { return lookup( action, actionDisplayMap ); } }
for ( int i = 0; i < operators.length; i++ ) { String op = operators[ i ]; box.addItem( HumanReadable.getOperatorDisplayName( op ), op ); if ( op.equals( hop.getOperator() ) ) { selected = op; selectedText = HumanReadable.getOperatorDisplayName( op ); box.setSelectedIndex( i + 1 );
private Widget getAssertLabel() { ClickHandler cl = new ClickHandler() { public void onClick( ClickEvent event ) { Widget w = (Widget) event.getSource(); showAddFieldPopup( w ); } }; String assertType = "assert"; //NON-NLS if ( this.model instanceof ActionInsertLogicalFact) { assertType = "assertLogical"; //NON-NLS } String lbl = ( model.isBound() == false ) ? HumanReadable.getActionDisplayName(assertType) + " <b>" + this.model.getFactType() + "</b>" : HumanReadable.getActionDisplayName( assertType ) + " <b>" + this.model.getFactType() + "</b>" + " <b>[" + model.getBoundName() + "]</b>"; if ( this.model.getFieldValues() != null && model.getFieldValues().length > 0 ) { lbl = lbl + ":"; } return new ClickableLabel( lbl, cl, !this.readOnly ); }
box.addItem( HumanReadable.getOperatorDisplayName( op ), op ); if ( op.equals( hcw.getWindow().getOperator() ) ) { selected = op; selectedText = HumanReadable.getOperatorDisplayName( op ); box.setSelectedIndex( i + 1 );
private Widget getSetterLabel() { HorizontalPanel horiz = new HorizontalPanel(); if ( mCall.getState() == ActionCallMethod.TYPE_UNDEFINED ) { Image edit = TestScenarioAltedImages.INSTANCE.AddFieldToFact(); edit.setTitle( TestScenarioConstants.INSTANCE.AddAnotherFieldToThisSoYouCanSetItsValue() ); edit.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { Image w = (Image) event.getSource(); showAddFieldPopup( w ); } } ); horiz.add( new SmallLabel( HumanReadable.getActionDisplayName("call") + " [" + mCall.getVariable() + "]" ) ); // NON-NLS horiz.add( edit ); } else { horiz.add( new SmallLabel( HumanReadable.getActionDisplayName( "call" ) + " [" + mCall.getVariable() + "." + mCall.getMethodName() + "]" ) ); // NON-NLS } return horiz; }
private Widget connectiveOperatorDropDown( final ConnectiveConstraint cc ) { if ( !isReadOnly ) { String factType = cc.getFactType(); String fieldName = cc.getFieldName(); String[] operators = this.getCompletions().getConnectiveOperatorCompletions( factType, fieldName ); CEPOperatorsDropdown w = new CEPOperatorsDropdown( operators, cc ); w.addValueChangeHandler( new ValueChangeHandler<OperatorSelection>() { public void onValueChange( ValueChangeEvent<OperatorSelection> event ) { OperatorSelection selection = event.getValue(); String selected = selection.getValue(); cc.setOperator( selected ); } } ); return w; } else { SmallLabel sl = new SmallLabel( "<b>" + ( cc.getOperator() == null ? Constants.INSTANCE.pleaseChoose() : HumanReadable.getOperatorDisplayName(cc.getOperator()) ) + "</b>" ); return sl; } }
private Widget getSetterLabel() { ClickHandler clk = new ClickHandler() { public void onClick( ClickEvent event ) { //Widget w = (Widget)event.getSource(); showAddFieldPopup( event ); } }; String modifyType = "set"; if ( this.model instanceof ActionUpdateField) { modifyType = "modify"; } String type = this.getModeller().getModel().getLHSBindingType( model.getVariable() ); String descFact = ( type != null ) ? type + " <b>[" + model.getVariable() + "]</b>" : model.getVariable(); String sl = Constants.INSTANCE.setterLabel( HumanReadable.getActionDisplayName(modifyType), descFact ); return new ClickableLabel( sl, clk, !this.readOnly );//HumanReadable.getActionDisplayName(modifyType) + " value of <b>[" + model.variable + "]</b>", clk); }
private void addFromConditionalElements() { String fces[] = HumanReadable.FROM_CONDITIONAL_ELEMENTS; choices.addItem( SECTION_SEPARATOR ); for ( int i = 0; i < fces.length; i++ ) { final String ce = fces[ i ]; String key = "FCE" + ce; choices.addItem( HumanReadable.getCEDisplayName( ce ) + " ...", key ); cmds.put( key, new Command() { public void execute() { addNewFCE( ce, Integer.parseInt( positionCbo.getValue( positionCbo.getSelectedIndex() ) ) ); hide(); } } ); } }
public static String getCEDisplayName( String ce ) { return lookup( ce, ceDisplayMap ); }
private void doOperatorLabel() { if ( editingCol.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_PREDICATE ) { operatorLabel.setText( Constants.INSTANCE.notNeededForPredicate() ); } else if ( nil( editingPattern.getFactType() ) ) { operatorLabel.setText( Constants.INSTANCE.pleaseSelectAPatternFirst() ); } else if ( nil( editingCol.getFactField() ) ) { operatorLabel.setText( Constants.INSTANCE.pleaseChooseAFieldFirst() ); } else if ( nil( editingCol.getOperator() ) ) { operatorLabel.setText( Constants.INSTANCE.pleaseSelectAField() ); } else { operatorLabel.setText( HumanReadable.getOperatorDisplayName(editingCol.getOperator()) ); } }
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; }
protected Widget getCompositeLabel() { ClickHandler click = new ClickHandler() { public void onClick( ClickEvent event ) { Widget w = (Widget) event.getSource(); showFactTypeSelector( w ); } }; String lbl = HumanReadable.getCEDisplayName(pattern.getType()); if ( pattern.getPatterns() == null || pattern.getPatterns().length == 0 ) { lbl += " <font color='red'>" + Constants.INSTANCE.clickToAddPatterns() + "</font>"; } return new ClickableLabel( lbl + ":", click, !this.readOnly ); }
public static String getOperatorDisplayName( String op ) { return lookup( op, operatorDisplayMap ); }
SmallLabel sl = new SmallLabel( "<b>" + ( c.getOperator() == null ? Constants.INSTANCE.pleaseChoose() : HumanReadable.getOperatorDisplayName( c.getOperator() ) ) + "</b>" ); return sl;
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 ); }
String lbl = "<div class='form-field'>" + HumanReadable.getCEDisplayName( "from entry-point" ) + "</div>";
String lbl = "<div class='form-field'>" + HumanReadable.getCEDisplayName("from") + "</div>";
String lbl = "<div class='form-field'>" + HumanReadable.getCEDisplayName( "from collect" ) + "</div>";
String lbl = "<div class='form-field'>" + HumanReadable.getCEDisplayName( "from accumulate" ) + "</div>";