private boolean isBindingUnique( String binding ) { for ( Pattern52 p : model.getPatterns() ) { if ( p.getBoundName().equals( binding ) ) { return false; } for ( ConditionCol52 c : p.getChildColumns() ) { if ( c.isBound() ) { if ( c.getBinding().equals( binding ) ) { return false; } } } } return true; }
private SmallLabel makeColumnLabel( ConditionCol52 cc ) { StringBuilder sb = new StringBuilder(); if ( cc.isBound() ) { sb.append( cc.getBinding() ); sb.append( " : " ); } sb.append( cc.getHeader() ); SmallLabel label = new SmallLabel( sb.toString() ); if ( cc.isHideColumn() ) { label.setStylePrimaryName( Resources.INSTANCE.css().columnLabelHidden() ); } return label; }
public Set<String> getBindings( String className ) { //For some reason, Fact Pattern data-types use the leaf name of the fully qualified Class Name //whereas Fields use the fully qualified Class Name. We don't use the generic fieldType (see //SuggestionCompletionEngine.TYPE) as we can't distinguish between different numeric types String simpleClassName = className; if ( simpleClassName != null && simpleClassName.lastIndexOf( "." ) > 0 ) { simpleClassName = simpleClassName.substring( simpleClassName.lastIndexOf( "." ) + 1 ); } Set<String> bindings = new HashSet<String>(); for ( Pattern52 p : this.model.getPatterns() ) { if ( className == null || p.getFactType().equals( simpleClassName ) ) { String binding = p.getBoundName(); if ( !( binding == null || "".equals( binding ) ) ) { bindings.add( binding ); } } for ( ConditionCol52 c : p.getChildColumns() ) { if ( c.isBound() ) { String fieldDataType = oracle.getFieldClassName( p.getFactType(), c.getFactField() ); if ( fieldDataType.equals( className ) ) { bindings.add( c.getBinding() ); } } } } return bindings; }
if ( !origColumn.isBound() && editColumn.isBound() ) { bUpdateColumnDefinition = true; } else if ( origColumn.isBound() && !editColumn.isBound() ) { bUpdateColumnDefinition = true; } else if ( origColumn.isBound() && editColumn.isBound() && !origColumn.getBinding().equals( editColumn.getBinding() ) ) { bUpdateColumnDefinition = true;
if ( editingCol.isBound() && !isBindingUnique( editingCol.getBinding() ) ) { Window.alert( Constants.INSTANCE.PleaseEnterANameThatIsNotAlreadyUsedByAnotherPattern() ); return;
ConditionCol52 cc = (ConditionCol52) modelCol; StringBuilder header = new StringBuilder(); if ( cc.isBound() ) { header.append( cc.getBinding() ); header.append( " : " );