Revision: 1614 http://svn.sourceforge.net/spring-rich-c/?rev=1614&view=rev Author: kevinstembridge Date: 2006-12-28 14:45:56 -0800 (Thu, 28 Dec 2006)
Log Message: ----------- Removed no-args constructor - 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 2006-12-27 22:36:48 UTC (rev 1613) +++ trunk/spring-richclient/support/src/main/java/org/springframework/richclient/command/support/ShowViewCommand.java 2006-12-28 22:45:56 UTC (rev 1614) @@ -25,45 +25,30 @@ */ public class ShowViewCommand extends ApplicationWindowAwareCommand { - /** The identifier of this command. */ - public static final String ID = "showViewCommand"; - private ViewDescriptor viewDescriptor; /** - * Creates a new [EMAIL PROTECTED] ShowViewCommand} with an id of [EMAIL PROTECTED] #ID}. - * The newly created command will be enabled by default. - */ - //FIXME does this class need a no-args constructor? The class cannot operate without a - //view descriptor and once set, the view descriptor ID will override the one set in this - //constructor anyway. - public ShowViewCommand() { - super(ID); - setEnabled(true); - } - - /** * Creates a new [EMAIL PROTECTED] ShowViewCommand} with the given view descriptor and associated * application window. The new instance will have a command identifier equal to the id from * the view descriptor, the command will be enabled by default. * * @param viewDescriptor The object describing the view that this command will be * responsible for showing. - * @param window The application window that the command belongs to. + * @param applicationWindow The application window that the command belongs to. * - * @throw IllegalArgumentException if [EMAIL PROTECTED] viewDescriptor} is null. + * @throw IllegalArgumentException if [EMAIL PROTECTED] viewDescriptor} or [EMAIL PROTECTED] applicationWindow} are null. */ - public ShowViewCommand(ViewDescriptor viewDescriptor, ApplicationWindow window) { - this(); - //FIXME does this really need to call this()? It only provides an ID that will be - //overridden anyway when setViewDescriptor is called on the next line. + public ShowViewCommand(ViewDescriptor viewDescriptor, ApplicationWindow applicationWindow) { + Assert.required(applicationWindow, "applicationWindow"); setViewDescriptor(viewDescriptor); - setApplicationWindow(window); + setApplicationWindow(applicationWindow); setEnabled(true); } /** - * Sets the object that describes the view that is to be opened by this command object. + * Sets the descriptor for the view that is to be opened by this command object. This + * command object will be assigned the id, label, icon, and caption from the given view + * descriptor. * * @param viewDescriptor The view descriptor, cannot be null. * @@ -83,9 +68,9 @@ */ protected void doExecuteCommand() { //FIXME getApplicationWindow can potentially return null. This should probably be - //made an invariant on the ApplicationWindowAwareCommand that it never returns null. + //made an invariant on the ApplicationWindowAwareCommand, that it never returns null. //Same applies to ApplicationWindow.getPage(), can also return null - getApplicationWindow().getPage().showView(viewDescriptor); + getApplicationWindow().getPage().showView(this.viewDescriptor); } } 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