comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/MainMenu.java @ 532:0ba7c43e7b62

Replaced buttons displayed as labels with real buttons. flys-client/trunk@2023 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 27 May 2011 13:10:09 +0000
parents e3ea3c74b7f5
children 725470fc57d2
comparison
equal deleted inserted replaced
531:c17c593f8732 532:0ba7c43e7b62
5 import com.google.gwt.user.client.Window; 5 import com.google.gwt.user.client.Window;
6 6
7 import com.smartgwt.client.types.Alignment; 7 import com.smartgwt.client.types.Alignment;
8 import com.smartgwt.client.util.BooleanCallback; 8 import com.smartgwt.client.util.BooleanCallback;
9 import com.smartgwt.client.util.SC; 9 import com.smartgwt.client.util.SC;
10 import com.smartgwt.client.widgets.Button;
10 import com.smartgwt.client.widgets.Label; 11 import com.smartgwt.client.widgets.Label;
11 import com.smartgwt.client.widgets.events.ClickEvent; 12 import com.smartgwt.client.widgets.events.ClickEvent;
12 import com.smartgwt.client.widgets.events.ClickHandler; 13 import com.smartgwt.client.widgets.events.ClickHandler;
13 import com.smartgwt.client.widgets.layout.HLayout; 14 import com.smartgwt.client.widgets.layout.HLayout;
14 15
33 34
34 /** The label that displays the current logged in user. */ 35 /** The label that displays the current logged in user. */
35 protected Label userText; 36 protected Label userText;
36 37
37 /** The button to log the current user out.*/ 38 /** The button to log the current user out.*/
38 protected Label logout; 39 protected Button logout;
39 40
40 /** The button to add new projects.*/ 41 /** The button to add new projects.*/
41 protected Label newProject; 42 protected Button newProject;
42 43
43 /** The button to open the project list.*/ 44 /** The button to open the project list.*/
44 protected Label projectList; 45 protected Button projectList;
45 46
46 /** The button to switch between the english and german version.*/ 47 /** The button to switch between the english and german version.*/
47 protected Label language; 48 protected Button language;
48 49
49 /** The button to open an info panel.*/ 50 /** The button to open an info panel.*/
50 protected Label info; 51 protected Button info;
51 52
52 /** 53 /**
53 * The default constructor for creating a new MainMenu. 54 * The default constructor for creating a new MainMenu.
54 */ 55 */
55 public MainMenu(FLYS flys) { 56 public MainMenu(FLYS flys) {
56 this.flys = flys; 57 this.flys = flys;
57 58
58 String guest = messages.user() + " " + messages.guest(); 59 String guest = messages.user() + " " + messages.guest();
59 60
60 userText = new Label(guest); 61 userText = new Label(guest);
61 newProject = new Label(messages.new_project()); 62 newProject = new Button(messages.new_project());
62 projectList = new Label(messages.manage_projects()); 63 projectList = new Button(messages.manage_projects());
63 logout = new Label(messages.logout()); 64 logout = new Button(messages.logout());
64 language = new Label(messages.switch_language()); 65 language = new Button(messages.switch_language());
65 info = new Label(messages.info()); 66 info = new Button(messages.info());
66 67
67 newProject.addClickHandler(new ClickHandler() { 68 newProject.addClickHandler(new ClickHandler() {
68 public void onClick(ClickEvent event) { 69 public void onClick(ClickEvent event) {
69 GWT.log("Clicked 'New Project' button."); 70 GWT.log("Clicked 'New Project' button.");
70 createNewProject(); 71 createNewProject();
144 leftPanel.setMembersMargin(5); 145 leftPanel.setMembersMargin(5);
145 leftPanel.addMember(newProject); 146 leftPanel.addMember(newProject);
146 leftPanel.addMember(projectList); 147 leftPanel.addMember(projectList);
147 148
148 userText.setAlign(Alignment.RIGHT); 149 userText.setAlign(Alignment.RIGHT);
149 logout.setAlign(Alignment.RIGHT);
150 info.setAlign(Alignment.RIGHT);
151 language.setAlign(Alignment.RIGHT);
152
153 userText.setWidth(200); 150 userText.setWidth(200);
154 logout.setWidth(70); 151 logout.setWidth(70);
155 info.setWidth(40); 152 info.setWidth(40);
156 language.setWidth(70); 153 language.setWidth(70);
157 154

http://dive4elements.wald.intevation.org