2546: Endow Workspace Resources Explorer with filtering and display features

Task-Url: https://support.d4science.org/2546

Added scroll for Dialog Gcube Properties

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-explorer@128831 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2016-05-25 15:04:28 +00:00
parent 3069c1440d
commit 1c7b54238f
2 changed files with 38 additions and 31 deletions

View File

@ -24,7 +24,7 @@ import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.user.client.ui.Widget;
@ -40,9 +40,10 @@ public class DialogShowGcubeItem extends DialogBox implements ClickHandler {
private DockPanel dock = new DockPanel();
private Button yesButton;
private VerticalPanel vpCenterContainer;
private ScrollPanel spCenterContainer;
private ImageResource loading = WorkspaceExplorerResources.ICONS.loading();
private HorizontalPanel hpButtons = new HorizontalPanel();
// public int tableHeigth = 300;
/**
* Instantiates a new dialog show gcube items related to WorkspaceItemId.
@ -71,19 +72,21 @@ public class DialogShowGcubeItem extends DialogBox implements ClickHandler {
}
});
vpCenterContainer = new VerticalPanel();
// vpContainer.getElement().getStyle().setMargin(5.0, Unit.PX);
vpCenterContainer.add(new HTML(text));
spCenterContainer = new ScrollPanel();
spCenterContainer.getElement().getStyle().setProperty("maxHeight", "300px");
spCenterContainer.add(new HTML(text));
hpButtons = new HorizontalPanel();
hpButtons.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
hpButtons.setSpacing(3);
hpButtons.getElement().getStyle().setMarginTop(10.0, Unit.PX);
// hpButtons.getElement().getStyle().setMarginBottom(10.0, Unit.PX);
// hpButtons.setSpacing(3);
// yesButton.getElement().getStyle().setMarginRight(20.0, Unit.PX);
hpButtons.add(yesButton);
dock.add(hpButtons, DockPanel.SOUTH);
dock.setCellHorizontalAlignment(hpButtons, DockPanel.ALIGN_CENTER);
dock.add(vpCenterContainer, DockPanel.CENTER);
dock.add(spCenterContainer, DockPanel.CENTER);
setWidget(dock);
@ -120,18 +123,18 @@ public class DialogShowGcubeItem extends DialogBox implements ClickHandler {
FlexTable table = new FlexTable();
table.setWidth("100%");
// table.setHeight("50px");
if(map.size()==0){
table.setHTML(0, 0, "No properties");
return table;
}
table.addStyleName("gcube-item-table");
table.addStyleName("gwt-DialogBoxNew-table");
table.setHTML(0, 0, "N.");
table.setHTML(0, 1, "Key");
table.setHTML(0, 2, "Value");
table.getRowFormatter().getElement(0).addClassName("gcube-item-table-header");
table.getRowFormatter().getElement(0).addClassName("gwt-DialogBoxNew-table-header");
int index = 1;
GWT.log("Properties are: "+map.keySet().size());
@ -166,13 +169,13 @@ public class DialogShowGcubeItem extends DialogBox implements ClickHandler {
* @param message the message
*/
private void showLoader(String message){
vpCenterContainer.clear();
spCenterContainer.clear();
HorizontalPanel hpMask = new HorizontalPanel();
hpMask.add(new Image(loading));
HTML html = new HTML(message);
html.getElement().getStyle().setMarginLeft(5, Unit.PX);
hpMask.add(html);
vpCenterContainer.add(hpMask);
spCenterContainer.add(hpMask);
}
@ -181,7 +184,7 @@ public class DialogShowGcubeItem extends DialogBox implements ClickHandler {
*/
private void clearCenterContainer(){
try{
vpCenterContainer.clear();
spCenterContainer.clear();
}catch(Exception e){}
}
@ -191,7 +194,7 @@ public class DialogShowGcubeItem extends DialogBox implements ClickHandler {
* @param w the w
*/
public void addToCenterPanel(Widget w) {
vpCenterContainer.add(w);
spCenterContainer.add(w);
}
/**

View File

@ -89,6 +89,7 @@
z-index: 2000;
background-color: #FFFFFF;
min-width: 250px;
max-width: 500px;
}
.gwt-DialogBoxNew .Caption {
@ -150,7 +151,27 @@
-background: url(images/circles_ie6.png) no-repeat -8px -36px; */
}
.gwt-DialogBoxNew-table-header {
text-align: left;
font-weight: bold;
}
.gwt-DialogBoxNew-table {
margin-top: 10px;
margin-bottom: 10px;
}
.gwt-DialogBoxNew-table td {
border-bottom: 1px solid #EEEEEE;
height: 50%;
text-align: left;
vertical-align: middle;
padding: 5px;
}
/**** END GWT DIALOG NEW STYLE ****/
/*** TABLE ***/
.table-explorer td, th {
overflow: hidden !important;
@ -166,23 +187,6 @@
}
.gcube-item-table {
margin-top: 10px;
margin-bottom: 10px;
}
.gcube-item-table td {
border-bottom: 1px solid #EEEEEE;
height: 50%;
text-align: center;
vertical-align: middle;
padding: 5px;
}
.gcube-item-table-header {
text-align: center;
font-weight: bold;
}
/******* END TABLE ********/
/* .adaptiveHeight {
Firefox