/** * Add a sub-condition to the active condition... * * @param condition * The condition to which we want to add one more. */ private void addCondition( Condition condition ) { active_condition.addCondition( condition ); }
@Override public void widgetSelected( SelectionEvent e ) { Condition up = active_condition.getCondition( cond_nr ); active_condition.removeCondition( cond_nr ); active_condition.addCondition( cond_nr - 1, up ); widget.redraw(); } } );
@Override public void widgetSelected( SelectionEvent e ) { Condition down = active_condition.getCondition( cond_nr ); active_condition.removeCondition( cond_nr ); active_condition.addCondition( cond_nr + 1, down ); widget.redraw(); } } );
@Override public void widgetSelected( SelectionEvent e ) { // Move the condition lower: this means delete the condition from the active_condition. // After that, move it to the parent. Condition up = active_condition.getCondition( cond_nr ); active_condition.removeCondition( cond_nr ); Condition parent = parents.get( getLevel() - 1 ); parent.addCondition( up ); // Take a look upward... goUp(); 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 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(); } } );
@Override public Object clone() { Condition retval = null; retval = new Condition(); retval.negate = negate; retval.operator = operator; if ( isComposite() ) { for ( int i = 0; i < nrConditions(); i++ ) { Condition c = getCondition( i ); Condition cCopy = (Condition) c.clone(); retval.addCondition( cCopy ); } } else { retval.negate = negate; retval.left_valuename = left_valuename; retval.operator = operator; retval.right_valuename = right_valuename; retval.function = function; if ( right_exact != null ) { retval.right_exact = (ValueMetaAndData) right_exact.clone(); } else { retval.right_exact = null; } } return retval; }
Node subcondnode = XMLHandler.getSubNodeByNr( conditions, "condition", i ); Condition c = new Condition( subcondnode ); addCondition( c );
@Override public void widgetSelected( SelectionEvent e ) { String xml = GUIResource.getInstance().fromClipboard(); try { Document d = XMLHandler.loadXMLString( xml ); Node condNode = XMLHandler.getSubNode( d, "condition" ); if ( condNode != null ) { Condition c = new Condition( condNode ); active_condition.addCondition( cond_nr, c ); widget.redraw(); } else { new ErrorDialog( shell, BaseMessages.getString( PKG, "ConditionEditor.Error" ), BaseMessages .getString( PKG, "ConditionEditor.NoConditionFoundXML" ), new KettleXMLException( BaseMessages .getString( PKG, "ConditionEditor.NoConditionFoundXML.Exception", Const.CR + Const.CR + xml ) ) ); } } catch ( KettleXMLException ex ) { new ErrorDialog( shell, BaseMessages.getString( PKG, "ConditionEditor.Error" ), BaseMessages .getString( PKG, "ConditionEditor.ErrorParsingCondition" ), ex ); } } } );
@Override public void widgetSelected( SelectionEvent e ) { String xml = GUIResource.getInstance().fromClipboard(); try { Document d = XMLHandler.loadXMLString( xml ); Node condNode = XMLHandler.getSubNode( d, "condition" ); if ( condNode != null ) { Condition c = new Condition( condNode ); active_condition.addCondition( cond_nr + 1, c ); widget.redraw(); } else { new ErrorDialog( shell, BaseMessages.getString( PKG, "ConditionEditor.Error" ), BaseMessages .getString( PKG, "ConditionEditor.NoConditionFoundXML" ), new KettleXMLException( BaseMessages .getString( PKG, "ConditionEditor.NoConditionFoundXML.Exception", Const.CR + Const.CR + xml ) ) ); } } catch ( KettleXMLException ex ) { new ErrorDialog( shell, BaseMessages.getString( PKG, "ConditionEditor.Error" ), BaseMessages .getString( PKG, "ConditionEditor.ErrorParsingCondition" ), ex ); } } } );
condition.addCondition( loadCondition( subids[i] ) );
subc.setRightExact( new ValueMetaAndData( "value", value ) ); condition.addCondition( subc );
condition.setFunction( Condition.FUNC_EQUAL ); condition.setRightExact( new ValueMetaAndData( "dummy", true ) ); //$NON-NLS-1$ rootCondition.addCondition( condition ); c++; condition.setFunction( Condition.FUNC_EQUAL ); condition.setRightExact( new ValueMetaAndData( "dummy", true ) ); //$NON-NLS-1$ rootCondition2.addCondition( condition ); c++;