1 /**
2 * Copyright 2005-2016 The Kuali Foundation
3 *
4 * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
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 package org.kuali.rice.krad.uif.element;
17
18 import org.kuali.rice.krad.uif.container.Group;
19
20 /**
21 * Component that renders a standard application header including a logo, navigation, and toolbar.
22 *
23 * @author Kuali Rice Team (rice.collab@kuali.org)
24 */
25 public class ApplicationHeader extends Header {
26 private static final long serialVersionUID = 6213942245727420161L;
27
28 private NavigationBar applicationNavigation;
29
30 private Group applicationToolbar;
31
32 public ApplicationHeader() {
33 super();
34 }
35
36 /**
37 * Navigation bar component that is used to render the application navigation within the header.
38 *
39 * @return navigation bar instance
40 */
41 public NavigationBar getApplicationNavigation() {
42 return applicationNavigation;
43 }
44
45 /**
46 * @see ApplicationHeader#getApplicationNavigation()
47 */
48 public void setApplicationNavigation(NavigationBar applicationNavigation) {
49 this.applicationNavigation = applicationNavigation;
50 }
51
52 /**
53 * Convenience setter for configuring the application logo (brand image) for the navigation bar.
54 *
55 * @param applicationLogo image instance to use as logo
56 * @see NavigationBar#setBrandImage(org.kuali.rice.krad.uif.element.Image)
57 */
58 public void setApplicationLogo(Image applicationLogo) {
59 if (applicationNavigation == null) {
60 throw new RuntimeException("App navigation is null, cannot set application logo");
61 } else {
62 applicationNavigation.setBrandImage(applicationLogo);
63 }
64 }
65
66 /**
67 * Group that is rendered below the navigation bar with a toolbar style.
68 *
69 * <p>Common group toolbar for placing things such as user actions, links/dropdowns to other application
70 * actions</p>
71 *
72 * @return Group instance
73 */
74 public Group getApplicationToolbar() {
75 return applicationToolbar;
76 }
77
78 /**
79 * @see ApplicationHeader#getApplicationToolbar()
80 */
81 public void setApplicationToolbar(Group applicationToolbar) {
82 this.applicationToolbar = applicationToolbar;
83 }
84 }