256: Workspace explorer

Task-Url: https://support.d4science.org/issues/256

Enhancements

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-explorer@115521 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2015-06-24 16:43:36 +00:00
parent 5f13fb67ee
commit 7ded01868f
6 changed files with 28 additions and 19 deletions

View File

@ -7,5 +7,11 @@ public interface Icons extends ClientBundle {
@Source("cancel.png") @Source("cancel.png")
ImageResource cancel(); ImageResource cancel();
/**
* @return
*/
@Source("loading.gif")
ImageResource loading();
} }

View File

@ -1,7 +1,6 @@
package org.gcube.portlets.widgets.wsexplorer.client.resources; package org.gcube.portlets.widgets.wsexplorer.client.resources;
import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.user.client.ui.AbstractImagePrototype; import com.google.gwt.user.client.ui.AbstractImagePrototype;
/** /**
@ -9,17 +8,16 @@ import com.google.gwt.user.client.ui.AbstractImagePrototype;
* *
*/ */
public class Resources { public class Resources {
public static final Icons ICONS = GWT.create(Icons.class);
public static AbstractImagePrototype getIconCancel(){ public static final Icons ICONS = GWT.create(Icons.class);
return AbstractImagePrototype.create(ICONS.cancel()); public static AbstractImagePrototype getIconCancel() {
return AbstractImagePrototype.create(ICONS.cancel());
} }
public static ImageResource getImageCancel() {
return ICONS.cancel(); public static AbstractImagePrototype getIconLoading() {
return AbstractImagePrototype.create(ICONS.loading());
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

@ -24,11 +24,10 @@ import com.google.gwt.user.client.ui.Widget;
*/ */
public class Breadcrumbs extends Composite { public class Breadcrumbs extends Composite {
public static final String DIVIDER = ">"; public static final String DIVIDER = "/";
private LinkedHashMap<String, Item> hashFileModel = new LinkedHashMap<String, Item>();// Ordered-HashMap private LinkedHashMap<String, Item> hashFileModel = new LinkedHashMap<String, Item>();// Ordered-HashMap
private Item lastParent; private Item lastParent;
private static BreadcrumbsUiBinder uiBinder = GWT.create(BreadcrumbsUiBinder.class); private static BreadcrumbsUiBinder uiBinder = GWT.create(BreadcrumbsUiBinder.class);
private NavLink homeLink = new NavLink("Home");
@UiField @UiField
com.github.gwtbootstrap.client.ui.Breadcrumbs breadcrumbs; com.github.gwtbootstrap.client.ui.Breadcrumbs breadcrumbs;
@ -80,8 +79,7 @@ public class Breadcrumbs extends Composite {
private void initBreadcrumbs() { private void initBreadcrumbs() {
breadcrumbs.clear(); breadcrumbs.clear();
breadcrumbs.add(new NavLink(""));// INIT breadcrumbs.add(new NavLink(""));// INIT
breadcrumbs.add(homeLink);// INIT breadcrumbs.add(new NavLink(""));
breadcrumbs.add(new NavLink("2"));// INIT
} }
// @UiHandler("add") // @UiHandler("add")

View File

@ -50,6 +50,6 @@ public class Navigation extends Composite{
vre_folder.setActive(true); vre_folder.setActive(true);
vre_folder.setText(WorkspaceExplorerConstants.VRE_FOLDERS_LABEL); vre_folder.setText(WorkspaceExplorerConstants.VRE_FOLDERS_LABEL);
vre_folder.setIcon(IconType.FOLDER_OPEN_ALT); vre_folder.setIcon(IconType.FOLDER_CLOSE);
} }
} }

View File

@ -7,6 +7,7 @@ import java.util.Map;
import org.gcube.portlets.widgets.wsexplorer.client.Util; import org.gcube.portlets.widgets.wsexplorer.client.Util;
import org.gcube.portlets.widgets.wsexplorer.client.grid.ItemsTable; import org.gcube.portlets.widgets.wsexplorer.client.grid.ItemsTable;
import org.gcube.portlets.widgets.wsexplorer.client.resources.Resources;
import org.gcube.portlets.widgets.wsexplorer.client.rpc.WorkspaceExplorerService; import org.gcube.portlets.widgets.wsexplorer.client.rpc.WorkspaceExplorerService;
import org.gcube.portlets.widgets.wsexplorer.client.rpc.WorkspaceExplorerServiceAsync; import org.gcube.portlets.widgets.wsexplorer.client.rpc.WorkspaceExplorerServiceAsync;
import org.gcube.portlets.widgets.wsexplorer.shared.FilterCriteria; import org.gcube.portlets.widgets.wsexplorer.shared.FilterCriteria;
@ -14,9 +15,11 @@ import org.gcube.portlets.widgets.wsexplorer.shared.Item;
import org.gcube.portlets.widgets.wsexplorer.shared.ItemType; import org.gcube.portlets.widgets.wsexplorer.shared.ItemType;
import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.ScrollPanel; import com.google.gwt.user.client.ui.ScrollPanel;
/** /**
@ -26,11 +29,15 @@ public class WorkspaceExplorer {
private final WorkspaceExplorerServiceAsync workspaceNavigatorService = GWT.create(WorkspaceExplorerService.class); private final WorkspaceExplorerServiceAsync workspaceNavigatorService = GWT.create(WorkspaceExplorerService.class);
protected static final HorizontalPanel LOADING_PANEL = new HorizontalPanel(); protected static final HorizontalPanel LOADING_PANEL = new HorizontalPanel();
protected static final Image LOADING_IMAGE = Resources.getIconLoading().createImage();
static { static {
LOADING_PANEL.setSpacing(3); LOADING_PANEL.getElement().getStyle().setMargin(5.0, Unit.PX);
// LOADING_PANEL.add(LOADING_IMAGE); // LOADING_PANEL.setSpacing(3);
LOADING_PANEL.add(new HTML("Loading...")); LOADING_PANEL.add(LOADING_IMAGE);
HTML loading = new HTML("Loading...");
loading.getElement().getStyle().setPaddingLeft(5.0, Unit.PX);
LOADING_PANEL.add(loading);
} }
protected List<ItemType> selectableTypes = new ArrayList<ItemType>(); protected List<ItemType> selectableTypes = new ArrayList<ItemType>();
protected List<ItemType> showableTypes = new ArrayList<ItemType>(); protected List<ItemType> showableTypes = new ArrayList<ItemType>();