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: WelcomePage.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/page/user/WelcomePage.java $
18  */
19  package com.hack23.cia.web.impl.ui.page.user;
20  
21  import org.vaadin.navigator7.Page;
22  
23  import com.hack23.cia.web.impl.ui.page.common.EmbeddedWebBrowser;
24  import com.vaadin.ui.Alignment;
25  import com.vaadin.ui.VerticalLayout;
26  
27  /**
28   * The Class WelcomePage.
29   */
30  @Page(uriName = "welcome", crawlable = true)
31  @SuppressWarnings("serial")
32  public final class WelcomePage extends AbstractUserPage  {
33  
34  	/** The global site view panel. */
35  	private GlobalSiteViewPanel globalSiteViewPanel=null;
36  
37  	/**
38  	 * Instantiates a new welcome page.
39  	 */
40  	public WelcomePage() {
41  		super();
42  		final VerticalLayout grid = new VerticalLayout();
43  
44  		final EmbeddedWebBrowser browser = new EmbeddedWebBrowser("Auth info","../secure/index.jsp");
45  		grid.addComponent(browser);
46  		grid.setComponentAlignment(browser,
47  					Alignment.TOP_CENTER);
48  		browser.setSizeFull();
49  
50  		globalSiteViewPanel = new GlobalSiteViewPanel();
51  		grid.addComponent(globalSiteViewPanel);
52  		grid.setComponentAlignment(globalSiteViewPanel,
53  				Alignment.MIDDLE_CENTER);
54  		globalSiteViewPanel.setSizeFull();
55  
56  		grid.setSizeFull();
57  		grid.setMargin(false);
58  		grid.setSpacing(true);
59  		setCompositionRoot(grid);
60  		setHeight(getScreenHeight());
61  	}
62  
63  	/* (non-Javadoc)
64  	 * @see com.hack23.cia.web.impl.ui.page.common.AbstractPage#getPageTitle()
65  	 */
66  	@Override
67  	public String getPageTitle() {
68  		return getUserState().translateFromEnglish("Front page");
69  	}
70  
71  }