This provides a way to wrap functionality around components and labels.
Example uses include changing the color when validation fails, or attaching a right-click popup menu.
697071727374757677
this.interceptors = interceptors; } public void processLabel(String propertyName, JComponent label) { for (Iterator i = interceptors.iterator(); i.hasNext();) { FormComponentInterceptor interceptor = ((FormComponentInterceptor)i.next()); interceptor.processLabel(propertyName, label); } }
767778798081828384
} } public void processComponent(String propertyName, JComponent component) { for (Iterator i = interceptors.iterator(); i.hasNext();) { FormComponentInterceptor interceptor = ((FormComponentInterceptor)i.next()); interceptor.processComponent(propertyName, component); } }
5152535455565758596061
} private List getInterceptors(FormModel formModel) { List interceptors = new ArrayList(); for (Iterator i = interceptorFactories.iterator(); i.hasNext();) { FormComponentInterceptor interceptor = ((FormComponentInterceptorFactory)i.next()) .getInterceptor(formModel); if (interceptor != null) { interceptors.add(interceptor); } }