Search in sources :

Example 21 with AnnotationDefinition

use of org.kie.workbench.common.services.datamodeller.core.AnnotationDefinition 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);
    }
}
Also used : AnnotationDefinition(org.kie.workbench.common.services.datamodeller.core.AnnotationDefinition) AnnotationValuePairDefinition(org.kie.workbench.common.services.datamodeller.core.AnnotationValuePairDefinition)

Aggregations

AnnotationDefinition (org.kie.workbench.common.services.datamodeller.core.AnnotationDefinition)21 AnnotationValuePairDefinition (org.kie.workbench.common.services.datamodeller.core.AnnotationValuePairDefinition)8 Annotation (org.kie.workbench.common.services.datamodeller.core.Annotation)6 DataObject (org.kie.workbench.common.services.datamodeller.core.DataObject)5 HashMap (java.util.HashMap)4 Test (org.junit.Test)4 AnnotationImpl (org.kie.workbench.common.services.datamodeller.core.impl.AnnotationImpl)4 DataModelerService (org.kie.workbench.common.screens.datamodeller.service.DataModelerService)3 ArrayList (java.util.ArrayList)2 AnnotationSource (org.jboss.forge.roaster.model.source.AnnotationSource)2 AnnotationDriver (org.kie.workbench.common.services.datamodeller.driver.AnnotationDriver)2 JavaRoasterModelDriver (org.kie.workbench.common.services.datamodeller.driver.impl.JavaRoasterModelDriver)2 KieModule (org.kie.workbench.common.services.shared.project.KieModule)2 InputStream (java.io.InputStream)1 List (java.util.List)1 Before (org.junit.Before)1 Description (org.kie.api.definition.type.Description)1 ClassTypeResolver (org.kie.soup.project.datamodel.commons.types.ClassTypeResolver)1 DomainHandler (org.kie.workbench.common.screens.datamodeller.backend.server.handler.DomainHandler)1 DataModelerContext (org.kie.workbench.common.screens.datamodeller.client.DataModelerContext)1