View Javadoc
1   /*
2    * Copyright 2014 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$
17   *  $HeadURL$
18  */
19  package com.hack23.cia.web.impl.ui.application.views.user.party.pagemode;
20  
21  import org.springframework.beans.factory.annotation.Autowired;
22  
23  import com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenParty;
24  import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup;
25  import com.hack23.cia.web.impl.ui.application.action.ViewAction;
26  import com.hack23.cia.web.impl.ui.application.views.common.menufactory.api.PartyMenuItemFactory;
27  import com.hack23.cia.web.impl.ui.application.views.common.pagemode.AbstractPageModContentFactoryImpl;
28  import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews;
29  import com.vaadin.ui.Component;
30  
31  /**
32   * The Class AbstractPoliticianPageModContentFactoryImpl.
33   */
34  abstract class AbstractPartyPageModContentFactoryImpl extends AbstractPageModContentFactoryImpl {
35  
36  	/** The Constant PARTY. */
37  	private static final String PARTY = "Party:";
38  
39  	/** The Constant NAME. */
40  	public static final String NAME = UserViews.PARTY_VIEW_NAME;
41  
42  	/** The party menu item factory. */
43  	@Autowired
44  	private PartyMenuItemFactory partyMenuItemFactory;
45  
46  	/**
47  	 * Instantiates a new abstract party page mod content factory impl.
48  	 */
49  	AbstractPartyPageModContentFactoryImpl() {
50  		super();
51  	}
52  
53  	/**
54  	 * Page completed.
55  	 *
56  	 * @param parameters
57  	 *            the parameters
58  	 * @param panel
59  	 *            the panel
60  	 * @param pageId
61  	 *            the page id
62  	 * @param viewRiksdagenParty
63  	 *            the view riksdagen party
64  	 */
65  	protected final void pageCompleted(final String parameters, final Component panel, final String pageId,
66  			final ViewRiksdagenParty viewRiksdagenParty) {
67  		panel.setCaption(new StringBuilder().append(PARTY).append(viewRiksdagenParty.getPartyName()).toString());
68  
69  		getPageActionEventHelper().createPageEvent(ViewAction.VISIT_PARTY_VIEW, ApplicationEventGroup.USER, NAME, parameters,
70  				pageId);
71  	}
72  
73  	/**
74  	 * Gets the party menu item factory.
75  	 *
76  	 * @return the party menu item factory
77  	 */
78  	protected final PartyMenuItemFactory getPartyMenuItemFactory() {
79  		return partyMenuItemFactory;
80  	}
81  
82  }