Search in sources :

Example 6 with EditorModelContent

use of org.kie.workbench.common.screens.datamodeller.model.EditorModelContent in project kie-wb-common by kiegroup.

the class DataModelerScreenPresenterTestBase method createContent.

protected EditorModelContent createContent(boolean includeTypesInfo, boolean addParseErrors) {
    EditorModelContent content = new EditorModelContent();
    content.setDataObject(testObject1);
    content.setDataModel(testModel);
    content.setSource(testSource);
    content.setOriginalClassName(testObject1.getClassName());
    content.setOriginalPackageName(testObject1.getPackageName());
    content.setPath(path);
    content.setCurrentModule(kieModule);
    content.setCurrentModulePackages(testPackages);
    content.setOverview(overview);
    if (includeTypesInfo) {
        content.setAnnotationDefinitions(testAnnotationDefs);
        content.setPropertyTypes(testTypeDefs);
    }
    if (addParseErrors) {
        content.setErrors(testErrors);
    }
    return content;
}
Also used : EditorModelContent(org.kie.workbench.common.screens.datamodeller.model.EditorModelContent)

Example 7 with EditorModelContent

use of org.kie.workbench.common.screens.datamodeller.model.EditorModelContent in project kie-wb-common by kiegroup.

the class SourceEditorReadOnlyTest method setUp.

@Before
@Override
public void setUp() throws Exception {
    super.setUp();
    final boolean loadTypesInfo = true;
    EditorModelContent content = createContent(loadTypesInfo, false);
    when(versionRecordManager.getCurrentPath()).thenReturn(path);
    when(modelerService.loadContent(path, loadTypesInfo)).thenReturn(content);
    when(javaSourceEditor.getContent()).thenReturn(content.getSource());
    // access modification related setup
    when(sessionInfo.getIdentity()).thenReturn(user);
}
Also used : EditorModelContent(org.kie.workbench.common.screens.datamodeller.model.EditorModelContent) Before(org.junit.Before)

Example 8 with EditorModelContent

use of org.kie.workbench.common.screens.datamodeller.model.EditorModelContent in project kie-wb-common by kiegroup.

the class DataModelerEditorsTestHelper method createTestContext.

public static DataModelerContext createTestContext() {
    DataModelerContext context = new DataModelerContext("123456789");
    context.init(PropertyTypeFactoryImpl.getInstance().getBasePropertyTypes());
    List<AnnotationDefinition> commonAnnotations = CommonAnnotations.getCommonAnnotations();
    Map<String, AnnotationDefinition> annotationDefinitions = new HashMap<String, AnnotationDefinition>();
    for (AnnotationDefinition annotationDefinition : commonAnnotations) {
        annotationDefinitions.put(annotationDefinition.getClassName(), annotationDefinition);
    }
    context.setAnnotationDefinitions(annotationDefinitions);
    EditorModelContent content = new EditorModelContent();
    content.setDataModel(createTestModel());
    content.setCurrentModule(new KieModule());
    context.setEditorModelContent(content);
    return context;
}
Also used : AnnotationDefinition(org.kie.workbench.common.services.datamodeller.core.AnnotationDefinition) HashMap(java.util.HashMap) EditorModelContent(org.kie.workbench.common.screens.datamodeller.model.EditorModelContent) DataModelerContext(org.kie.workbench.common.screens.datamodeller.client.DataModelerContext) KieModule(org.kie.workbench.common.services.shared.project.KieModule)

Aggregations

EditorModelContent (org.kie.workbench.common.screens.datamodeller.model.EditorModelContent)8 UnpublishMessagesEvent (org.guvnor.messageconsole.events.UnpublishMessagesEvent)2 Before (org.junit.Before)2 DataModelerWorkbenchFocusEvent (org.kie.workbench.common.screens.datamodeller.client.context.DataModelerWorkbenchFocusEvent)2 KieModule (org.kie.workbench.common.services.shared.project.KieModule)2 HashMap (java.util.HashMap)1 PublishBatchMessagesEvent (org.guvnor.messageconsole.events.PublishBatchMessagesEvent)1 DataModelerContext (org.kie.workbench.common.screens.datamodeller.client.DataModelerContext)1 ServiceException (org.kie.workbench.common.screens.datamodeller.service.ServiceException)1 AnnotationDefinition (org.kie.workbench.common.services.datamodeller.core.AnnotationDefinition)1 DataModel (org.kie.workbench.common.services.datamodeller.core.DataModel)1 ModelDriverException (org.kie.workbench.common.services.datamodeller.driver.ModelDriverException)1 ModelDriverResult (org.kie.workbench.common.services.datamodeller.driver.model.ModelDriverResult)1 FileAlreadyExistsException (org.uberfire.java.nio.file.FileAlreadyExistsException)1 Command (org.uberfire.mvp.Command)1 ParameterizedCommand (org.uberfire.mvp.ParameterizedCommand)1