View Javadoc

1   package org.musicontroller.gui.edit;
2   
3   import org.apache.tapestry.IPage;
4   import org.apache.tapestry.IRequestCycle;
5   import org.apache.tapestry.html.BasePage;
6   
7   /**
8    * Base Page class for Tapestry pages in Musicontroller
9    * that edit things. This class implements returning to
10   * the page set in the "returnPage" property.
11   * 
12   * @author deksels
13   * @version $Id: BaseEditPage.java,v 1.1 2010/03/16 18:55:42 varienaja Exp $
14   */
15  public abstract class BaseEditPage extends BasePage {
16  	
17  	/**
18  	 * Getter for the page name of the page to render
19  	 * after completion of the edit. This should be the
20  	 * name of a valid Tapestry page in the application.
21  	 * @return Name Page name of Tapestry page render after
22  	 *         comletion of the edit.
23  	 */
24  	public abstract String getReturnPage();
25  	
26  	public void renderReturnPage(IRequestCycle cycle) {
27  		IPage page = cycle.getPage(getReturnPage());
28  		cycle.activate(page);
29  	}
30  }