use of org.kie.workbench.common.services.datamodeller.core.AnnotationValuePairDefinition in project kie-wb-common by kiegroup.
the class StringValuePairEditorTest method testEditorLoad.
@Test
public void testEditorLoad() {
StringValuePairEditor stringEditor = new StringValuePairEditor(view);
AnnotationValuePairDefinition valuePairDefinition = annotationDefinition.getValuePair("stringParam1");
stringEditor.init(valuePairDefinition);
verify(view, times(1)).setValuePairLabel(valuePairDefinition.getName());
verify(view, times(1)).showValuePairRequiredIndicator(false);
}
use of org.kie.workbench.common.services.datamodeller.core.AnnotationValuePairDefinition in project kie-wb-common by kiegroup.
the class AdvancedAnnotationListEditor method onClearValuePair.
protected void onClearValuePair(Annotation annotation, String valuePair) {
AnnotationDefinition annotationDefinition = annotation.getAnnotationDefinition();
AnnotationValuePairDefinition valuePairDefinition = annotationDefinition.getValuePair(valuePair);
if (valuePairDefinition.getDefaultValue() == null) {
// if the value pair has no default value, it should be applied wherever the annotation is applied, if not
// the resulting code won't compile.
String message = Constants.INSTANCE.advanced_domain_annotation_list_editor_message_value_pair_has_no_default_value(valuePair, annotation.getClassName());
view.showYesNoDialog(message, getNoActionCommand());
} else if (clearValuePairHandler != null) {
clearValuePairHandler.onClearValuePair(annotation, valuePair);
}
}
use of org.kie.workbench.common.services.datamodeller.core.AnnotationValuePairDefinition in project kie-wb-common by kiegroup.
the class CreateAnnotationWizard method updateValuePairPages.
private void updateValuePairPages(AnnotationDefinition annotationDefinition) {
clearCurrentValuePairEditorPages();
pages.clear();
pages.add(searchAnnotationPage);
this.annotationDefinition = annotationDefinition;
if (annotationDefinition != null) {
for (AnnotationValuePairDefinition valuePairDefinition : annotationDefinition.getValuePairs()) {
pages.add(createValuePairEditorPage(valuePairDefinition));
}
}
super.start();
}
Aggregations