@Override public void widgetSelected( SelectionEvent e ) { // Move the condition lower: this means create a subcondition and put the condition there in the list. // Condition down = active_condition.getCondition( cond_nr ); Condition c = new Condition(); c.setOperator( down.getOperator() ); down.setOperator( Condition.OPERATOR_NONE ); active_condition.setCondition( cond_nr, c ); c.addCondition( down ); widget.redraw(); } } );
private void addCondition() { Condition c = new Condition(); c.setOperator( Condition.OPERATOR_AND ); addCondition( c ); setModified(); widget.redraw(); }
@Override public void widgetSelected( SelectionEvent e ) { Condition c = new Condition(); c.setOperator( Condition.OPERATOR_AND ); sub.addCondition( c ); setModified(); widget.redraw(); } } );
@Override public Condition getTestObject() { Condition rtn = new Condition(); rtn.setFunction( rand.nextInt( Condition.functions.length ) ); rtn.setLeftValuename( UUID.randomUUID().toString() ); rtn.setNegated( rand.nextBoolean() ); rtn.setOperator( rand.nextInt( Condition.operators.length ) ); rtn.setRightValuename( UUID.randomUUID().toString() ); return rtn; }
public void addCondition( Condition cb ) { if ( isAtomic() && getLeftValuename() != null ) { /* * Copy current atomic setup... */ Condition current = new Condition( getLeftValuename(), getFunction(), getRightValuename(), getRightExact() ); current.setNegated( isNegated() ); setNegated( false ); list.add( current ); } else { // Set default operator if not on first position... if ( isComposite() && list.size() > 0 && cb.getOperator() == OPERATOR_NONE ) { cb.setOperator( OPERATOR_AND ); } } list.add( cb ); }
public void addCondition( int idx, Condition cb ) { if ( isAtomic() && getLeftValuename() != null ) { /* * Copy current atomic setup... */ Condition current = new Condition( getLeftValuename(), getFunction(), getRightValuename(), getRightExact() ); current.setNegated( isNegated() ); setNegated( false ); list.add( current ); } else { // Set default operator if not on first position... if ( isComposite() && idx > 0 && cb.getOperator() == OPERATOR_NONE ) { cb.setOperator( OPERATOR_AND ); } } list.add( idx, cb ); }
/** * This method moves up atomic conditions if there is only one sub-condition. * * @return true if there was a simplification. */ public boolean simplify() { if ( nrConditions() == 1 ) { Condition condition = getCondition( 0 ); if ( condition.isAtomic() ) { return simplify( condition, this ); } } boolean changed = false; for ( int i = 0; i < nrConditions(); i++ ) { Condition condition = getCondition( i ); changed |= condition.simplify(); if ( i == 0 ) { condition.setOperator( OPERATOR_NONE ); } } return changed; }
setOperator( getOperator( str_operator ) );
String comparator = XMLHandler.getTagValue( knode, "condition" ); condition.setOperator( Condition.OPERATOR_NONE ); condition.setLeftValuename( key ); condition.setFunction( Condition.getFunction( comparator ) ); subc.setOperator( Condition.OPERATOR_OR ); } else { subc.setOperator( Condition.OPERATOR_NONE );
if ( r != null ) { condition.setNegated( r.getBoolean( "NEGATED", false ) ); condition.setOperator( Condition.getOperator( r.getString( "OPERATOR", null ) ) );
if ( selection != null ) { int opnr = Condition.getOperator( selection ); active_condition.getCondition( operator ).setOperator( opnr ); setModified();
condition.setOperator( convertOperator( constraint.orig.getCombinationType() ) ); condition.setFunction( Condition.FUNC_EQUAL ); condition.setRightExact( new ValueMetaAndData( "dummy", true ) ); //$NON-NLS-1$ condition.setOperator( convertOperator( constraint.orig.getCombinationType() ) ); condition.setFunction( Condition.FUNC_EQUAL ); condition.setRightExact( new ValueMetaAndData( "dummy", true ) ); //$NON-NLS-1$