public void visitCompositeFactPattern( final CompositeFactPattern pattern ) { buf.append( indentation ); if ( isDSLEnhanced ) { // adding passthrough markup buf.append( ">" ); } if ( CompositeFactPattern.COMPOSITE_TYPE_EXISTS.equals( pattern.getType() ) ) { renderCompositeFOL( pattern ); } else if ( CompositeFactPattern.COMPOSITE_TYPE_NOT.equals( pattern.getType() ) ) { renderCompositeFOL( pattern ); } else if ( CompositeFactPattern.COMPOSITE_TYPE_OR.equals( pattern.getType() ) ) { buf.append( "( " ); if ( pattern.getPatterns() != null ) { for ( int i = 0; i < pattern.getPatterns().length; i++ ) { if ( i > 0 ) { buf.append( " " ); buf.append( pattern.getType() ); buf.append( " " ); } renderSubPattern( pattern, i ); } } buf.append( " )\n" ); } }
private void renderCompositeFOL( final CompositeFactPattern pattern ) { buf.append( pattern.getType() ); if ( pattern.getPatterns() != null ) { buf.append( " (" ); for ( int i = 0; i < pattern.getPatterns().length; i++ ) { renderSubPattern( pattern, i ); if ( i != pattern.getPatterns().length - 1 ) { buf.append( " and " ); } } buf.append( ") \n" ); } }
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 ); }
private CompositeFactPattern visitCompositeFactPattern( CompositeFactPattern pattern ) { CompositeFactPattern clone = new CompositeFactPattern(); clone.setType( pattern.getType() ); if ( pattern.getPatterns() != null ) { for ( IFactPattern fp : pattern.getPatterns() ) { clone.addFactPattern( (IFactPattern) visit( fp ) ); } } return clone; }