throw new WrongValueException(buttonCreateAndAssign,
_("you do not have permissions to create new labels"));
}
// Check LabelType is not null
final Comboitem comboitem = cbLabelType.getSelectedItem();
if (comboitem == null || comboitem.getValue() == null) {
throw new WrongValueException(cbLabelType,
_("please, select an item"));
}
// Check Label is not null or empty
final String labelName = txtLabelName.getValue();
if (labelName == null || labelName.isEmpty()) {
throw new WrongValueException(txtLabelName,
_("cannot be empty"));
}
// Label does not exist, create
final LabelType labelType = (LabelType) comboitem.getValue();
Label label = getModel().findLabelByNameAndType(
labelName, labelType);
if (label == null) {
label = addLabel(labelName, labelType);
} else {