1
2
3
4
5
6 package com.hack23.cia.web.views.common;
7
8 import thinwire.ui.Application;
9 import thinwire.ui.Menu;
10 import thinwire.ui.Panel;
11
12 /***
13 * The Class ActiveUserView.
14 */
15 public class ActiveUserView {
16
17 /*** The active content view. */
18 private static Application.Local<Panel> activeContentView = new Application.Local<Panel>();
19
20 /*** The current position and history view. */
21 private static Application.Local<Panel> currentPositionAndHistoryView = new Application.Local<Panel>();
22
23 /***
24 * Change active menu.
25 *
26 * @param menu the menu
27 */
28 public static void changeActiveMenu(final Menu menu) {
29 Application.current().getFrame().setMenu(menu);
30 }
31
32 /***
33 * Change content view.
34 *
35 * @param view the view
36 */
37 public static void changeContentView(final Panel view) {
38 final Panel oldView = activeContentView.get();
39 view.setLimit(oldView.getLimit());
40 Application.current().getFrame().getChildren().remove(oldView);
41 Application.current().getFrame().getChildren().add(view);
42 activeContentView.set(view);
43 }
44
45 /***
46 * Gets the active content view.
47 *
48 * @return the active content view
49 */
50 public static Application.Local<Panel> getActiveContentView() {
51 return activeContentView;
52 }
53
54 /***
55 * Gets the current position and history view.
56 *
57 * @return the current position and history view
58 */
59 public static Application.Local<Panel> getCurrentPositionAndHistoryView() {
60 return currentPositionAndHistoryView;
61 }
62
63 /***
64 * Instantiates a new active user view.
65 */
66 protected ActiveUserView() {
67 super();
68 }
69 }