Use SSL transport all over the place, for the production deployment.
[pithos] / src / gr / ebs / gss / client / GSS.java
index b87417b..426d266 100644 (file)
@@ -20,6 +20,7 @@ package gr.ebs.gss.client;
 
 import gr.ebs.gss.client.clipboard.Clipboard;
 import gr.ebs.gss.client.dnd.DnDFocusPanel;
+import gr.ebs.gss.client.dnd.DnDSimpleFocusPanel;
 import gr.ebs.gss.client.rest.GetCommand;
 import gr.ebs.gss.client.rest.RestException;
 import gr.ebs.gss.client.rest.resource.FileResource;
@@ -48,6 +49,7 @@ import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.Window;
 import com.google.gwt.user.client.ui.AbsolutePanel;
 import com.google.gwt.user.client.ui.AbstractImagePrototype;
+import com.google.gwt.user.client.ui.DecoratedTabPanel;
 import com.google.gwt.user.client.ui.DockPanel;
 import com.google.gwt.user.client.ui.HTML;
 import com.google.gwt.user.client.ui.HasHorizontalAlignment;
@@ -155,15 +157,9 @@ public class GSS implements EntryPoint, ResizeHandler {
        private SearchResults searchResults;
 
        /**
-        * A widget that displays a message indicating that communication with the
-        * server is underway.
-        */
-       private LoadingIndicator loading;
-
-       /**
         * The tab panel that occupies the right side of the screen.
         */
-       private TabPanel inner = new TabPanel();
+       private TabPanel inner = new DecoratedTabPanel();
 
        /**
         * The split panel that will contain the left and right panels.
@@ -217,17 +213,24 @@ public class GSS implements EntryPoint, ResizeHandler {
                            if (context.selectedWidgets.isEmpty())
                                        throw new VetoDragException();
 
-                           if(context.draggable != null){
-                                       DnDFocusPanel toDrop = (DnDFocusPanel) context.draggable;
-                                       //prevent drag and drop for trashed files and for unselected tree items
-                                       if(toDrop.getFiles() != null && folders.isTrashItem(folders.getCurrent()))
-                                               throw new VetoDragException();
-                                       else if(toDrop.getItem() != null && !toDrop.getItem().equals(folders.getCurrent()))
-                                               throw new VetoDragException();
-                                       else if(toDrop.getItem() != null && !toDrop.getItem().isDraggable())
-                                               throw new VetoDragException();
-
-                           }
+                           if(context.draggable != null)
+                                       if(context.draggable instanceof DnDFocusPanel){
+                                               DnDFocusPanel toDrop = (DnDFocusPanel) context.draggable;
+                                               //prevent drag and drop for trashed files and for unselected tree items
+                                               if(toDrop.getFiles() != null && folders.isTrashItem(folders.getCurrent()))
+                                                       throw new VetoDragException();
+                                               else if(toDrop.getItem() != null && !toDrop.getItem().equals(folders.getCurrent()))
+                                                       throw new VetoDragException();
+                                               else if(toDrop.getItem() != null && !toDrop.getItem().isDraggable())
+                                                       throw new VetoDragException();
+
+                                   }
+                               else if(context.draggable instanceof DnDSimpleFocusPanel){
+                                       DnDSimpleFocusPanel toDrop = (DnDSimpleFocusPanel) context.draggable;
+                                               //prevent drag and drop for trashed files and for unselected tree items
+                                               if(toDrop.getFiles() != null && folders.isTrashItem(folders.getCurrent()))
+                                                       throw new VetoDragException();
+                               }
                          }
 
                        @Override
@@ -235,9 +238,16 @@ public class GSS implements EntryPoint, ResizeHandler {
                                AbsolutePanel container = new AbsolutePanel();
                                DOM.setStyleAttribute(container.getElement(), "overflow", "visible");
                                for (Iterator iterator = aContext.selectedWidgets.iterator(); iterator.hasNext();) {
+                                       HTML html = null;
                                        Widget widget = (Widget) iterator.next();
-                                       DnDFocusPanel book = (DnDFocusPanel) widget;
-                                       HTML html = book.cloneHTML();
+                                       if(widget instanceof DnDFocusPanel){
+                                               DnDFocusPanel book = (DnDFocusPanel) widget;
+                                               html = book.cloneHTML();
+                                       }
+                                       else if(widget instanceof DnDSimpleFocusPanel){
+                                               DnDSimpleFocusPanel book = (DnDSimpleFocusPanel) widget;
+                                               html = book.cloneHTML();
+                                       }
                                        if(html == null)
                                                container.add(new Label("Drag ME"));
                                        else
@@ -267,8 +277,9 @@ public class GSS implements EntryPoint, ResizeHandler {
                searchResults = new SearchResults(images);
 
                // Inner contains the various lists.
-               inner.getTabBar().setStyleName("gss-TabBar");
-               inner.setStyleName("gss-TabPanel");
+               inner.setAnimationEnabled(true);
+               inner.getTabBar().addStyleName("gss-MainTabBar");
+               inner.getDeckPanel().addStyleName("gss-MainTabPanelBottom");
                inner.add(fileList, createHeaderHTML(AbstractImagePrototype.create(images.folders()), "Files"), true);
 
                inner.add(groups, createHeaderHTML(AbstractImagePrototype.create(images.groups()), "Groups"), true);
@@ -297,12 +308,12 @@ public class GSS implements EntryPoint, ResizeHandler {
                        }
                });
 
-
                // Add the left and right panels to the split panel.
                splitPanel.setLeftWidget(folders);
                splitPanel.setRightWidget(inner);
                splitPanel.setSplitPosition("25%");
                splitPanel.setSize("100%", "100%");
+               splitPanel.addStyleName("gss-splitPanel");
 
                // Create a dock panel that will contain the menu bar at the top,
                // the shortcuts to the left, the status bar at the bottom and the
@@ -318,19 +329,14 @@ public class GSS implements EntryPoint, ResizeHandler {
 
                outer.setSpacing(4);
 
-               loading = new LoadingIndicator();
-
                // Hook the window resize event, so that we can adjust the UI.
                Window.addResizeHandler(this);
-
                // Clear out the window's built-in margin, because we want to take
                // advantage of the entire client area.
                Window.setMargin("0px");
-
                // Finally, add the outer panel to the RootPanel, so that it will be
                // displayed.
                RootPanel.get().add(outer);
-
                // Call the window resized handler to get the initial sizes setup. Doing
                // this in a deferred command causes it to occur after all widgets'
                // sizes have been computed by the browser.
@@ -348,7 +354,7 @@ public class GSS implements EntryPoint, ResizeHandler {
         */
        private void fetchUser(final String username) {
                String path = getApiPath() + username + "/";
-               GetCommand<UserResource> getUserCommand = new GetCommand<UserResource>(UserResource.class, username, path){
+               GetCommand<UserResource> getUserCommand = new GetCommand<UserResource>(UserResource.class, username, path, null){
 
                        @Override
                        public void onComplete() {
@@ -518,14 +524,14 @@ public class GSS implements EntryPoint, ResizeHandler {
         * Display the 'loading' indicator.
         */
        public void showLoadingIndicator() {
-               loading.center();
+               topPanel.getLoading().setVisible(true);
        }
 
        /**
         * Hide the 'loading' indicator.
         */
        public void hideLoadingIndicator() {
-               loading.hide();
+               topPanel.getLoading().setVisible(false);
        }
 
        /**
@@ -733,5 +739,4 @@ public class GSS implements EntryPoint, ResizeHandler {
        }
 
 
-
 }