BrightSide Workbench Full Report + Source Code
org.turro.user.menu.ElephantUserMenu Class Reference
Inheritance diagram for org.turro.user.menu.ElephantUserMenu:
Collaboration diagram for org.turro.user.menu.ElephantUserMenu:

Public Member Functions

 ElephantUserMenu ()
 
void initMenu ()
 
boolean isInRole ()
 
Object getDetail ()
 
- Public Member Functions inherited from org.turro.elephant.user.menu.DefaultUserMenu
 DefaultUserMenu (String label, String image)
 
 DefaultUserMenu (String label, String image, String link)
 
 DefaultUserMenu (String label, String image, Function< IUserMenu, Boolean > command)
 
 DefaultUserMenu (String label, String image, int order)
 
 DefaultUserMenu (String label, String image, String link, int order)
 
 DefaultUserMenu (String id, String label, String image, Function< IUserMenu, Boolean > command, int order)
 
String getId ()
 
String getLabel ()
 
String getImage ()
 
int getOrder ()
 
String getLink ()
 
boolean isValid ()
 
boolean isCaption ()
 
boolean isOnlyLabel ()
 
boolean isOnlyImage ()
 
boolean isActive ()
 
IUserMenu getParent ()
 
Set< IUserMenugetChildren ()
 
IUserMenu addChild (IUserMenu menu)
 
boolean execute ()
 
int compareTo (IUserMenu o)
 
boolean isHidden ()
 

Additional Inherited Members

- Protected Member Functions inherited from org.turro.elephant.user.menu.DefaultUserMenu
 DefaultUserMenu (String id, String label, String image, String link, Function< IUserMenu, Boolean > command, int order)
 
void setOrder (int order)
 
- Protected Attributes inherited from org.turro.elephant.user.menu.DefaultUserMenu
IUserMenu parent
 
Set< IUserMenuchildren
 
String id
 
int order
 
Function< IUserMenu, Boolean > command
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 35 of file ElephantUserMenu.java.

Constructor & Destructor Documentation

◆ ElephantUserMenu()

org.turro.user.menu.ElephantUserMenu.ElephantUserMenu ( )

Definition at line 37 of file ElephantUserMenu.java.

37  {
38  super("Elephant", null);
39  }

Member Function Documentation

◆ getDetail()

Object org.turro.user.menu.ElephantUserMenu.getDetail ( )

Reimplemented from org.turro.elephant.user.menu.DefaultUserMenu.

Definition at line 175 of file ElephantUserMenu.java.

175  {
176  return null;
177  }
Here is the caller graph for this function:

◆ initMenu()

void org.turro.user.menu.ElephantUserMenu.initMenu ( )

Reimplemented from org.turro.elephant.user.menu.DefaultUserMenu.

Definition at line 42 of file ElephantUserMenu.java.

42  {
43  IUserMenu session = UserMenus.getSessionMenu();
44  session.addChild(new DefaultUserMenu("Devices", null, "/user/sso") {
45  @Override
46  public boolean isInRole() {
47  return ElephantContext.getUseSSO();
48  }
49  @Override
50  public Object getDetail() {
51  return null;
52  }
53  });
54  IUserMenu mlangs = session.addChild(new CaptionMenu("Language", null));
55  String[] langs = ElephantContext.getSiteLocales().split(" *, *");
56  mlangs.addChild(new DefaultUserMenu("Browser's default", null, menu -> {
57  Application.deleteCookie("lang", "/");
58  Application.getApplication().sendRedirect("/user");
59  return true;
60  }) {
61  @Override
62  public boolean isInRole() {
63  return true;
64  }
65  @Override
66  public Object getDetail() {
67  return null;
68  }
69  });
70  for(String l : langs) {
71  mlangs.addChild(new DefaultUserMenu(I_.keyValue(l), null, menu -> {
72  Application.setCookie("lang", l, "/", 365*24*60*60);
73  Application.getApplication().sendRedirect("/user");
74  return true;
75  }) {
76  @Override
77  public boolean isInRole() {
78  return true;
79  }
80  @Override
81  public Object getDetail() {
82  return null;
83  }
84  });
85  }
86  session.addChild(new DefaultUserMenu("Cookies", null, "/user/cookies") {
87  @Override
88  public boolean isInRole() {
89  return true;
90  }
91  @Override
92  public Object getDetail() {
93  return null;
94  }
95  });
96  session.addChild(new DefaultUserMenu("Time tracker", null, "/user/timetracker") {
97  @Override
98  public boolean isInRole() {
99  return !Application.getApplication().getConstructor().isOutsider();
100  }
101  @Override
102  public Object getDetail() {
103  return null;
104  }
105  });
106  IUserMenu settings = UserMenus.getSettingsMenu();
107  settings.addChild(new DefaultUserMenu("Universe", null, "/user/entity") {
108  @Override
109  public boolean isInRole() {
110  return Application.getApplication().isInRole("@admin:is");
111  }
112  @Override
113  public Object getDetail() {
114  return null;
115  }
116  });
117  IUserMenu mfunnel = settings.addChild(new CaptionMenu("Funneling", null) {
118  @Override
119  public boolean isInRole() {
120  return Application.getApplication().isInRole("@admin:is");
121  }
122  @Override
123  public Object getDetail() {
124  return null;
125  }
126  });
127  mfunnel.addChild(new DefaultUserMenu("Funneling items", null, "/user/web/funnel/items") {
128  @Override
129  public boolean isInRole() {
130  return Application.getApplication().isInRole("@admin:is");
131  }
132  @Override
133  public Object getDetail() {
134  return null;
135  }
136  });
137  mfunnel.addChild(new DefaultUserMenu("Funneling goals", null, "/user/web/funnel/goals") {
138  @Override
139  public boolean isInRole() {
140  return Application.getApplication().isInRole("@admin:is");
141  }
142  @Override
143  public Object getDetail() {
144  return null;
145  }
146  });
147  mfunnel.addChild(new DefaultUserMenu("Funneling test", null, "/user/web/funnel/test") {
148  @Override
149  public boolean isInRole() {
150  return Application.getApplication().isInRole("@admin:is");
151  }
152  @Override
153  public Object getDetail() {
154  return null;
155  }
156  });
157  settings.addChild(new DefaultUserMenu("Importer", null, "/user/importer") {
158  @Override
159  public boolean isInRole() {
160  return true;
161  }
162  @Override
163  public Object getDetail() {
164  return null;
165  }
166  });
167  }
Here is the call graph for this function:

◆ isInRole()

boolean org.turro.user.menu.ElephantUserMenu.isInRole ( )

Reimplemented from org.turro.elephant.user.menu.DefaultUserMenu.

Definition at line 170 of file ElephantUserMenu.java.

170  {
171  return true;
172  }
Here is the caller graph for this function:

The documentation for this class was generated from the following file: