/** * Returns true if the error indicator be hidden when painting the component * even when there are errors. * * This is a mostly internal method, but can be overridden in subclasses * e.g. if the error indicator should also be shown for empty fields in some * cases. * * @return true to hide the error indicator, false to use the normal logic * to show it when there are errors */ protected boolean shouldHideErrors() { // getErrorMessage() can still return something else than null based on // validation etc. return isRequired() && isEmpty() && getComponentError() == null; }