class ConditionEditorFieldEditorPresenter extends FieldEditorPresenter<ScriptTypeValue> {

    @Override
    public void setValue(ScriptTypeValue value) {
        super.setValue(value);
        scriptEditor.setValue(value);
        simpleConditionEditor.clear();
        clearError();
        if (value != null) {
            if (isInDefaultLanguage(value) && !isServiceAvailable()) {
                if (!isEmpty(value.getScript())) {
                    conditionEditorParsingService
                            .call(value.getScript())
                            .then(result -> {
                                onSetValue(result);
                                return null;
                            })
                            .catch_(throwable -> {
                                onSetValueError((Throwable) throwable);
                                return null;
                            });
                } else {
                    showSimpleConditionEditor();
                }
            } else {
                showScriptEditor();
            }
        } else {
            simpleConditionEditor.setValue(null);
            showSimpleConditionEditor();
        }
    }

    @Inject public  ConditionEditorFieldEditorPresenter(final View view,
                                               final SimpleConditionEditorPresenter simpleConditionEditor,
                                               final ScriptTypeFieldEditorPresenter scriptEditor,
                                               final ErrorPopupPresenter errorPopup,
                                               final ConditionEditorParsingService conditionEditorParsingService,
                                               final ConditionEditorGeneratorService conditionEditorGeneratorService,
                                               final ClientTranslationService translationService);

}