Revision: 1664 http://svn.sourceforge.net/spring-rich-c/?rev=1664&view=rev Author: kevinstembridge Date: 2007-01-15 08:41:06 -0800 (Mon, 15 Jan 2007)
Log Message: ----------- Put no-arg constructor back in and now implement InitializingBean to check for applicationWindow and viewDescriptor properties. See RCP-452. Modified Paths: -------------- trunk/spring-richclient/support/src/main/java/org/springframework/richclient/command/support/ShowViewCommand.java Modified: trunk/spring-richclient/support/src/main/java/org/springframework/richclient/command/support/ShowViewCommand.java =================================================================== --- trunk/spring-richclient/support/src/main/java/org/springframework/richclient/command/support/ShowViewCommand.java 2007-01-15 13:25:46 UTC (rev 1663) +++ trunk/spring-richclient/support/src/main/java/org/springframework/richclient/command/support/ShowViewCommand.java 2007-01-15 16:41:06 UTC (rev 1664) @@ -15,17 +15,27 @@ */ package org.springframework.richclient.command.support; +import org.springframework.beans.factory.InitializingBean; import org.springframework.richclient.application.ApplicationWindow; +import org.springframework.richclient.application.PropertyNotSetException; import org.springframework.richclient.application.View; import org.springframework.richclient.application.ViewDescriptor; import org.springframework.richclient.util.Assert; /** - * An action command for displaying a [EMAIL PROTECTED] View} based on the provided [EMAIL PROTECTED] ViewDescriptor}. + * An action command for displaying a [EMAIL PROTECTED] View} based on a provided [EMAIL PROTECTED] ViewDescriptor}. */ -public class ShowViewCommand extends ApplicationWindowAwareCommand { +public class ShowViewCommand extends ApplicationWindowAwareCommand implements InitializingBean { private ViewDescriptor viewDescriptor; + + /** + * Creates a new uninitialized [EMAIL PROTECTED] ShowViewCommand}. The [EMAIL PROTECTED] applicationWindow} and + * [EMAIL PROTECTED] viewDescriptor} properties must be set before using the new instance. + */ + public ShowViewCommand() { + //do nothing + } /** * Creates a new [EMAIL PROTECTED] ShowViewCommand} with the given view descriptor and associated @@ -44,6 +54,14 @@ setApplicationWindow(applicationWindow); setEnabled(true); } + + /** + * [EMAIL PROTECTED] + */ + public void afterPropertiesSet() { + PropertyNotSetException.throwIfNull(getApplicationWindow(), "applicationWindow", getClass()); + PropertyNotSetException.throwIfNull(this.viewDescriptor, "viewDescriptor", getClass()); + } /** * Sets the descriptor for the view that is to be opened by this command object. This This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ spring-rich-c-cvs mailing list spring-rich-c-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spring-rich-c-cvs