View Javadoc

1   /*
2    * Copyright 2010 James Pether Sörling
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *   http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   *
16   *	$Id: Pages.java 5436 2011-04-26 18:25:22Z pether $
17   *  $HeadURL: https://cia.svn.sourceforge.net/svnroot/cia/trunk/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/Pages.java $
18  */
19  package com.hack23.cia.web.impl.ui.application;
20  
21  import com.hack23.cia.web.impl.ui.page.admin.AdminPage;
22  import com.hack23.cia.web.impl.ui.page.admin.ConsolePage;
23  import com.hack23.cia.web.impl.ui.page.admin.DashBoardPage;
24  import com.hack23.cia.web.impl.ui.page.dev.TestPage;
25  import com.hack23.cia.web.impl.ui.page.user.BallotPage;
26  import com.hack23.cia.web.impl.ui.page.user.CountryPage;
27  import com.hack23.cia.web.impl.ui.page.user.DocumentPage;
28  import com.hack23.cia.web.impl.ui.page.user.LoginPage;
29  import com.hack23.cia.web.impl.ui.page.user.LogoutPage;
30  import com.hack23.cia.web.impl.ui.page.user.PoliticalPartyPage;
31  import com.hack23.cia.web.impl.ui.page.user.PoliticianPage;
32  import com.hack23.cia.web.impl.ui.page.user.ProjectInfoPage;
33  import com.hack23.cia.web.impl.ui.page.user.WelcomePage;
34  import com.vaadin.ui.Component;
35  
36  /**
37   * The Class Pages.
38   */
39  @SuppressWarnings("rawtypes")
40  public final class Pages {
41  
42  	/** The Constant USER_PAGES. */
43  	private static final Class[] USER_PAGES = new Class[] { WelcomePage.class, LoginPage.class,LogoutPage.class,CountryPage.class,PoliticianPage.class,PoliticalPartyPage.class,DocumentPage.class,BallotPage.class,ProjectInfoPage.class};
44  
45  	/** The Constant ADMIN_PAGES. */
46  	private static final Class[] ADMIN_PAGES =  { AdminPage.class,ConsolePage.class, DashBoardPage.class};
47  
48  	/** The Constant DEV_PAGES. */
49  	private static final Class[] DEV_PAGES = new Class[] { TestPage.class};
50  
51  	/** The Constant HOME_PAGE. */
52  	private static final Class<? extends Component> HOME_PAGE= WelcomePage.class;
53  
54  	/**
55  	 * Instantiates a new pages.
56  	 */
57  	private Pages() {
58  		super();
59  	}
60  
61  	/**
62  	 * Gets the admin pages.
63  	 *
64  	 * @return the admin pages
65  	 */
66  	public static Class[] getAdminPages() {
67  		return ADMIN_PAGES.clone();
68  	}
69  
70  	/**
71  	 * Gets the dev pages.
72  	 *
73  	 * @return the dev pages
74  	 */
75  	public static Class[] getDevPages() {
76  		return DEV_PAGES.clone();
77  	}
78  
79  	/**
80  	 * Gets the home page.
81  	 *
82  	 * @return the home page
83  	 */
84  	public static Class<? extends Component> getHomePage() {
85  		return HOME_PAGE;
86  	}
87  
88  	/**
89  	 * Gets the user pages.
90  	 *
91  	 * @return the user pages
92  	 */
93  	public static Class[] getUserPages() {
94  		return USER_PAGES.clone();
95  	}
96  }