if (res == JOptionPane.OK_OPTION) {
if (tfName.getText().isEmpty() || tfGroupCode.getText().isEmpty()) {
MessageBox.showWarning(MessageBox.W_INCORRECT_DATA);
return;
} else {
ClassificationAtcDetails details = new ClassificationAtcDetails();
details.title = tfName.getText();
details.groupCode = tfGroupCode.getText();
details.parentItem = selected.getID();
newItem = new DirectoryVidalAtcItem(details);
selected.getItems().append(newItem);
}
}
} else {
tfGroupCodePref.setText("");
tfName.setText("");
tfGroupCode.setText("");
int res = JOptionPane.showConfirmDialog(null, pnlNewNode, "Заполните поля", JOptionPane.OK_CANCEL_OPTION, -1);
if (res == JOptionPane.OK_OPTION) {
if (tfName.getText().isEmpty() || tfGroupCode.getText().isEmpty()) {
MessageBox.showWarning(MessageBox.W_INCORRECT_DATA);
return;
} else {
ClassificationAtcDetails details = new ClassificationAtcDetails();
details.title = tfName.getText();
details.groupCode = tfGroupCode.getText();
newItem = new DirectoryVidalAtcItem(details);
directoryVidalAtc.getItems().append(newItem);
}