/** * Invoked when tab away, disables the OK button. * * <p> * Assumed to be invoked {@link InteractionInvocationMethod#BY_USER by user}. */ @Override public String isValid(final ObjectAdapter adapter, final Object proposedValue) { if (!(proposedValue instanceof String)) { return null; } final String proposedString = (String) proposedValue; final ObjectActionParameter objectActionParameter = getAction().getParameters().get(getNumber()); if (!(objectActionParameter instanceof ParseableEntryActionParameter)) { return null; } final ParseableEntryActionParameter parameter = (ParseableEntryActionParameter) objectActionParameter; final ObjectSpecification parameterSpecification = parameter.getSpecification(); final ParseableFacet p = parameterSpecification.getFacet(ParseableFacet.class); final ObjectAdapter newValue = p.parseTextEntry(null, proposedString); final ValidityContext<?> ic = parameter.createProposedArgumentInteractionContext(getAuthenticationSession(), InteractionInvocationMethod.BY_USER, adapter, arguments(newValue), getNumber()); final InteractionResultSet buf = new InteractionResultSet(); InteractionUtils.isValidResultSet(parameter, ic, buf); if (buf.isVetoed()) { return buf.getInteractionResult().getReason(); } return null; }