addAndCopy.setDialog( dialog );
final JTextFieldFormField labelField = ( JTextFieldFormField )dialog.getFormField( AddParameterDialog.LABEL );
labelField.getComponent().setColumns( 30 );
labelField.setEnabled( false );
JComboBoxFormField nameField = ( JComboBoxFormField )dialog.getFormField( AddParameterDialog.NAME );
enablePathField( false );
nameField.addFormFieldListener( new XFormFieldListener()
{
@Override
public void valueChanged( XFormField sourceField, String newValue, String oldValue )
{
if( !newValue.equals( CHOOSE_TEST_PROPERTY ) )
{
labelField.setEnabled( true );
enablePathField( true );
}
else
{
labelField.setEnabled( false );
enablePathField( false );
}
}
} );
ArrayList<String> options = new ArrayList<String>();
options.add( CHOOSE_TEST_PROPERTY );
options.addAll( properties.keySet() );
nameField.setOptions( options.toArray( new String[0] ) );
( ( JFormDialog )dialog ).getDialog().setResizable( false );
return dialog;
}