Cloudbar variables and loginUrl are configurable through runtime.properties and build.xml
[pithos-web-client] / src / gr / grnet / pithos / web / client / TopPanel.java
index d9d5677..b755e7f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 GRNET S.A. All rights reserved.
+ * Copyright 2011-2012 GRNET S.A. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or
  * without modification, are permitted provided that the following
@@ -34,9 +34,9 @@
  */
 package gr.grnet.pithos.web.client;
 
-import com.google.gwt.resources.client.ClientBundle;
 import com.google.gwt.resources.client.ImageResource;
 import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.Window;
 import com.google.gwt.user.client.ui.AbstractImagePrototype;
 import com.google.gwt.user.client.ui.Composite;
 import com.google.gwt.user.client.ui.HTML;
@@ -56,120 +56,43 @@ public class TopPanel extends Composite {
         */
        public static final boolean DONE = false;
 
-    private Pithos app;
+    Pithos app;
 
        /**
         * An image bundle for this widgets images.
         */
-       public interface Images extends ClientBundle, FileMenu.Images, EditMenu.Images,
-                       FilePropertiesDialog.Images,
-                       HelpMenu.Images, LoadingIndicator.Images {
+       public interface Images extends FilePermissionsDialog.Images {
 
-               @Source("gr/grnet/pithos/resources/exit.png")
-               ImageResource exit();
-
-               @Source("gr/grnet/pithos/resources/folder_blue.png")
-               ImageResource folder();
-
-               @Source("gr/grnet/pithos/resources/edit.png")
-               ImageResource edit();
-
-               @Source("gr/grnet/pithos/resources/edit_group.png")
-               ImageResource group();
-
-               @Source("gr/grnet/pithos/resources/configure.png")
-               ImageResource configure();
-
-               @Source("gr/grnet/pithos/resources/help.png")
-               ImageResource help();
-
-               @Source("gr/grnet/pithos/resources/pithos-logo.png")
-               ImageResource gssLogo();
-
-               @Source("gr/grnet/pithos/resources/grnet-logo.png")
-               ImageResource grnetLogo();
+               @Source("gr/grnet/pithos/resources/pithos2-logo.png")
+               ImageResource pithosLogo();
+               
+               @Source("gr/grnet/pithos/resources/desc.png")
+               ImageResource downArrow();
        }
 
        /**
-        * A widget that displays a message indicating that communication with the
-        * server is underway.
-        */
-       private LoadingIndicator loading;
-
-       /**
         * The constructor for the top panel.
         *
         * @param images the supplied images
         */
        public TopPanel(Pithos _app, final Images images) {
         this.app = _app;
-               loading = new LoadingIndicator(images);
-        loading.hide();
                HorizontalPanel outer = new HorizontalPanel();
-
                outer.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
 
-               MenuBar menu = new MenuBar();
-               menu.setWidth("100%");
-               menu.setAutoOpen(false);
-               menu.setAnimationEnabled(true);
-               menu.setStyleName("toolbarmenu");
-
-               Command quitCommand = new Command(){
-                       @Override
-                       public void execute() {
-                               QuitDialog dlg = new QuitDialog(app);
-                               dlg.center();
-                       }
-               };
-               MenuItem quitItem = new MenuItem("<table style='font-size: 100%'><tr><td>" +
-                                       AbstractImagePrototype.create(images.exit()).getHTML() + "</td><td>Quit</td></tr></table>", true, quitCommand);
-
-               MenuItem fileItem = new MenuItem("<table style='font-size: 100%'><tr><td>" +
-                                       AbstractImagePrototype.create(images.folder()).getHTML() + "</td><td>File</td></tr></table>", true, new MenuBar(true)){
-                       @Override
-                       public MenuBar getSubMenu() {
-                               return new FileMenu(app, images);
-                       }
-               };
-
-               MenuItem editItem = new MenuItem("<table style='font-size: 100%'><tr><td>" +
-                                       AbstractImagePrototype.create(images.edit()).getHTML() + "</td><td>Edit</td></tr></table>", true, new MenuBar(true)){
-                       @Override
-                       public MenuBar getSubMenu() {
-                               return new EditMenu(app, images);
-                       }
-               };
-
-               menu.addItem(quitItem);
-               menu.addItem(fileItem);
-               menu.addItem(editItem);
-
-               outer.setSpacing(2);
                outer.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
-               outer.setCellVerticalAlignment(menu, HasVerticalAlignment.ALIGN_MIDDLE);
-               outer.add(menu);
-               outer.setStyleName("toolbar");
-
-               outer.add(loading);
-
-               HTML logos = new HTML("<table><tr><td><a href='http://pithos.grnet.gr/pithos' target='pithos'>" +       AbstractImagePrototype.create(images.gssLogo()).getHTML() +
-                                       "</a><a href='http://www.grnet.gr/' " + "target='grnet'>" +
-                                       AbstractImagePrototype.create(images.grnetLogo()).getHTML()+"</a></td></tr></table>");
-               outer.add(logos);
-
-               outer.setCellHorizontalAlignment(logos, HasHorizontalAlignment.ALIGN_RIGHT);
-
+               outer.setStyleName("pithos-topPanel");
+
+               HorizontalPanel inner = new HorizontalPanel();
+               inner.setWidth("75%");
+               inner.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
+               
+               HTML logos = new HTML("<table><tr><td><a href='/'>" + AbstractImagePrototype.create(images.pithosLogo()).getHTML() + "</a></td></tr></table>");
+               logos.addStyleName("pithos-logo");
+               inner.add(logos);
+        outer.add(inner);
+        outer.setCellHorizontalAlignment(inner, HasHorizontalAlignment.ALIGN_CENTER);
+        outer.setCellVerticalAlignment(inner, HasVerticalAlignment.ALIGN_BOTTOM);
                initWidget(outer);
        }
-
-
-       /**
-        * Retrieve the loading.
-        *
-        * @return the loading
-        */
-       public LoadingIndicator getLoading() {
-               return loading;
-       }
 }