2 * Copyright 2007, 2008, 2009 Electronic Business Systems Ltd.
4 * This file is part of GSS.
6 * GSS is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * GSS is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with GSS. If not, see <http://www.gnu.org/licenses/>.
19 package gr.ebs.gss.client;
21 import gr.ebs.gss.client.rest.resource.UserResource;
23 import com.google.gwt.user.client.DeferredCommand;
24 import com.google.gwt.user.client.IncrementalCommand;
25 import com.google.gwt.user.client.ui.Composite;
26 import com.google.gwt.user.client.ui.HTML;
27 import com.google.gwt.user.client.ui.HasHorizontalAlignment;
28 import com.google.gwt.user.client.ui.HorizontalPanel;
31 * The panel that displays a status bar with quota information.
33 public class UserDetailsPanel extends Composite {
34 public static final boolean DONE = false;
37 * The label that displays user information.
39 private HTML userInfoLabel;
42 * The constructor of the user details panel.
44 public UserDetailsPanel() {
45 final HorizontalPanel outer = new HorizontalPanel();
47 userInfoLabel = new HTML(" ");
48 outer.add(userInfoLabel);
49 outer.setCellHorizontalAlignment(userInfoLabel, HasHorizontalAlignment.ALIGN_RIGHT);
50 outer.setStyleName("statusbar-inner");
54 DeferredCommand.addCommand(new IncrementalCommand() {
57 public boolean execute() {
58 return displayUserInfo();
64 * Display the user information on the panel.
66 * @return true if the work has been carried out successfully
68 protected boolean displayUserInfo() {
69 UserResource user = GSS.get().getCurrentUserResource();
72 userInfoLabel.setHTML("<b>" + user.getName() + " \u0387 " + user.getUsername() + "</b>");
73 GSS.get().putUserToMap(user.getUsername(), user.getName());