Francesco Mangiacrapa 2017-11-13 11:34:57 +00:00
parent 9148c14acf
commit d29bac7fff
4 changed files with 75 additions and 22 deletions

View File

@ -55,8 +55,8 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
protected String folderName; protected String folderName;
protected List<String> showProperties; protected List<String> showProperties;
protected FilterCriteria filterCriteria; protected FilterCriteria filterCriteria;
protected final int offsetBreadcrumb = 40; protected final int offsetBreadcrumb = 40;
protected int parentHeight = -1;
/* (non-Javadoc) /* (non-Javadoc)
@ -84,7 +84,8 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
int heightToInt = Integer.parseInt(purgedHeight); int heightToInt = Integer.parseInt(purgedHeight);
int nh = getNewHeightForContainer(heightToInt); int nh = getNewHeightForContainer(heightToInt);
if(nh>0){ if(nh>0){
GWT.log("Set new height to center panel: "+nh); parentHeight = nh;
GWT.log("WorkspaceResourcesExplorerPanel Set new height to center panel: "+nh);
wsExplorer.getPanel().setHeight(nh+"px"); wsExplorer.getPanel().setHeight(nh+"px");
} }
}else }else
@ -527,7 +528,7 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
* @param parentHeight the parent height * @param parentHeight the parent height
* @return the new height for container * @return the new height for container
*/ */
private int getNewHeightForContainer(int parentHeight){ protected int getNewHeightForContainer(int parentHeight){
if(parentHeight>0){ if(parentHeight>0){
int bh = breadcrumbs.getHeight(); int bh = breadcrumbs.getHeight();
bh = bh>offsetBreadcrumb?bh:offsetBreadcrumb; bh = bh>offsetBreadcrumb?bh:offsetBreadcrumb;

View File

@ -18,7 +18,9 @@ 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.shared.GWT; import com.google.gwt.core.shared.GWT;
import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.user.client.ui.DockPanel; import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.FlowPanel;
/** /**
@ -30,6 +32,22 @@ import com.google.gwt.user.client.ui.DockPanel;
public class WorkspaceResourcesExplorerPanelPaginated extends WorkspaceResourcesExplorerPanel { public class WorkspaceResourcesExplorerPanelPaginated extends WorkspaceResourcesExplorerPanel {
protected WorkspaceExplorerPaginated wsExplorerPaginated; protected WorkspaceExplorerPaginated wsExplorerPaginated;
protected FlowPanel centerPanel = null;
private FlowPanel centerDock;
/* (non-Javadoc)
* @see org.gcube.portlets.widgets.wsexplorer.client.explore.WorkspaceResourcesExplorerPanel#onLoad()
*/
@Override
protected void onLoad() {
//centerPanel = new FlowPanel();
// TODO Auto-generated method stub
super.onLoad();
GWT.log("WorkspaceResourcesExplorerPanelPaginated set new height....");
if(parentHeight>0){
GWT.log("WorkspaceResourcesExplorerPanelPaginated set new height to centerDock panel: "+parentHeight);
centerDock.setHeight(parentHeight+"px");
}
}
/** /**
@ -131,21 +149,6 @@ public class WorkspaceResourcesExplorerPanelPaginated extends WorkspaceResources
super.refreshRootFolderView(); super.refreshRootFolderView();
} }
/**
* Inits the panel.
*
* @param captionTxt the caption txt is the tool-tip
*/
protected void initPanel(String captionTxt) {
super.captionTxt = captionTxt;
if(super.captionTxt!=null && !super.captionTxt.isEmpty())
setTitle(super.captionTxt);
add(breadcrumbs, DockPanel.NORTH);
setCellHeight(breadcrumbs, offsetBreadcrumb+"px");
centerScrollable.add(wsExplorerPaginated.getPagerPanel());
add(centerScrollable, DockPanel.CENTER);
}
/** /**
* Bind events. * Bind events.
*/ */
@ -200,4 +203,38 @@ public class WorkspaceResourcesExplorerPanelPaginated extends WorkspaceResources
} }
}); });
} }
/**
* Inits the panel.
*
* @param captionTxt the caption txt is the tool-tip
*/
protected void initPanel(String captionTxt) {
super.captionTxt = captionTxt;
if(super.captionTxt!=null && !super.captionTxt.isEmpty())
setTitle(super.captionTxt);
add(breadcrumbs, DockPanel.NORTH);
setCellHeight(breadcrumbs, offsetBreadcrumb+"px");
centerDock = new FlowPanel();
centerDock.getElement().getStyle().setOverflowY(Overflow.AUTO);
centerDock.add(wsExplorerPaginated.getCellPanel());
add(centerDock, DockPanel.CENTER);
add(wsExplorerPaginated.getPagerPanel(), DockPanel.SOUTH);
}
/**
* Sets the height to internal scroll.
*
* @param height the new height to internal scroll
*/
public void setHeightToInternalScroll(int height){
super.setHeightToInternalScroll(height);
int nh = super.getNewHeightForContainer(height);
if(nh>0){
GWT.log("Set new height to center Dock panel: "+nh);
centerDock.setHeight(nh+"px");
}
}
} }

View File

@ -23,6 +23,7 @@ import com.google.gwt.user.cellview.client.SimplePager;
import com.google.gwt.user.cellview.client.SimplePager.TextLocation; import com.google.gwt.user.cellview.client.SimplePager.TextLocation;
import com.google.gwt.user.client.Window; import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget; import com.google.gwt.user.client.ui.Widget;
@ -43,6 +44,8 @@ public class WorkspaceExplorerPaginated extends WorkspaceExplorer{
private VerticalPanel vPanel = new VerticalPanel(); private VerticalPanel vPanel = new VerticalPanel();
private FlowPanel pagerPanel = new FlowPanel();
private Boolean newLoading = false; private Boolean newLoading = false;
private MyCustomDataProvider<Item> dataProvider = new MyCustomDataProvider<Item>(); private MyCustomDataProvider<Item> dataProvider = new MyCustomDataProvider<Item>();
@ -325,10 +328,20 @@ public class WorkspaceExplorerPaginated extends WorkspaceExplorer{
pager.setPageSize(itemsPerPage); pager.setPageSize(itemsPerPage);
pager.getElement().getStyle().setProperty("margin", "auto"); pager.getElement().getStyle().setProperty("margin", "auto");
vPanel.add(getCellTable()); vPanel.add(getCellTable());
vPanel.add(pager); vPanel.getElement().addClassName("vPanel");
//vPanel.add(pager);
pagerPanel.add(pager);
} }
/**
* Gets the pager panel.
*
* @return the pager panel
*/
public VerticalPanel getCellPanel(){
return vPanel;
}
/** /**
@ -336,11 +349,10 @@ public class WorkspaceExplorerPaginated extends WorkspaceExplorer{
* *
* @return the pager panel * @return the pager panel
*/ */
public VerticalPanel getPagerPanel(){ public FlowPanel getPagerPanel(){
return vPanel; return pagerPanel;
} }
/** /**
* A custom {@link AsyncDataProvider}. * A custom {@link AsyncDataProvider}.
* *

View File

@ -173,6 +173,9 @@
/**** END GWT DIALOG NEW STYLE ****/ /**** END GWT DIALOG NEW STYLE ****/
/*** TABLE ***/ /*** TABLE ***/
.table-explorer{
word-wrap: break-word;
}
.table-explorer td, th { .table-explorer td, th {
overflow: hidden !important; overflow: hidden !important;
} }