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 ( editingCol.isBound() && !isBindingUnique( editingCol.getBinding() ) ) { Window.alert( Constants.INSTANCE.PleaseEnterANameThatIsNotAlreadyUsedByAnotherPattern() ); return;
} else if ( origColumn.isBound() && !editColumn.isBound() ) { bUpdateColumnDefinition = true; } else if ( origColumn.isBound() && editColumn.isBound() && !origColumn.getBinding().equals( editColumn.getBinding() ) ) { bUpdateColumnDefinition = true;
private void populateModelColumn( final ConditionCol52 col, final ConditionCol52 editingCol ) { col.setConstraintValueType( editingCol.getConstraintValueType() ); col.setFactField( editingCol.getFactField() ); col.setFieldType( editingCol.getFieldType() ); col.setHeader( editingCol.getHeader() ); col.setOperator( editingCol.getOperator() ); col.setValueList( editingCol.getValueList() ); col.setDefaultValue( editingCol.getDefaultValue() ); col.setHideColumn( editingCol.isHideColumn() ); col.setParameters( editingCol.getParameters() ); col.setBinding( editingCol.getBinding() ); if ( col instanceof LimitedEntryCol && editingCol instanceof LimitedEntryCol ) { ( (LimitedEntryCol) col ).setValue( ( (LimitedEntryCol) editingCol ).getValue() ); } }
StringBuilder header = new StringBuilder(); if ( cc.isBound() ) { header.append( cc.getBinding() ); header.append( " : " );
private ConditionCol52 cloneConditionColumn( ConditionCol52 col ) { ConditionCol52 clone = null; if ( col instanceof LimitedEntryConditionCol52 ) { clone = new LimitedEntryConditionCol52(); DTCellValue52 dcv = cloneLimitedEntryValue( ( (LimitedEntryCol) col ).getValue() ); ( (LimitedEntryCol) clone ).setValue( dcv ); } else { clone = new ConditionCol52(); } clone.setConstraintValueType( col.getConstraintValueType() ); clone.setFactField( col.getFactField() ); clone.setFieldType( col.getFieldType() ); clone.setHeader( col.getHeader() ); clone.setOperator( col.getOperator() ); clone.setValueList( col.getValueList() ); clone.setDefaultValue( new DTCellValue52( col.getDefaultValue() ) ); clone.setHideColumn( col.isHideColumn() ); clone.setParameters( col.getParameters() ); clone.setWidth( col.getWidth() ); clone.setBinding( col.getBinding() ); return clone; }
binding.setText( col.getBinding() ); if ( !isReadOnly ) { binding.addChangeHandler( new ChangeHandler() {