if (res == JOptionPane.OK_OPTION) {
if (tfName.getText().isEmpty() || tfGroupCode.getText().isEmpty()) {
MessageBox.showWarning(MessageBox.W_INCORRECT_DATA);
return;
} else {
ServiceGroupDetails details = new ServiceGroupDetails();
details.title = tfName.getText();
details.code = tfGroupCode.getText();
details.parentItem = selected.getID();
newItem = new DirectoryServicesGroupItem(details);
selected.getItems().append(newItem);
treeServiceGroup.updateUI();
treeServiceGroup.expandPath(treeServiceGroup.getSelectionPath());
}
}
} else {
tfGroupCodePref.setText("");
tfName.setText("");
tfGroupCode.setText("");
int res = JOptionPane.showOptionDialog(this, pnlNewNode, "Заполните поля", JOptionPane.OK_CANCEL_OPTION,
JOptionPane.PLAIN_MESSAGE, null, a, -1);
if (res == JOptionPane.OK_OPTION) {
if (tfName.getText().isEmpty() || tfGroupCode.getText().isEmpty()) {
MessageBox.showWarning(MessageBox.W_INCORRECT_DATA);
return;
} else {
ServiceGroupDetails details = new ServiceGroupDetails();
details.title = tfName.getText();
details.code = tfGroupCode.getText();
newItem = new DirectoryServicesGroupItem(details);
DirectoryServicesGroup svc = (DirectoryServicesGroup)
DirectoryLocator.getDirectory(DirectoryServicesGroup.class);