1
2
3
4
5 package org.directdemocracyportal.democracy.web.views;
6
7 import thinwire.ui.Application;
8 import thinwire.ui.Menu;
9 import thinwire.ui.Panel;
10
11 /***
12 * The Class ActiveUserView.
13 */
14 public class ActiveUserView
15 {
16
17 /*** The Constant activeContentView. */
18 public final static Application.Local<Panel> activeContentView = new Application.Local<Panel>();
19
20 /*** The Constant activeHeaderPanel. */
21 public final static Application.Local<Panel> activeHeaderPanel = new Application.Local<Panel>();
22
23 /*** The Constant activeRightHeaderPanel. */
24 public final static Application.Local<Panel> activeRightHeaderPanel = new Application.Local<Panel>();
25
26 /***
27 * Change content view.
28 *
29 * @param view the view
30 */
31 public static void changeContentView(Panel view) {
32 Panel oldView = activeContentView.get();
33 view.setLimit(oldView.getLimit());
34 Application.current().getFrame().getChildren().remove(oldView);
35 Application.current().getFrame().getChildren().add(view);
36 activeContentView.set(view);
37 }
38
39 /***
40 * Change right header panel.
41 *
42 * @param view the view
43 */
44 public static void changeRightHeaderPanel(Panel view) {
45 Panel oldView = activeRightHeaderPanel.get();
46 view.setLimit(oldView.getLimit());
47 activeHeaderPanel.get().getChildren().remove(oldView);
48 activeHeaderPanel.get().getChildren().add(view);
49 activeRightHeaderPanel.set(view);
50 }
51
52 /***
53 * Change active menu.
54 *
55 * @param menu the menu
56 */
57 public static void changeActiveMenu(Menu menu) {
58 Application.current().getFrame().setMenu(menu);
59 }
60 }