-/*\r
- * Copyright 2007, 2008, 2009 Electronic Business Systems Ltd.\r
- *\r
- * This file is part of GSS.\r
- *\r
- * GSS is free software: you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation, either version 3 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * GSS is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with GSS. If not, see <http://www.gnu.org/licenses/>.\r
- */\r
-package gr.ebs.gss.client;\r
-\r
-import gr.ebs.gss.client.rest.resource.UserResource;\r
-\r
-import com.google.gwt.user.client.DeferredCommand;\r
-import com.google.gwt.user.client.IncrementalCommand;\r
-import com.google.gwt.user.client.ui.Composite;\r
-import com.google.gwt.user.client.ui.HTML;\r
-import com.google.gwt.user.client.ui.HasHorizontalAlignment;\r
-import com.google.gwt.user.client.ui.HorizontalPanel;\r
-\r
-/**\r
- * The panel that displays a status bar with quota information.\r
- */\r
-public class UserDetailsPanel extends Composite {\r
- public static final boolean DONE = false;\r
-\r
- /**\r
- * The label that displays user information.\r
- */\r
- private HTML userInfoLabel;\r
-\r
- /**\r
- * The constructor of the user details panel.\r
- */\r
- public UserDetailsPanel() {\r
- final HorizontalPanel outer = new HorizontalPanel();\r
- outer.setSpacing(8);\r
- userInfoLabel = new HTML(" ");\r
- outer.add(userInfoLabel);\r
- outer.setCellHorizontalAlignment(userInfoLabel, HasHorizontalAlignment.ALIGN_RIGHT);\r
- outer.setStyleName("statusbar-inner");\r
-\r
- initWidget(outer);\r
-\r
- DeferredCommand.addCommand(new IncrementalCommand() {\r
-\r
- public boolean execute() {\r
- return displayUserInfo();\r
- }\r
- });\r
- }\r
-\r
- /**\r
- * Display the user information on the panel.\r
- *\r
- * @return true if the work has been carried out successfully\r
- */\r
- protected boolean displayUserInfo() {\r
- UserResource user = GSS.get().getCurrentUserResource();\r
- if (user == null)\r
- return !DONE;\r
- userInfoLabel.setHTML("<b>" + user.getName() + " \u0387 " + user.getUsername() + "</b>");\r
- return DONE;\r
- }\r
-\r
-}\r
+/*
+ * Copyright 2007, 2008, 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS. If not, see <http://www.gnu.org/licenses/>.
+ */
+package gr.ebs.gss.client;
+
+import gr.ebs.gss.client.rest.resource.UserResource;
+
+import com.google.gwt.user.client.DeferredCommand;
+import com.google.gwt.user.client.IncrementalCommand;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.HasHorizontalAlignment;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+
+/**
+ * The panel that displays a status bar with quota information.
+ */
+public class UserDetailsPanel extends Composite {
+ public static final boolean DONE = false;
+
+ /**
+ * The label that displays user information.
+ */
+ private HTML userInfoLabel;
+
+ /**
+ * The constructor of the user details panel.
+ */
+ public UserDetailsPanel() {
+ final HorizontalPanel outer = new HorizontalPanel();
+ outer.setSpacing(8);
+ userInfoLabel = new HTML(" ");
+ outer.add(userInfoLabel);
+ outer.setCellHorizontalAlignment(userInfoLabel, HasHorizontalAlignment.ALIGN_RIGHT);
+ outer.setStyleName("statusbar-inner");
+
+ initWidget(outer);
+
+ DeferredCommand.addCommand(new IncrementalCommand() {
+
+ @Override
+ public boolean execute() {
+ return displayUserInfo();
+ }
+ });
+ }
+
+ /**
+ * Display the user information on the panel.
+ *
+ * @return true if the work has been carried out successfully
+ */
+ protected boolean displayUserInfo() {
+ UserResource user = GSS.get().getCurrentUserResource();
+ if (user == null)
+ return !DONE;
+ userInfoLabel.setHTML("<b>" + user.getName() + " \u0387 " + user.getUsername() + "</b>");
+ GSS.get().putUserToMap(user.getUsername(), user.getName());
+ return DONE;
+ }
+
+}