annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/MainMenu.java @ 210:c587903f02a4

Implemented the button to toggle the current locale. flys-client/trunk@1644 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 05 Apr 2011 06:25:17 +0000
parents 33e24b33fc38
children b92281182c6b
rev   line source
1
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.client.client.ui;
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
3 import com.google.gwt.core.client.GWT;
210
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
4 import com.google.gwt.i18n.client.LocaleInfo;
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
5 import com.google.gwt.user.client.Window;
1
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6
28
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
7 import com.smartgwt.client.types.Alignment;
1
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8 import com.smartgwt.client.widgets.Label;
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
9 import com.smartgwt.client.widgets.events.ClickEvent;
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
10 import com.smartgwt.client.widgets.events.ClickHandler;
1
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 import com.smartgwt.client.widgets.layout.HLayout;
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
13 import de.intevation.flys.client.client.FLYS;
1
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14 import de.intevation.flys.client.client.FLYSMessages;
25
2da6be38d8b6 Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
15 import de.intevation.flys.client.shared.model.User;
1
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18 /**
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 */
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21 public class MainMenu extends HLayout {
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23 /** The interface that provides i18n messages. */
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24 private FLYSMessages messages = GWT.create(FLYSMessages.class);
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
26 /** An instance to FLYS.*/
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
27 protected FLYS flys;
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
28
2
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
29 /** The user that is currently logged in. */
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
30 protected User currentUser;
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
31
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
32 /** The label that displays the current logged in user. */
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
33 protected Label userText;
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
34
28
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
35 /** The button to log the current user out.*/
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
36 protected Label logout;
2
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
37
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
38 /** The button to add new projects.*/
28
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
39 protected Label newProject;
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
40
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
41 /** The button to open the project list.*/
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
42 protected Label projectList;
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
43
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
44 /** The button to switch between the english and german version.*/
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
45 protected Label language;
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
46
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
47 /** The button to open an info panel.*/
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
48 protected Label info;
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
49
1
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
50 /**
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
51 * The default constructor for creating a new MainMenu.
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
52 */
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
53 public MainMenu(FLYS flys) {
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
54 this.flys = flys;
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
55
102
33e24b33fc38 Improved the way how to i18n strings in our application.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 94
diff changeset
56 String guest = messages.user() + " " + messages.guest();
33e24b33fc38 Improved the way how to i18n strings in our application.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 94
diff changeset
57
33e24b33fc38 Improved the way how to i18n strings in our application.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 94
diff changeset
58 userText = new Label(guest);
28
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
59 newProject = new Label(messages.new_project());
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
60 projectList = new Label(messages.manage_projects());
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
61 logout = new Label(messages.logout());
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
62 language = new Label(messages.switch_language());
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
63 info = new Label(messages.info());
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
64
28
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
65 newProject.addClickHandler(new ClickHandler() {
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
66 public void onClick(ClickEvent event) {
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
67 GWT.log("Clicked 'New Project' button.");
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
68 createNewProject();
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
69 }
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
70 });
2
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
71
28
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
72 projectList.addClickHandler(new ClickHandler() {
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
73 public void onClick(ClickEvent event) {
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
74 GWT.log("Clicked 'Open ProjectList' button.");
88
4d7c6a63602b Fixed toggle method.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 82
diff changeset
75 ProjectList list = getFlys().getProjectList();
94
eb54fb9f5f2c Fixed some issues.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 88
diff changeset
76 if (list.isVisible())
88
4d7c6a63602b Fixed toggle method.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 82
diff changeset
77 list.hide();
82
4c5fa2b0086a The project list button toggles the project list now.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 66
diff changeset
78 else
88
4d7c6a63602b Fixed toggle method.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 82
diff changeset
79 list.show();
28
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
80 }
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
81 });
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
82
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
83 logout.addClickHandler(new ClickHandler() {
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
84 public void onClick(ClickEvent event) {
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
85 GWT.log("Clicked 'logout' button.");
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
86 GWT.log("IMPLEMENT the 'logout' function.");
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
87 }
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
88 });
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
89
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
90 language.addClickHandler(new ClickHandler() {
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
91 public void onClick(ClickEvent event) {
210
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
92 LocaleInfo info = LocaleInfo.getCurrentLocale();
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
93 String currentLocale = info.getLocaleName();
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
94 String newLocale = currentLocale.equals("de") ? "en" : "de";
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
95
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
96 // XXX Maybe we should inform the user about fact, that we will
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
97 // loose the work of the current session.
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
98 switchLanguage(currentLocale, newLocale);
28
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
99 }
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
100 });
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
101
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
102 info.addClickHandler(new ClickHandler() {
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
103 public void onClick(ClickEvent event) {
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
104 GWT.log("Clicked 'info' button.");
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
105 GWT.log("IMPLEMENT the 'open info panel' function.");
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
106 }
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
107 });
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
108
1
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
109 init();
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
110 }
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
111
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
112
2
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
113 /**
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
114 * This method is called by the constructor after creating the necessary
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
115 * components. It initializes layout specific stuff like width, height,
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
116 * colors and so on and appends the components.
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
117 */
1
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
118 protected void init() {
66
a361ce81abcf Customized style for header and mainmenu.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 28
diff changeset
119 setStyleName("bgBlueDark");
a361ce81abcf Customized style for header and mainmenu.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 28
diff changeset
120 setHeight("25px");
28
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
121 setLayoutMargin(5);
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
122
66
a361ce81abcf Customized style for header and mainmenu.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 28
diff changeset
123 newProject.setStyleName("fontLightSmall");
a361ce81abcf Customized style for header and mainmenu.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 28
diff changeset
124 projectList.setStyleName("fontLightSmall");
a361ce81abcf Customized style for header and mainmenu.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 28
diff changeset
125 userText.setStyleName("fontLightSmall");
a361ce81abcf Customized style for header and mainmenu.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 28
diff changeset
126 newProject.setStyleName("fontLightSmall");
a361ce81abcf Customized style for header and mainmenu.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 28
diff changeset
127 logout.setStyleName("fontLightSmall");
a361ce81abcf Customized style for header and mainmenu.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 28
diff changeset
128 language.setStyleName("fontLightSmall");
a361ce81abcf Customized style for header and mainmenu.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 28
diff changeset
129 info.setStyleName("fontLightSmall");
a361ce81abcf Customized style for header and mainmenu.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 28
diff changeset
130
a361ce81abcf Customized style for header and mainmenu.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 28
diff changeset
131 projectList.setWidth("140px");
a361ce81abcf Customized style for header and mainmenu.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 28
diff changeset
132
28
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
133 HLayout leftPanel = new HLayout();
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
134 leftPanel.setWidth("80%");
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
135 leftPanel.setMembersMargin(5);
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
136 leftPanel.addMember(newProject);
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
137 leftPanel.addMember(projectList);
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
138
28
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
139 userText.setAlign(Alignment.RIGHT);
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
140 logout.setAlign(Alignment.RIGHT);
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
141 info.setAlign(Alignment.RIGHT);
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
142 language.setAlign(Alignment.RIGHT);
2
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
143
28
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
144 userText.setWidth(200);
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
145 logout.setWidth(70);
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
146 info.setWidth(40);
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
147 language.setWidth(70);
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
148
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
149 HLayout rightPanel = new HLayout();
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
150 rightPanel.setAlign(Alignment.RIGHT);
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
151 rightPanel.setMembersMargin(3);
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
152 rightPanel.setLayoutRightMargin(5);
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
153 rightPanel.addMember(userText);
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
154 rightPanel.addMember(logout);
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
155 rightPanel.addMember(language);
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
156 rightPanel.addMember(info);
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
157
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
158 addMember(leftPanel);
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
159 addMember(rightPanel);
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
160 }
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
161
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
162
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
163 /**
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
164 * Returns the FLYS instance stored in this class.
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
165 *
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
166 * @return the flys instance.
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
167 */
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
168 protected FLYS getFlys() {
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
169 return flys;
2
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
170 }
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
171
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
172
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
173 /**
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
174 * Set the current {@link User} and call {@link updateCurrentUser()}
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
175 * afterwards.
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
176 *
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
177 * @param user the new user.
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
178 */
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
179 public void setCurrentUser(User currentUser) {
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
180 this.currentUser = currentUser;
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
181
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
182 updateCurrentUser();
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
183 }
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
184
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
185
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
186 /**
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
187 * Update the text field that shows the current user. If no user is
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
188 * currently logged in, the text will display {@link FLYSMessages.guest()}.
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
189 */
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
190 public void updateCurrentUser() {
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
191 String name = currentUser != null
25
2da6be38d8b6 Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
192 ? currentUser.getName()
2
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
193 : messages.guest();
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
194
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
195 GWT.log("Update the current user: " + name);
102
33e24b33fc38 Improved the way how to i18n strings in our application.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 94
diff changeset
196
33e24b33fc38 Improved the way how to i18n strings in our application.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 94
diff changeset
197 String username = messages.user() + " " + name;
33e24b33fc38 Improved the way how to i18n strings in our application.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 94
diff changeset
198 userText.setContents(username);
1
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
199 }
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
200
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
201
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
202 /**
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
203 * Create a new project by calling FLYS.newProject().
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
204 */
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
205 protected void createNewProject() {
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
206 flys.newProject();
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
207 }
210
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
208
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
209
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
210 /**
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
211 * This method triggers the language switch between the <i>currentLocale</i>
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
212 * and the <i>newLocale</i>. The switch is done by replacing a "locale="
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
213 * parameter in the url of the application. We could use the GWT UrlBuilder
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
214 * class to create a new URL, but - in my eyes - this class is a bit
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
215 * inconsistens in its implementation.
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
216 *
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
217 * @param currentLocale The current locale string (e.g. "en").
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
218 * @param newLocale The new locale string (e.g. "de").
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
219 */
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
220 protected void switchLanguage(String currentLocale, String newLocale) {
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
221 String newLocation = Window.Location.getHref();
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
222
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
223 if (newLocation.indexOf("&locale=") >= 0) {
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
224 String replace = currentLocale.equals("de")
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
225 ? "&locale=de"
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
226 : "&locale=en";
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
227
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
228 String replaceWith = newLocale.equals("de")
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
229 ? "&locale=de"
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
230 : "&locale=en";
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
231
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
232 newLocation = newLocation.replace(replace, replaceWith);
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
233 }
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
234 else if (newLocation.indexOf("?locale=") >= 0) {
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
235 String replace = currentLocale.equals("de")
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
236 ? "?locale=de"
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
237 : "?locale=en";
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
238
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
239 String replaceWith = currentLocale.equals("de")
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
240 ? "?locale=de"
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
241 : "?locale=en";
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
242
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
243 newLocation = newLocation.replace(replace, replaceWith);
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
244 }
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
245 else {
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
246 newLocation += newLocation.indexOf("?") >= 0
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
247 ? "&locale=" + newLocale
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
248 : "?locale=" + newLocale;
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
249 }
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
250
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
251 Window.open(newLocation, "_self", "");
c587903f02a4 Implemented the button to toggle the current locale.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 102
diff changeset
252 }
1
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
253 }
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
254 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org