Search in sources :

Example 1 with LinkFeatureEditor

use of de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.editor.LinkFeatureEditor in project webanno by webanno.

the class SlotFeatureSupport method createEditor.

@Override
public FeatureEditor createEditor(String aId, MarkupContainer aOwner, AnnotationActionHandler aHandler, final IModel<AnnotatorState> aStateModel, final IModel<FeatureState> aFeatureStateModel) {
    FeatureState featureState = aFeatureStateModel.getObject();
    final FeatureEditor editor;
    switch(featureState.feature.getMultiValueMode()) {
        case ARRAY:
            switch(featureState.feature.getLinkMode()) {
                case WITH_ROLE:
                    editor = new LinkFeatureEditor(aId, aOwner, aHandler, aStateModel, aFeatureStateModel);
                    break;
                default:
                    throw unsupportedFeatureTypeException(featureState);
            }
            break;
        case NONE:
            throw unsupportedLinkModeException(featureState);
        default:
            throw unsupportedMultiValueModeException(featureState);
    }
    return editor;
}
Also used : LinkFeatureEditor(de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.editor.LinkFeatureEditor) FeatureState(de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.FeatureState) LinkFeatureEditor(de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.editor.LinkFeatureEditor) FeatureEditor(de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.editor.FeatureEditor)

Aggregations

FeatureEditor (de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.editor.FeatureEditor)1 LinkFeatureEditor (de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.editor.LinkFeatureEditor)1 FeatureState (de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.FeatureState)1