protected void setBehaviorAsStateRule(Boolean state)
	{

		// set visible
		if ( stateRule.isVisible() != null )
		{
			try {
				affectedWidget.setVisible( !( stateRule.isVisible() ^ state ) );
			}
			catch(Exception e) {
				e.printStackTrace();
			}
		}

		// enabled and value setting rules are only valid if not in
		// Cancel Replace mode
		if ( cxlReplaceMode && affectedWidget.getParameter() != null && !affectedWidget.getParameter().isMutableOnCxlRpl() )
		{
			affectedWidget.setEnabled( false );
		}
		else
		{
			// set enabled
			if ( stateRule.isEnabled() != null ){
				affectedWidget.setEnabled( !( stateRule.isEnabled() ^ state ) );
			}

			// set value
			if ( stateRule.getValue() != null )
			{
				if ( state )
				{
					String value = stateRule.getValue();
					affectedWidget.setValueAsString( value );
				}
				//  -- state arg is false and value involved is VALUE_NULL_INDICATOR --
				else if ( Atdl4jConstants.VALUE_NULL_INDICATOR.equals( stateRule.getValue() ) )  
				{
					// -- This resets the widget (other widgets than value="{NULL}") to non-null --
					affectedWidget.setNullValue( Boolean.FALSE );
				}
			}
		}
	}