use of org.openforis.collect.designer.util.MessageUtil.ConfirmParams in project collect by openforis.
the class CodeAttributeVM method confirmCodeListChange.
private void confirmCodeListChange(final Binder binder, final CodeList list) {
CodeList oldList = ((CodeAttributeDefinitionFormObject) getFormObject()).getList();
ConfirmParams confirmParams = new ConfirmParams(new MessageUtil.ConfirmHandler() {
@Override
public void onOk() {
performListChange(binder, list);
}
}, "survey.schema.attribute.code.confirm_change_list.message");
confirmParams.setOkLabelKey("global.change");
confirmParams.setCancelLabelKey("global.leave_original_value");
confirmParams.setMessageArgs(new String[] { oldList.getName(), list.getName() });
MessageUtil.showConfirm(confirmParams);
}
use of org.openforis.collect.designer.util.MessageUtil.ConfirmParams in project collect by openforis.
the class SurveyLanguageVM method applyChanges.
@Command
public void applyChanges() {
final SessionStatus sessionStatus = getSessionStatus();
final CollectSurvey survey = sessionStatus.getSurvey();
final List<String> newLanguageCodes = getSelectedLanguageCodes();
final List<String> removedLanguages = calculateRemovedLanguages();
if (removedLanguages.isEmpty()) {
performLanguageUpdate(survey, newLanguageCodes);
} else {
ConfirmParams confirmParams = new ConfirmParams(new MessageUtil.ConfirmHandler() {
@Override
public void onOk() {
performLanguageUpdate(survey, newLanguageCodes);
}
}, "survey.language.remove.confirm");
confirmParams.setOkLabelKey("global.remove_item");
confirmParams.setMessageArgs(new String[] { StringUtils.join(removedLanguages, ", ") });
MessageUtil.showConfirm(confirmParams);
}
}
use of org.openforis.collect.designer.util.MessageUtil.ConfirmParams in project collect by openforis.
the class AttributeVM method deleteCheck.
@Command
public void deleteCheck() {
ConfirmParams params = new MessageUtil.ConfirmParams(new MessageUtil.ConfirmHandler() {
@Override
public void onOk() {
editedItem.removeCheck(selectedCheck);
selectedCheck = null;
initChecks();
notifyChange("selectedCheck", "checks");
}
}, "survey.schema.node.check.confirm_delete");
params.setOkLabelKey("global.delete_item");
MessageUtil.showConfirm(params);
}
use of org.openforis.collect.designer.util.MessageUtil.ConfirmParams in project collect by openforis.
the class AttributeVM method deleteAttributeDefault.
@Command
@NotifyChange({ "selectedAttributeDefault", "attributeDefaults" })
public void deleteAttributeDefault() {
ConfirmParams params = new MessageUtil.ConfirmParams(new MessageUtil.ConfirmHandler() {
@Override
public void onOk() {
editedItem.removeAttributeDefault(selectedAttributeDefault);
selectedAttributeDefault = null;
initAttributeDefaults();
notifyChange("selectedAttributeDefault", "attributeDefaults");
}
}, "survey.schema.attribute.attribute_default.confirm_delete");
params.setOkLabelKey("global.delete_item");
MessageUtil.showConfirm(params);
}
use of org.openforis.collect.designer.util.MessageUtil.ConfirmParams in project collect by openforis.
the class CodeAttributeVM method confirmParentCodeListChange.
private void confirmParentCodeListChange(final Binder binder, final CodeList list) {
ConfirmParams confirmParams = new ConfirmParams(new MessageUtil.CompleteConfirmHandler() {
@Override
public void onOk() {
performListChange(binder, list);
}
@Override
public void onCancel() {
CodeList oldList = editedItem.getList();
setFormFieldValue(binder, "list", oldList);
setTempFormObjectFieldValue("list", oldList);
}
}, "survey.schema.attribute.code.confirm_change_list_on_referenced_node.message");
confirmParams.setOkLabelKey("survey.schema.attribute.code.confirm_change_list_on_referenced_node.ok");
confirmParams.setTitleKey("survey.schema.attribute.code.confirm_change_list_on_referenced_node.title");
List<String> dependentAttributePaths = new ArrayList<String>();
for (CodeAttributeDefinition codeAttributeDefinition : editedItem.getDependentCodeAttributeDefinitions()) {
dependentAttributePaths.add(codeAttributeDefinition.getPath());
}
confirmParams.setMessageArgs(new String[] { StringUtils.join(dependentAttributePaths, ", ") });
MessageUtil.showConfirm(confirmParams);
}
Aggregations