当前位置: 首页>>代码示例>>Java>>正文


Java AnnotationDefinition.getValuePair方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:18,代码来源:AdvancedAnnotationListEditor.java

示例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.
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:24,代码来源:ValuePairEditorPageTest.java

示例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);
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:34,代码来源:ValuePairEditorPageTest.java

示例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);
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:33,代码来源:ValuePairEditorPageTest.java

示例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;
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:8,代码来源:NumericValuePairEditorBaseTest.java


注:本文中的org.kie.workbench.common.services.datamodeller.core.AnnotationDefinition.getValuePair方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。