Just in case it was an oversight...
Code:
Index: DefaultViewDescriptor.java
===================================================================
RCS file: /cvsroot/spring-rich-c/spring-richclient/src/org/springframework/richclient/application/support/DefaultViewDescriptor.java,v
retrieving revision 1.9
diff -u -r1.9 DefaultViewDescriptor.java
--- DefaultViewDescriptor.java 12 Nov 2004 02:36:53 -0000 1.9
+++ DefaultViewDescriptor.java 19 Dec 2004 07:17:07 -0000
@@ -23,6 +23,8 @@
import org.springframework.beans.factory.BeanInitializationException;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.InitializingBean;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ApplicationEventMulticaster;
import org.springframework.context.support.AbstractApplicationContext;
@@ -97,9 +99,14 @@
}
getApplicationEventMulticaster().addApplicationListener((ApplicationListener)view);
}
- if (viewProperties != null) {
- BeanWrapper wrapper = new BeanWrapperImpl(view);
- wrapper.setPropertyValues(viewProperties);
+ setPropertyValues (view, viewProperties);
+
+ if (view instanceof ApplicationEventPublisherAware) {
+ ((ApplicationEventPublisherAware) view).setApplicationEventPublisher( getApplicationContext() );
+ }
+
+ if (view instanceof ApplicationContextAware) {
+ ((ApplicationContextAware) view).setApplicationContext( getApplicationContext() );
}
if (view instanceof InitializingBean) {
@@ -113,6 +120,13 @@
return view;
}
+ protected void setPropertyValues( View view, Map properties ) {
+ if (properties != null) {
+ BeanWrapper wrapper = new BeanWrapperImpl(view);
+ wrapper.setPropertyValues(properties);
+ }
+ }
+
public CommandButtonLabelInfo getShowViewCommandLabel() {
return getLabel();
}