本文整理汇总了Java中org.kie.workbench.common.services.datamodeller.core.AnnotationDefinition.getValuePair方法的典型用法代码示例。如果您正苦于以下问题:Java AnnotationDefinition.getValuePair方法的具体用法?Java AnnotationDefinition.getValuePair怎么用?Java AnnotationDefinition.getValuePair使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kie.workbench.common.services.datamodeller.core.AnnotationDefinition
的用法示例。
在下文中一共展示了AnnotationDefinition.getValuePair方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onClearValuePair
import org.kie.workbench.common.services.datamodeller.core.AnnotationDefinition; //导入方法依赖的package包/类
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);
}
}
示例2: testPageInitialization
import org.kie.workbench.common.services.datamodeller.core.AnnotationDefinition; //导入方法依赖的package包/类
@Test
public void testPageInitialization() {
modelerServiceCaller = new CallerMock<DataModelerService>(modelerService);
ValuePairEditorPage editorPage = new ValuePairEditorPage(view,
valuePairEditorProvider,
modelerServiceCaller,
wizardPageStatusChangeEvent);
editorPage.prepareView();
AnnotationDefinition annotationDefinition = DriverUtils.buildAnnotationDefinition(Entity.class);
AnnotationValuePairDefinition valuePairDefinition = annotationDefinition.getValuePair("name");
when(valuePairEditorProvider.getValuePairEditor(valuePairDefinition)).thenReturn(valuePairEditor);
editorPage.init(annotationDefinition, valuePairDefinition, ElementType.FIELD,
kieModule);
//the view should be properly initialized with the corresponding editor.
verify(view, times(1)).setValuePairEditor(valuePairEditor);
WizardTestUtil.assertPageComplete(true, editorPage); //the "name" value pair is not mandatory, so the page is completed.
}
示例3: testValidValueChange
import org.kie.workbench.common.services.datamodeller.core.AnnotationDefinition; //导入方法依赖的package包/类
@Test
public void testValidValueChange() {
modelerServiceCaller = new CallerMock<DataModelerService>(modelerService);
ValuePairEditorPage editorPage = new ValuePairEditorPage(view,
valuePairEditorProvider,
modelerServiceCaller,
wizardPageStatusChangeEvent);
editorPage.prepareView();
AnnotationDefinition annotationDefinition = DriverUtils.buildAnnotationDefinition(Entity.class);
AnnotationValuePairDefinition valuePairDefinition = annotationDefinition.getValuePair("name");
when(valuePairEditorProvider.getValuePairEditor(valuePairDefinition)).thenReturn(valuePairEditor);
editorPage.init(annotationDefinition, valuePairDefinition, ElementType.FIELD,
kieModule);
//emulate a change in the internal ValuePairEditor with a valid value.
when(view.getValuePairEditor()).thenReturn(valuePairEditor);
when(valuePairEditor.getValue()).thenReturn("TheEntityName");
when(valuePairEditor.isValid()).thenReturn(true);
editorPage.onValueChange();
//the view should be properly initialized with the corresponding editor.
verify(view, times(1)).setValuePairEditor(valuePairEditor);
verify(valuePairEditor, times(1)).getValue();
verify(valuePairEditor, times(1)).isValid();
assertEquals("TheEntityName", editorPage.getCurrentValue());
WizardTestUtil.assertPageComplete(true, editorPage);
}
示例4: testInvalidValueChange
import org.kie.workbench.common.services.datamodeller.core.AnnotationDefinition; //导入方法依赖的package包/类
@Test
public void testInvalidValueChange() {
modelerServiceCaller = new CallerMock<DataModelerService>(modelerService);
ValuePairEditorPage editorPage = new ValuePairEditorPage(view,
valuePairEditorProvider,
modelerServiceCaller,
wizardPageStatusChangeEvent);
editorPage.prepareView();
AnnotationDefinition annotationDefinition = DriverUtils.buildAnnotationDefinition(Entity.class);
AnnotationValuePairDefinition valuePairDefinition = annotationDefinition.getValuePair("name");
when(valuePairEditorProvider.getValuePairEditor(valuePairDefinition)).thenReturn(valuePairEditor);
editorPage.init(annotationDefinition, valuePairDefinition, ElementType.FIELD,
kieModule);
//emulate a change in the internal ValuePairEditor with a valid value.
when(view.getValuePairEditor()).thenReturn(valuePairEditor);
when(valuePairEditor.getValue()).thenReturn(null);
when(valuePairEditor.isValid()).thenReturn(false);
editorPage.onValueChange();
//the view should be properly initialized with the corresponding editor.
verify(view, times(1)).setValuePairEditor(valuePairEditor);
verify(valuePairEditor, times(1)).getValue();
verify(valuePairEditor, times(1)).isValid();
WizardTestUtil.assertPageComplete(false, editorPage);
}
示例5: createEditor
import org.kie.workbench.common.services.datamodeller.core.AnnotationDefinition; //导入方法依赖的package包/类
protected NumericValuePairEditor createEditor( NumberType numberType, String paramName ) {
NumericValuePairEditor numericEditor = new NumericValuePairEditor( singleEditorView );
AnnotationDefinition annotationDefinition = createAnnotationDefinition( numberType );
AnnotationValuePairDefinition valuePairDefinition = annotationDefinition.getValuePair( paramName );
numericEditor.init( valuePairDefinition );
return numericEditor;
}