onModuleLoad()
.
*/
-public class GSS implements EntryPoint, WindowResizeListener {
+public class GSS implements EntryPoint, ResizeHandler {
/**
* A constant that denotes the completion of an IncrementalCommand.
@@ -75,22 +83,23 @@ public class GSS implements EntryPoint, WindowResizeListener {
* programmatic access to all the images needed by widgets.
*/
private static Images images = (Images) GWT.create(Images.class);
+
private GlassPanel glassPanel = new GlassPanel();
/**
* An aggregate image bundle that pulls together all the images for this
* application into a single bundle.
*/
- public interface Images extends TopPanel.Images, StatusPanel.Images, FileMenu.Images, EditMenu.Images, SettingsMenu.Images, GroupMenu.Images, FilePropertiesDialog.Images, MessagePanel.Images, FileList.Images, SearchResults.Images, Search.Images, Groups.Images, Folders.Images {
+ public interface Images extends ClientBundle, TopPanel.Images, StatusPanel.Images, FileMenu.Images, EditMenu.Images, SettingsMenu.Images, GroupMenu.Images, FilePropertiesDialog.Images, MessagePanel.Images, FileList.Images, SearchResults.Images, Search.Images, Groups.Images, Folders.Images {
- @Resource("gr/ebs/gss/resources/document.png")
- AbstractImagePrototype folders();
+ @Source("gr/ebs/gss/resources/document.png")
+ ImageResource folders();
- @Resource("gr/ebs/gss/resources/edit_group_22.png")
- AbstractImagePrototype groups();
+ @Source("gr/ebs/gss/resources/edit_group_22.png")
+ ImageResource groups();
- @Resource("gr/ebs/gss/resources/search.png")
- AbstractImagePrototype search();
+ @Source("gr/ebs/gss/resources/search.png")
+ ImageResource search();
}
/**
@@ -144,7 +153,7 @@ public class GSS implements EntryPoint, WindowResizeListener {
/**
* The group list widget.
*/
- private Groups groups = new Groups(images);
+ private Groups groups = new Groups(images);
/**
* The search result widget.
@@ -152,15 +161,9 @@ public class GSS implements EntryPoint, WindowResizeListener {
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.
@@ -200,6 +203,7 @@ public class GSS implements EntryPoint, WindowResizeListener {
private PickupDragController dragController;
+ @Override
public void onModuleLoad() {
// Initialize the singleton before calling the constructors of the
// various widgets that might call GSS.get().
@@ -210,32 +214,46 @@ public class GSS implements EntryPoint, WindowResizeListener {
@Override
public void previewDragStart() throws VetoDragException {
- super.previewDragStart();
- if (context.selectedWidgets.isEmpty())
+ super.previewDragStart();
+ 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
protected Widget newDragProxy(DragContext aContext) {
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(html == null)
+ 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
container.add(html);
@@ -264,40 +282,76 @@ public class GSS implements EntryPoint, WindowResizeListener {
searchResults = new SearchResults(images);
// Inner contains the various lists.
- inner.getTabBar().setStyleName("gss-TabBar");
- inner.setStyleName("gss-TabPanel");
- inner.add(fileList, createHeaderHTML(images.folders(), "Files"), true);
+ 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(images.groups(), "Groups"), true);
- inner.add(searchResults, createHeaderHTML(images.search(), "Search Results"), true);
+ inner.add(groups, createHeaderHTML(AbstractImagePrototype.create(images.groups()), "Groups"), true);
+ inner.add(searchResults, createHeaderHTML(AbstractImagePrototype.create(images.search()), "Search Results"), true);
inner.setWidth("100%");
inner.selectTab(0);
- inner.addTabListener(new TabListener() {
- public void onTabSelected(SourcesTabEvents sender, int tabIndex) {
- switch (tabIndex) {
- case 0:
- fileList.updateCurrentlyShowingStats();
- break;
- case 1:
- groups.updateCurrentlyShowingStats();
- break;
- case 2:
- searchResults.updateCurrentlyShowingStats();
- break;
- }
- }
+ inner.addSelectionHandler(new SelectionHandler" + imageProto.getHTML() + - " | " + - caption + " |
" + imageProto.getHTML() + " | " + caption + " |