@Test public void testSetValueNull() { presenter.setValue(null); verifyClear(); assertNull(presenter.getValue()); verify(paramInstance, never()).get(); }
@Override public void setValue(Condition value) { super.setValue(value); clear(); if (value != null) { if (value.getParams().size() >= 1) { String type = variableSearchService.getOptionType(value.getParams().get(0)); if (type != null) { functionSearchService.reload(type, () -> onSetValue(value)); } else { view.setVariableError(translationService.getValue(VARIABLE_NOT_FOUND_ERROR, value.getParams().get(0))); } } else { view.setConditionError(translationService.getValue(CONDITION_MAL_FORMED)); } } }
SimpleConditionEditorPresenter extends FieldEditorPresenter<Condition> { @Override public void setValue(Condition value) { super.setValue(value); clear(); if (value != null) { if (value.getParams().size() >= 1) { String type = variableSearchService.getOptionType(value.getParams().get(0)); if (type != null) { functionSearchService.reload(type, () -> onSetValue(value)); } else { view.setVariableError(translationService.getValue(VARIABLE_NOT_FOUND_ERROR, value.getParams().get(0))); } } else { view.setConditionError(translationService.getValue(CONDITION_MAL_FORMED)); } } } }
SimpleConditionEditorPresenter extends FieldEditorPresenter<Condition> { @Override public void setValue(Condition value) { super.setValue(value); clear(); if (value != null) { if (value.getParams().size() >= 1) { String type = variableSearchService.getOptionType(value.getParams().get(0)); if (type != null) { functionSearchService.reload(type, () -> onSetValue(value)); } else { view.setVariableError(translationService.getValue(VARIABLE_NOT_FOUND_ERROR, value.getParams().get(0))); } } else { view.setConditionError(translationService.getValue(CONDITION_MAL_FORMED)); } } } @Inject  SimpleConditionEditorPresenter(final View view,
                                          final ManagedInstance<ConditionParamPresenter> paramInstance,
                                          final VariableSearchService variableSearchService,
                                          final FunctionSearchService functionSearchService,
                                          final FunctionNamingService functionNamingService,
                                          final ClientTranslationService translationService); }
SimpleConditionEditorPresenter extends FieldEditorPresenter<Condition> { @Override public void setValue(Condition value) { super.setValue(value); clear(); if (value != null) { if (value.getParams().size() >= 1) { String type = variableSearchService.getOptionType(value.getParams().get(0)); if (type != null) { functionSearchService.reload(type, () -> onSetValue(value)); } else { view.setVariableError(translationService.getValue(VARIABLE_NOT_FOUND_ERROR, value.getParams().get(0))); } } else { view.setConditionError(translationService.getValue(CONDITION_MAL_FORMED)); } } } @Inject  SimpleConditionEditorPresenter(final View view,
                                          final ManagedInstance<ConditionParamPresenter> paramInstance,
                                          final VariableSearchService variableSearchService,
                                          final FunctionSearchService functionSearchService,
                                          final FunctionNamingService functionNamingService,
                                          final ClientTranslationService translationService); @PostConstruct void init(); View getView(); void init(ClientSession session); @Override void setValue(Condition value); @Override void setReadOnly(boolean readOnly); void clear(); boolean isValid(); }
SimpleConditionEditorPresenter extends FieldEditorPresenter<Condition> { @Override public void setValue(Condition value) { super.setValue(value); clear(); if (value != null) { if (value.getParams().size() >= 1) { String type = variableSearchService.getOptionType(value.getParams().get(0)); if (type != null) { functionSearchService.reload(type, () -> onSetValue(value)); } else { view.setVariableError(translationService.getValue(VARIABLE_NOT_FOUND_ERROR, value.getParams().get(0))); } } else { view.setConditionError(translationService.getValue(CONDITION_MAL_FORMED)); } } } @Inject  SimpleConditionEditorPresenter(final View view,
                                          final ManagedInstance<ConditionParamPresenter> paramInstance,
                                          final VariableSearchService variableSearchService,
                                          final FunctionSearchService functionSearchService,
                                          final FunctionNamingService functionNamingService,
                                          final ClientTranslationService translationService); @PostConstruct void init(); View getView(); void init(ClientSession session); @Override void setValue(Condition value); @Override void setReadOnly(boolean readOnly); void clear(); boolean isValid();  }