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