public boolean doesOperatorNeedValue( ConditionCol52 c ) { String operator = c.getOperator(); if ( operator == null || operator.equals( "" ) ) { return false; } return !( operator.equals( "== null" ) || operator.equals( "!= null" ) ); }
public boolean isConditionOperatorValid( ConditionCol52 c ) { if ( c.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_PREDICATE ) { return true; } return !( c.getOperator() == null || c.getOperator().equals( "" ) ); }
/** * Get the Data Type corresponding to a given column * @param pattern Pattern52 * @param condition ConditionCol52 * @return */ public DataType.DataTypes getDataType( Pattern52 pattern, ConditionCol52 condition ) { //Limited Entry are simply boolean if ( condition instanceof LimitedEntryCol ) { return DataType.DataTypes.BOOLEAN; } //Operators "is null" and "is not null" require a boolean cell if ( condition.getOperator() != null && ( condition.getOperator().equals( "== null" ) || condition.getOperator().equals( "!= null" ) ) ) { return DataType.DataTypes.BOOLEAN; } //Extended Entry... return utils.getTypeSafeType( pattern, condition ); }
public boolean doesOperatorAcceptValueList( ConditionCol52 c ) { String operator = c.getOperator(); if ( operator == null || operator.equals( "" ) ) { return false; } return !( OperatorsOracle.operatorRequiresList( operator ) || operator.equals( "== null" ) || operator.equals( "!= null" ) ); }
/** * Check whether the given column can accept "otherwise" values * @param column * @return true if the Column can accept "otherwise" values */ private boolean canAcceptOtherwiseValues( BaseColumn column ) { //Check the column type is correct if ( !( column instanceof ConditionCol52 ) ) { return false; } ConditionCol52 cc = (ConditionCol52) column; //Check column contains literal values and uses the equals operator if ( cc.getConstraintValueType() != BaseSingleFieldConstraint.TYPE_LITERAL ) { return false; } //Check operator is supported if ( cc.getOperator() == null ) { return false; } if ( cc.getOperator().equals( "==" ) ) { return true; } if ( cc.getOperator().equals( "!=" ) ) { return true; } return false; }
if ( cc.getOperator() != null && ( cc.getOperator().equals( "== null" ) || cc.getOperator().equals( "!= null" ) ) ) { return DataType.DataTypes.BOOLEAN;
private DecoratedGridCellValueAdaptor<? extends Comparable<?>> derieveCellFromCondition( ConditionCol52 col ) { //Operators "is null" and "is not null" require a boolean cell if ( col.getOperator() != null && ( col.getOperator().equals( "== null" ) || col.getOperator().equals( "!= null" ) ) ) { return makeBooleanCell(); } //Check if the column has a "Value List" or an enumeration. Value List takes precedence final String factType = model.getPattern( col ).getFactType(); final String fieldName = col.getFactField(); if ( utils.hasValueList( col ) ) { return makeValueListCell( col ); } else if ( oracle.hasEnums( factType, fieldName ) ) { return makeEnumCell( factType, fieldName ); } return derieveCellFromModel( col ); }
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()) ); } }
DTCellValue52 realCellValue ) { String factField = conditionCol.getFactField(); String operator = conditionCol.getOperator(); String type = utils.getType( conditionCol );
label.append( cc.getOperator() ); String lev = getLimitedEntryValue( cc ); if ( lev != null ) {
if ( null == editingCol.getOperator() || "".equals( editingCol.getOperator() ) ) { Window.alert( Constants.INSTANCE.NotifyNoSelectedOperator() );
if ( !isEqualOrNull( origColumn.getOperator(), editColumn.getOperator() ) ) { bUpdateColumnDefinition = true; || !isEqualOrNull( origColumn.getFieldType(), editColumn.getFieldType() ) || !isEqualOrNull( origColumn.getOperator(), editColumn.getOperator() ) || origColumn.getConstraintValueType() != editColumn.getConstraintValueType() ) { bUpdateColumnData = 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() ); } }
tsdt.getConditionPattern( "z1" ).getChildColumns().get( 0 ).getHeader() ); assertEquals( "==", tsdt.getConditionPattern( "z1" ).getChildColumns().get( 0 ).getOperator() ); tsdt.getConditionPattern( "z1" ).getChildColumns().get( 1 ).getHeader() ); assertEquals( "==", tsdt.getConditionPattern( "z1" ).getChildColumns().get( 1 ).getOperator() ); tsdt.getConditionPattern( "f1" ).getChildColumns().get( 0 ).getHeader() ); assertEquals( "==", tsdt.getConditionPattern( "f1" ).getChildColumns().get( 0 ).getOperator() ); tsdt.getConditionPattern( "f2" ).getChildColumns().get( 0 ).getHeader() ); assertEquals( null, tsdt.getConditionPattern( "f2" ).getChildColumns().get( 0 ).getOperator() );
tsdt.getConditionPattern( "f1" ).getChildColumns().get( 0 ).getHeader() ); assertEquals( "==", tsdt.getConditionPattern( "f1" ).getChildColumns().get( 0 ).getOperator() ); tsdt.getConditionPattern( "f1" ).getChildColumns().get( 1 ).getHeader() ); assertEquals( "==", tsdt.getConditionPattern( "f1" ).getChildColumns().get( 1 ).getOperator() ); tsdt.getConditionPattern( "f2" ).getChildColumns().get( 0 ).getHeader() ); assertEquals( "==", tsdt.getConditionPattern( "f2" ).getChildColumns().get( 0 ).getOperator() ); tsdt.getConditionPattern( "f2" ).getChildColumns().get( 1 ).getHeader() ); assertEquals( null, tsdt.getConditionPattern( "f2" ).getChildColumns().get( 1 ).getOperator() );
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; }
tsdt.getConditionPattern( "f1" ).getChildColumns().get( 0 ).getHeader() ); assertEquals( "==", tsdt.getConditionPattern( "f1" ).getChildColumns().get( 0 ).getOperator() ); tsdt.getConditionPattern( "f1" ).getChildColumns().get( 1 ).getHeader() ); assertEquals( "==", tsdt.getConditionPattern( "f1" ).getChildColumns().get( 1 ).getOperator() ); tsdt.getConditionPattern( "f1" ).getChildColumns().get( 2 ).getHeader() ); assertEquals( "==", tsdt.getConditionPattern( "f1" ).getChildColumns().get( 2 ).getOperator() );