selection = comboBox.getSelectionIndex( );  Object newValue = null; if ( selection == -1 ) { newValue = comboBox.getText( ); } else { newValue = comboBox.getItem( selection ); }  if ( newValue != null ) { boolean newValidState = isCorrect( newValue ); if ( newValidState ) { doSetValue( newValue ); markDirty( ); } else {    } }
	void applyEditorValueAndDeactivate( )	{		inProcessing = 1;		if ( selection != comboBox.getSelectionIndex( ) )		{			markDirty( );		}		//	must set the selection before getting value		selection = comboBox.getSelectionIndex( );		Object newValue = null;		if ( selection == -1 )		{			newValue = comboBox.getText( );		}		else		{			newValue = comboBox.getItem( selection );		}		if ( newValue != null )		{			boolean newValidState = isCorrect( newValue );			if ( newValidState )			{				doSetValue( newValue );				markDirty( );			}			else			{				// try to insert the current value into the error message.				//setErrorMessage(MessageFormat.format(getErrorMessage(), new				// Object[] { newValue.toString()}));			}		}		fireApplyEditorValue( );		deactivate( );		inProcessing = 0;	}