private void jAddProfileButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jAddProfileButtonActionPerformed
final AddNewProfilePanel panel = new AddNewProfilePanel();
panel.startValidation();
final DialogDescriptor dlgDescriptor = new DialogDescriptor(
panel,
NbStrings.getAddNewProfileCaption(),
true,
new Object[]{DialogDescriptor.OK_OPTION, DialogDescriptor.CANCEL_OPTION},
DialogDescriptor.OK_OPTION,
DialogDescriptor.BOTTOM_ALIGN,
null,
null);
final org.jtrim.property.PropertySource<Boolean> validProfileName = panel.validProfileName();
validProfileName.addChangeListener(new Runnable() {
@Override
public void run() {
dlgDescriptor.setValid(validProfileName.getValue());
}
});
dlgDescriptor.setValid(validProfileName.getValue());
Dialog dlg = DialogDisplayer.getDefault().createDialog(dlgDescriptor);
dlg.pack();
dlg.setVisible(true);
if (DialogDescriptor.OK_OPTION != dlgDescriptor.getValue()) {
return;
}
String profileName = panel.getProfileName();
if (profileName.isEmpty()) {